• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# DBManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DBManager的典型用法代码示例。如果您正苦于以下问题:C# DBManager类的具体用法?C# DBManager怎么用?C# DBManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DBManager类属于命名空间,在下文中一共展示了DBManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: InsertUser

        public string InsertUser(string Username,string Mailid)
        {
            string Result = "a";
            DBManager DbObj=new DBManager();

            DbParameter[] dbparms = new DbParameter[2];

            dbparms[0] = DbObj.CreateParameter("@Username", Username);
            dbparms[1] = DbObj.CreateParameter("@UserMail", Mailid);
            Result = DbObj.ExecuteScalar("InsertUser", dbparms, CommandType.StoredProcedure).ToString();

            return Result;
        }
开发者ID:eldhoabe,项目名称:AngelHack,代码行数:13,代码来源:Service1.svc.cs


示例2: Save

 public void Save()
 {
     DBManager db = new DBManager();
     db.Connect();
     db.Insert(String.Format("insert into product_image VALUES (null,'{0}','{1}','{2}')", productID, url, orderOfDisplay));
     db.Close();
 }
开发者ID:Ailanz,项目名称:ControlPanel,代码行数:7,代码来源:ProductImageDAO.cs


示例3: EditParametersForm

        public EditParametersForm(DBManager aDBManager)
        {
            InitializeComponent();
            mDBManager = aDBManager;
            if (mDBManager.AlgorithmParameters == null)
            {
                mDBManager.AlgorithmParameters = new AlgorithmParameters();
            }

            ControlGroups.Add(new Control[] { firstLow, firstMedium, firstHigh});
            ControlGroups.Add(new Control[] { secondLow, secondMedium, secondHigh });
            ControlGroups.Add(new Control[] { thirdLow, thirdMedium, thirdHigh });
            ControlGroups.Add(new Control[] { fourthLow, fourthMedium, fourthHigh });
            ControlGroups.Add(new Control[] { fifthLow, fifthMedium, fifthHigh });
            ControlGroups.Add(new Control[] { sixthLow, sixthMedium, sixthHigh });
            ControlGroups.Add(new Control[] { seventhLow, seventhMedium, seventhHigh });

            for (int i = 0; i < 7; i++)
            {
                foreach (var item in ControlGroups[i])
                {
                    item.Enabled = false;
                }
            }
        }
开发者ID:GorelH,项目名称:ScheduleWorks,代码行数:25,代码来源:EditParametersForm.cs


示例4: Save

 public void Save()
 {
     DBManager db = new DBManager();
     db.Connect();
     db.Insert(String.Format("insert into size VALUES (null,'{0}')", sizeLabel));
     db.Close();
 }
开发者ID:Ailanz,项目名称:ControlPanel,代码行数:7,代码来源:SizeDAO.cs


示例5: GetFeatureInfo

 public EnableFeatureInfoRec GetFeatureInfo(DBManager dbManager, FeatureType type, string subType)
 {
     using (IDBProvider dbInstance = SP.DB.GetInstance(dbManager))
     {
         return dbInstance._<EnableFeatureAccessor>().SelectInfoByType(GetFeatureTypeKey(type, subType));
     }
 }
开发者ID:danni95,项目名称:Core,代码行数:7,代码来源:FeatureProvider.cs


示例6: InitConfiguration

        private void InitConfiguration(DBManager dbManager)
        {
            //init vars
            List<APITimeoutConfigRec> tmpConfigList;
            Dictionary<APIG, APITimeoutConfigRec> tmpMapByGroup = new Dictionary<APIG, APITimeoutConfigRec>();

            //get list
            using (IDBProvider dbInstance = SP.DB.GetInstance(dbManager))
            {
                tmpConfigList = dbInstance._<APITimeoutConfigAccessor>().SelectList();
                foreach (var record in tmpConfigList)
                {
                    tmpMapByGroup.Add(record.Type, record);
                }
            }

            //first init (if no data in the database)
            Util.Enum.GetValues<APIG>().ForEach(item =>
                {
                    if (!tmpMapByGroup.ContainsKey(item))
                    {
                        var record = new APITimeoutConfigRec
                            {
                                Type = item,
                                TimeoutMs = DEFAULT_TIMEOUT_MS
                            };
                        tmpConfigList.Add(record);
                        tmpMapByGroup.Add(item, record);
                    }
                });

            //result
            Interlocked.Exchange(ref _configList, tmpConfigList);
            Interlocked.Exchange(ref _mapByGroup, tmpMapByGroup);
        }
开发者ID:danni95,项目名称:Core,代码行数:35,代码来源:APITimeoutConfigProvider.cs


