Exemple #1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (IsCorrectData())
     {
         using (LeaveApplicationBalance lb = new LeaveApplicationBalance())
         {
             lb.Username      = cmbEmployee.SelectedValue.ToString();
             lb.LeaveTypeCode = _strLeaveTypeCode;
             lb.Balance       = clsValidator.CheckFloat(txtBalance.Text);
             lb.Entitlement   = clsValidator.CheckFloat(txtEntitlement.Text);
             lb.Status        = "1";
             lb.Insert();
             if (_FormCaller == FormCallers.EmployeeDetails)
             {
                 _frmEmployeeDetails.LoadLeaveTypes();
                 _frmEmployeeDetails.LoadLeaveEntitlement();
             }
             else if (_FormCaller == FormCallers.LeaveEntitlementList)
             {
                 _frmLeaveEntitlementList.BindLeaveBalanceList();
             }
             this.Close();
         }
     }
 }