Exemplo n.º 1
0
        private void btnEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (this.dataGridView1.SelectedRows != null && this.dataGridView1.SelectedRows.Count == 1)
            {
                string _guid = this.dataGridView1.SelectedRows[0].Cells["GUID"].Value.ToString();
                string name = this.dataGridView1.SelectedRows[0].Cells["ParamName"].Value.ToString();
                EditParamForm epf = new EditParamForm();
                epf.Name = name;

                switch (this.paramEnum)
                {
                    case MotivationManager.Model.MotivationEnum.ParamEnum.Senior:
                        epf.Text = "编辑资深文案";
                        if (epf.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            Controller.SQLiteController.Biz.ModifySenior(_guid, epf.Name);
                            this.dataGridView1.DataSource = Controller.SQLiteController.Biz.GetSeniorTable().Tables[0];
                        }

                        break;
                    case MotivationManager.Model.MotivationEnum.ParamEnum.School:
                        epf.Text = "编辑院校名称";
                        if (epf.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            this.dataGridView1.DataSource = Controller.SQLiteController.Biz.GetSchoolTable().Tables[0];
                        }
                        break;
                    default:
                        break;
                }
            }
        }
Exemplo n.º 2
0
 private void btnBackThreadInterval_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     EditParamForm epf = new EditParamForm();
     epf.Text = "修改后台进程运行时间间隔(单位:秒)";
     epf.lbName.Text = "时间";
     epf.Value = (Convert.ToInt32(Controller.Util.ConfigManager.GetAppSettingValue("BackThreadInterval")) / 1000).ToString();
     if (epf.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         int interval = 300000;
         try
         {
             interval = Convert.ToInt32((Convert.ToInt32(epf.Value) * 1000));
             Controller.Util.ConfigManager.SetAppSettingValue("BackThreadInterval", (Convert.ToInt32(epf.Value) * 1000).ToString());
         }
         catch { }
     }
 }
Exemplo n.º 3
0
 private void btnNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     EditParamForm epf = new EditParamForm();
     switch (this.paramEnum)
     {
         case MotivationManager.Model.MotivationEnum.ParamEnum.Senior:
             epf.Text = "新增资深文案";
             if (epf.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 if (Controller.SQLiteController.Biz.GetSeniorList().Contains(epf.Name))
                 {
                     XtraMessageBox.Show("已经存在姓名为“" + epf.Name + "”的资深文案");
                     return;
                 }
                 Controller.SQLiteController.Biz.InsertSenior(epf.Name);
                 this.dataGridView1.DataSource = Controller.SQLiteController.Biz.GetSeniorTable().Tables[0];
             }
             break;
         case MotivationManager.Model.MotivationEnum.ParamEnum.School:
             epf.Text = "新增学校";
             if (epf.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 if (Controller.SQLiteController.Biz.GetSchoolList().Contains(epf.Name))
                 {
                     XtraMessageBox.Show("已经存在名称为“" + epf.Name + "”的学校");
                     return;
                 }
                 Controller.SQLiteController.Biz.InsertSchool(epf.Name);
                 this.dataGridView1.DataSource = Controller.SQLiteController.Biz.GetSchoolTable().Tables[0];
             }
             break;
         default:
             break;
     }
 }