示例7: SelectFromDB

        public static DataRowCollection SelectFromDB(String query, String database)
        {
            DBManager dbManager = new DBManager();
            MySqlConnection con = null;

            try
            {
                String ip = DBConst.kDbIp;
                con = dbManager.CreateConnection(ip, database);
                con.Open();

                MySqlCommand cmd = new MySqlCommand(query, con);
                MySqlDataAdapter dataAdapter = new MySqlDataAdapter(cmd);

                DataSet ds = new DataSet("data");

                dataAdapter.Fill(ds, "data");
                DataRowCollection drc = ds.Tables["data"].Rows;

                return drc;
            }
            catch (System.Exception ex)
            {
                logger.Warn(ex.ToString());
            }
            finally
            {
                dbManager.Close(con);
            }
            return null;
        }
开发者ID:HongSeokHwan,项目名称:legacy,代码行数:31,代码来源:DBUtil.cs


示例8: Save

 public void Save()
 {
     DBManager db = new DBManager();
     db.Connect();
     db.Insert(String.Format("insert into size_map VALUES (null,'{0}','{1}')", productID, sizeID));
     db.Close();
 }
开发者ID:Ailanz,项目名称:ControlPanel,代码行数:7,代码来源:SizeMapDAO.cs


示例9: Save

 public void Save()
 {
     DBManager db = new DBManager();
     db.Connect();
     db.Insert(String.Format("insert into product_detail VALUES (null,'{0}')", description));
     db.Close();
 }
开发者ID:Ailanz,项目名称:ControlPanel,代码行数:7,代码来源:ProductDetailDAO.cs


示例10: Execute

        public static int Execute(String query, String database)
        {
            DBManager dbManager = new DBManager();
            MySqlConnection con = null;

            try
            {
                String ip = DBConst.kDbIp;
                con = dbManager.CreateConnection(ip, database);
                con.Open();

                MySqlCommand cmd = new MySqlCommand(query, con);

                int ret = cmd.ExecuteNonQuery();
                return ret;
            }
            catch (System.Exception ex)
            {
                logger.Warn(ex.ToString());
            }
            finally
            {
                dbManager.Close(con);
            }
            return -1;
        }
开发者ID:HongSeokHwan,项目名称:legacy,代码行数:26,代码来源:DBUtil.cs


示例11: checkForErrors

    public bool checkForErrors(DBManager dbManager)
    {
        //this should wipe error messages first
        removeNotificationsByType(typeof(NotifyError));

        foreach (Supervillain s in dbManager.SupervillainDB.listOfSupervillains()){
            //check for undecided students
            if (s.Age.GetType() == typeof(Student)){
                if (((Student) s.Age).School.GetType() == typeof (Undecided)) {
                    addNotification(new Notification(new NotifyError(),
                        "Assign " + s.SuperhumanName + " a school!"));
                }
            }
            //check for unemployed adults
            else if (s.Age.GetType() == typeof(Adult)) {
                if (((Adult)s.Age).Occupation.GetType() == typeof(Unemployed)) {
                    addNotification(new Notification(new NotifyError(),
                        "Assign " + s.SuperhumanName + " an occupation!"));
                }
            }
        }

        //more than 4 classes in a cirrculum
        //...
        return findErrorNotifications();
    }
开发者ID:barykade,项目名称:SupervillainColonyLeader,代码行数:26,代码来源:NotificationManager.cs


示例12: GetAllDataListCategory

 static public DataTable   GetAllDataListCategory()
 {
     String SQL = "select Category, Category from Sch.DesignformDatalist group by category";
     DBManager db = new DBManager();
     return  db.GetDataTableFromSQL(SQL);
     
 }
开发者ID:traveler33,项目名称:Pelesys.Scheduling,代码行数:7,代码来源:DesignFormDataList.cs


示例13: EditGroupsForm

        public EditGroupsForm(DBManager aDBManager, int classID)
        {
            InitializeComponent();

            mDBManager = aDBManager;
            mClass = mDBManager.Classes[0];
            foreach(var c in mDBManager.Classes){
                if(c.ID == classID){
                    mClass = c;
                    break;
                }
            }

            gridviewGroups.Columns.Add("Име");
            gridviewGroups.AllowAutoSizeColumns = true;
            gridviewGroups.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
            gridviewGroups.AllowDrop = false;
            gridviewGroups.AllowMultiColumnSorting = false;
            gridviewGroups.AllowDragToGroup = false;
            gridviewGroups.ShowGroupPanel = false;

            try
            {
                foreach (var group in mClass.Groups)
                {
                    gridviewGroups.Rows.Add(group);
                }
            }
            catch {
                mClass.Groups = new List<string>();
            }
        }
开发者ID:GorelH,项目名称:ScheduleWorks,代码行数:32,代码来源:EditGroupsForm.cs


