private void btnSave_Click(object sender, EventArgs e) { if (IsCorrectData()) { using (LeaveApplicationBalance lb = new LeaveApplicationBalance()) { lb.Username = _strUsername; lb.LeaveTypeCode = _strLeaveTypeCode; lb.Balance = clsValidator.CheckFloat(txtBalance.Text); lb.Entitlement = clsValidator.CheckFloat(txtEntitlement.Text); lb.Status = (chkStatus.Checked ? "1" : "0"); lb.Update(); if (_FormCaller == FormCallers.EmployeeDetails) { _frmEmployeeDetails.LoadLeaveEntitlement(); } else if (_FormCaller == FormCallers.LeaveEntitlementList) { _frmLeaveEntitlementList.BindLeaveBalanceList(); } _frmMdiCaller.DSGZeroEL(); _frmMdiCaller.DSGZeroVL(); _frmMdiCaller.DSGZeroSL(); this.Close(); } } }
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(); } } }