当前位置: 首页>>代码示例>>C#>>正文


C# DBManager类代码示例

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


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


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