示例#1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (IsCorrectData())
     {
         using (clsDepartmentApprover cda = new clsDepartmentApprover())
         {
             cda.DepartmentCode  = cmbDepartment.SelectedValue.ToString();
             cda.Username        = cmbEmployee.SelectedValue.ToString();
             cda.CanApproveLeave = (chkLeave.Checked ? "1" : "0");
             cda.CanApproveUT    = (chkUndertime.Checked ? "1" : "0");
             cda.CanApproveOB    = (chkOB.Checked ? "1" : "0");
             cda.CanApproveOT    = (chkOvertime.Checked ? "1" : "0");
             cda.Insert();
         }
         _frmDepartmentEdit.LoadApproverList();
     }
     this.Close();
 }
示例#2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (IsCorrectData())
     {
         using (clsDepartmentApprover cda = new clsDepartmentApprover())
         {
             cda.ApproverID      = tbApprvID.Text;
             cda.DepartmentCode  = cmbDepartment.SelectedValue.ToString();
             cda.Username        = cmbEmployee.SelectedValue.ToString();
             cda.CanApproveLeave = (chkLeave.Checked ? "1" : "0");
             cda.CanApproveUT    = (chkUndertime.Checked ? "1" : "0");
             cda.CanApproveOB    = (chkOB.Checked ? "1" : "0");
             cda.CanApproveOT    = (chkOvertime.Checked ? "1" : "0");
             cda.Insert();
         }
         _frmDepartmentEdit.LoadApproverList();
         MessageBox.Show("You have successfully added new Approver", "Save Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     this.Close();
 }