예제 #1
0
 /// <summary>
 /// 编辑事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnEdit_Click(object sender, EventArgs e)
 {
     try
     {
         if (gridViewDept.FocusedRowHandle < 0)
         {
             MessageBox.Show("请选择需要编辑的行");
             return;
         }
         int     rowHandel = gridViewDept.FocusedRowHandle;
         DataRow row       = gridViewDept.GetDataRow(rowHandel);
         if (row == null)
         {
             MessageBox.Show("请选择需要编辑的行");
             return;
         }
         if (row["ISSIGNIN"] != null && row["ISSIGNIN"].Equals("1"))
         {
             MessageBox.Show("该医生已签到,无法替换");
             return;
         }
         DataTable             dt             = gridControlDepartment.DataSource as DataTable;
         ChooseConsultEmployee chooseEmployee = new ChooseConsultEmployee(m_app, dt, row);
         if (chooseEmployee == null)
         {
             return;
         }
         chooseEmployee.StartPosition = FormStartPosition.CenterParent;
         chooseEmployee.ShowDialog();
     }
     catch (Exception ex)
     {
         MyMessageBox.Show(1, ex);
     }
 }
예제 #2
0
 /// <summary>
 /// 新增事件
 /// Add xlb 2013-02-26
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         DataTable dt  = gridControlDepartment.DataSource as DataTable;
         DataRow   row = dt.NewRow();
         row["DepartmentName"]    = "";
         row["DepartmentCode"]    = "";
         row["EMPLOYEENAMESTR"]   = "";
         row["EMPLOYEECODE"]      = "";
         row["EmployeeID"]        = "";
         row["DeleteButton"]      = "删除";
         row["EmployeeLevelName"] = "";
         row["EmployeeLevelID"]   = "";
         row["EmployeeName"]      = "";
         ChooseConsultEmployee chooseEmployee = new ChooseConsultEmployee(m_app, dt, row);
         if (chooseEmployee == null)
         {
             return;
         }
         chooseEmployee.StartPosition = FormStartPosition.CenterScreen;
         if (chooseEmployee.ShowDialog() == DialogResult.OK)//保存成功刷新数据元
         {
             dt.Rows.Add(chooseEmployee.dataRow);
             gridControlDepartment.DataSource = dt;
         }
     }
     catch (Exception ex)
     {
         MyMessageBox.Show(1, ex);
     }
 }