示例14: AddOrEditClassForm

        public AddOrEditClassForm(DBManager dbManag)
        {
            InitializeComponent();
            mDBManager = dbManag;

            this.Text = FormTitles.ClassForm.Add;
            mFormState = FormState.AddingNew;

            RadListDataItem dropDownItem = new RadListDataItem("1");
            dropDownItem.Value = 1;
            dropDownItem.Selected = true;
            gradeDropdownlist.Items.Add(dropDownItem);
            for (int i = 2; i <= 12; ++i)
            {
                dropDownItem = new RadListDataItem(i.ToString());
                dropDownItem.Value = i;
                gradeDropdownlist.Items.Add(dropDownItem);
            }

            importTeachersFromTheDatabase();

            changingHeadteacherReadyButton.Visible = false;
            teachersDropdownlist.Visible = false;

            changeHeadTeacherButton.Visible = false;
            changingHeadteacherReadyButton.Visible = true;
            teachersDropdownlist.Visible = true;

            colorPanel.BackColor = RandomColor.GetRandomColor();

            gradeDropdownlist.DropDownStyle = RadDropDownStyle.DropDownList;
            teachersDropdownlist.DropDownStyle = RadDropDownStyle.DropDownList;
        }
开发者ID:GorelH,项目名称:ScheduleWorks,代码行数:33,代码来源:AddOrEditClassForm.cs


示例15: AssemblyDetailsForm_Load

        private void AssemblyDetailsForm_Load(object sender, EventArgs e)
        {
            manager = new DBManager(RevitDocument);

            //if (this.IsAdd)
            //{
            //    lblTitle.Text = "";
            //}
            //else
            //{
                toSwap = CurrentAssembly;
            //    lblToSwap.Text = toSwap.AssemblyName;
                loadInformation(toSwap);
            //}
            List<Assembly> fromModel = manager.RetrieveWallInfo();
            //List<Assembly> options = null;
            //if (this.IsAdd)
            //options = manager.getAllAssemblies();
            //options.AddRange(fromModel);

            //else
            //    options = manager.getAssembliesByCode(toSwap.AssemblyCode);
            //if (options != null)
            //{
            //    foreach (Assembly a in options)
            //        cboAlternatives.Items.Add(a);
            //}
        }
开发者ID:jrivera777,项目名称:RevitLibrary,代码行数:28,代码来源:AssemblyDetailsForm.cs


示例16: Save

 public void Save()
 {
     DBManager db = new DBManager();
     db.Connect();
     db.Insert(String.Format("insert into product VALUES (null,'{0}','{1}','{2}','{3}')", name, collectionID, price, description));
     db.Close();
 }
开发者ID:Ailanz,项目名称:ControlPanel,代码行数:7,代码来源:ProductDAO.cs


示例17: InitConfiguration

        private void InitConfiguration(DBManager dbManager)
        {
            var tmpAccountTypeList = new Dictionary<long, List<VendorAccountTypeInfoRec>>();
            var tmpAccessList = new Dictionary<long, List<VendorAccountTypeAccessRec>>();

            using (IDBProvider dbInstance = SP.DB.GetInstance(dbManager))
            {
                var domainList = SP.DomainProvider.Domains;
                foreach (var domainRec in domainList)
                {
                    var domainID = domainRec.DomainID;

                    SP.SessionContext.ExecuteInSystemSessionContext(domainID, () =>
                    {
                        //start tx
                        dbInstance.BeginTransaction();

                        //translock
                        var dummy = Entity<DomainRec>.SelectForUpdate(dbInstance.Get, domainRec.ID);

                        //read config
                        tmpAccountTypeList.Add(domainID, dbInstance._<VendorAccountTypeAccessor>().AccountTypeList());
                        tmpAccessList.Add(domainID, dbInstance._<VendorAccountTypeAccessor>().AccessList());

                        //commit tx
                        dbInstance.CommitTransaction();
                    });
                }
            }

            //result
            Interlocked.Exchange(ref _accountTypeList, tmpAccountTypeList);
            Interlocked.Exchange(ref _accessList, tmpAccessList);
        }
开发者ID:danni95,项目名称:Core,代码行数:34,代码来源:VendorAccountTypeConfigProvider.cs


示例18: sharedManager

 public static DBManager sharedManager()
 {
     if (_sharedDBManager == null) {
         GameObject obj = new GameObject();
         _sharedDBManager = obj.AddComponent<DBManager>();
     }
     return _sharedDBManager;
 }
开发者ID:CaptainTeemo,项目名称:SqliteWrapperForUnity,代码行数:8,代码来源:DBManager.cs


示例19: Update

 public void Update(DBManager dbManager,List<APITimeoutConfigRec> data)
 {
     //lock to avoid concurrent actions
     lock (_locker)
     {
         UpdateConfiguration(dbManager, data);
     }
 }
开发者ID:danni95,项目名称:Core,代码行数:8,代码来源:APITimeoutConfigProvider.cs


示例20: Update

 public void Update(DBManager dbManager, List<VendorAccountTypeRec> accountTypeList, List<VendorAccountTypeAccessRec> accessList, string note)
 {
     //lock to avoid concurrent actions
     lock (_locker)
     {
         UpdateConfiguration(dbManager, accountTypeList, accessList, note);
     }
 }
开发者ID:danni95,项目名称:Core,代码行数:8,代码来源:VendorAccountTypeConfigProvider.cs



注:本文中的DBManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DBObjectStream类代码示例发布时间:2022-05-24
下一篇:
C# DBLayer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap