/// <summary> /// Set Employees Button Click /// </summary> private void SetEmpBtn_Click(object sender, EventArgs e) { try { var Dialog = new OutEmployeeDialog(true); if (Dialog.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { Employees.Clear(); if (Dialog.SelectedItems.Count > 0) { Employees.AddRange(Dialog.SelectedItems); } BindEmployeesToGridView(); } } catch (Exception err) { Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.BatchOutCardsForm.SetEmpBtn.Click", err.Message, err.StackTrace); MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// Set Employee Button Click Event. /// </summary> private void SetEmpBtn_Click(object sender, EventArgs e) { try { if (CurCard.WorkerType == EnmWorkerType.WXRY) { var Dialog = new OutEmployeeDialog(false); if (Dialog.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { if (Dialog.SelectedItems.Count > 0) { var StEmployee = Dialog.SelectedItems[0]; CurCard.DepId = StEmployee.DepId; CurCard.DepName = StEmployee.DepName; CurCard.WorkerId = StEmployee.EmpId; CurCard.WorkerName = StEmployee.EmpName; EmpNameTB.Text = String.Format("{0} - {1}", StEmployee.EmpId, StEmployee.EmpName); } } } else { var Dialog = new OrgEmployeeDialog(false); if (Dialog.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { if (Dialog.SelectedItems.Count > 0) { var StEmployee = Dialog.SelectedItems[0]; CurCard.DepId = StEmployee.DepId; CurCard.DepName = StEmployee.DepName; CurCard.WorkerId = StEmployee.EmpId; CurCard.WorkerName = StEmployee.EmpName; CurCard.WorkerType = StEmployee.EmpType; EmpNameTB.Text = String.Format("{0} - {1}", StEmployee.EmpId, StEmployee.EmpName); } } } } catch (Exception err) { Common.WriteLog(DateTime.Now, EnmMsgType.Error, "System", "Delta.MPS.AccessSystem.SaveCardForm.SetEmpBtn.Click", err.Message, err.StackTrace); MessageBox.Show(err.Message, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }