Beispiel #1
0
 private void editQuan()
 {
     try
     {
         int selectIndex = this.dgvQuan.GetSelectedRows()[0];
         EditQuanForm eqf = new EditQuanForm(this.country, this.dgvQuan.GetRowCellValue(selectIndex, "ID").ToString());
         eqf.Text = "编辑激励量化";
         if (eqf.ShowDialog() == DialogResult.OK)
         {
             if (this.fileList.SelectedIndex == 0)
             {
                 Controller.MainWin.MotivationData.Instanse.HandleQuan.UKDetails[this.dgvQuan.GetRowCellValue(selectIndex, "ID").ToString()] = eqf.HandleQuanDetail as Model.DTO.UKHandleQuanDetail;
                 this.bindQuan(Controller.MainWin.MotivationData.Instanse.HandleQuan.UKDetails);
             }
             else
             {
                 Controller.MainWin.MotivationData.Instanse.HandleQuan.HKDetails[this.dgvQuan.GetRowCellValue(selectIndex, "ID").ToString()] = eqf.HandleQuanDetail as Model.DTO.HKHandleQuanDetail;
                 this.bindQuan(Controller.MainWin.MotivationData.Instanse.HandleQuan.HKDetails);
             }
             this.newVersion = Guid.NewGuid();
             this.dgvQuan.FocusedRowHandle = selectIndex;
         }
         this.setAuth();
     }
     catch (Exception ex)
     {
         Controller.MainWin.MotivationData.Instanse.Save(Model.Path.AutoSaveFileName);
         MessageConsole.WriteConsole("编辑量化出现异常:" + ex.Message + "\r\n" + ex.StackTrace);
     }
 }
Beispiel #2
0
 private void addQuan()
 {
     try
     {
         EditQuanForm ihqf = new EditQuanForm(this.country);
         DialogResult dr = ihqf.ShowDialog();
         if (dr == System.Windows.Forms.DialogResult.OK)
         {
             if (ihqf.HandleQuanDetail != null)
             {
                 if (ihqf.HandleQuanDetail is Model.DTO.UKHandleQuanDetail)//英国
                 {
                     Model.DTO.UKHandleQuanDetail ukHandleQuanDetail = ihqf.HandleQuanDetail as Model.DTO.UKHandleQuanDetail;
                     //添加到数据字典中
                     Controller.MainWin.MotivationData.Instanse.HandleQuan.UKDetails.Add(ukHandleQuanDetail.ID, ukHandleQuanDetail);
                     //修改对应量化为已报
                     Controller.SQLiteController.BizContract.UpdateSubmitQuan(ukHandleQuanDetail.ContractNum, ukHandleQuanDetail.StudentName, ukHandleQuanDetail.UniversityFullName, ukHandleQuanDetail.University, ukHandleQuanDetail.Course);
                     this.bindQuan(Controller.MainWin.MotivationData.Instanse.HandleQuan.UKDetails);
                 }
                 else if (ihqf.HandleQuanDetail is Model.DTO.HKHandleQuanDetail)
                 {
                     Model.DTO.HKHandleQuanDetail hkHandleQuanDetail = ihqf.HandleQuanDetail as Model.DTO.HKHandleQuanDetail;
                     //添加到数据字典中
                     Controller.MainWin.MotivationData.Instanse.HandleQuan.HKDetails.Add(hkHandleQuanDetail.ID, hkHandleQuanDetail);
                     //修改对应量化为已报
                     Controller.SQLiteController.BizContract.UpdateSubmitQuan(hkHandleQuanDetail.ContractNum, hkHandleQuanDetail.StudentName, hkHandleQuanDetail.UniversityFullName, hkHandleQuanDetail.University, hkHandleQuanDetail.Course);
                     this.bindQuan(Controller.MainWin.MotivationData.Instanse.HandleQuan.HKDetails);
                 }
                 //添加完成后默认选中该行
                 this.dgvQuan.FocusedRowHandle = this.dgvQuan.RowCount - 1;
                 this.newVersion = Guid.NewGuid();
             }
         }
         this.setAuth();
     }
     catch (Exception ex)
     {
         Controller.MainWin.MotivationData.Instanse.Save(Model.Path.AutoSaveFileName);
         MessageConsole.WriteConsole("新增量化出现异常:" + ex.Message + "\r\n" + ex.StackTrace);
     }
 }