private void InsertDesgination(string desName, string grade, decimal?Gosssalary) { try { DESIGNATION_BLL objDeg_BLL = new DESIGNATION_BLL(); double gross_Salary = Convert.ToDouble(Gosssalary); double medical = 250; double taransport = 200; double food = 650; double withoutMedical = (gross_Salary - (medical + taransport + food)); double Basic = (withoutMedical) / 1.4; double houseRent = (Basic * 40) / 100; HRM_DESIGNATIONS designationObj = new HRM_DESIGNATIONS(); designationObj.DEG_NAME = desName.ToString(); designationObj.GRADE = grade; designationObj.GROSS_SAL = Convert.ToDecimal(gross_Salary); designationObj.HOUSE_RENT = Convert.ToDecimal(houseRent); designationObj.BASIC = Convert.ToDecimal(Basic); designationObj.MEDICAL = Convert.ToDecimal(medical); designationObj.FOOD_ALLOW = Convert.ToDecimal(0.00); designationObj.CONVEYANCE = Convert.ToDecimal(0.00); designationObj.EDIT_USER = ((SessionUser)Session["SessionUser"]).UserId; designationObj.EDIT_DATE = DateTime.Now; designationObj.OCODE = ((SessionUser)Session["SessionUser"]).OCode; int result = objDeg_BLL.InsertDeignation(designationObj); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }
private void InsertDesgination(string desName, string grade, decimal?Gosssalary) { try { DESIGNATION_BLL objDeg_BLL = new DESIGNATION_BLL(); decimal gross_Salary = Convert.ToDecimal(Gosssalary); decimal medical = 200; decimal withoutMedical = (gross_Salary - medical); decimal houseRent = (withoutMedical * 44) / 100; decimal Basic = (withoutMedical * 56) / 100; HRM_DESIGNATIONS designationObj = new HRM_DESIGNATIONS(); designationObj.DEG_NAME = desName.ToString(); designationObj.GRADE = grade; designationObj.GROSS_SAL = gross_Salary; designationObj.HOUSE_RENT = houseRent; designationObj.BASIC = Basic; designationObj.MEDICAL = medical; designationObj.FOOD_ALLOW = Convert.ToDecimal(0.00); designationObj.CONVEYANCE = Convert.ToDecimal(0.00); designationObj.EDIT_USER = ((SessionUser)Session["SessionUser"]).UserId; designationObj.EDIT_DATE = DateTime.Now; designationObj.OCODE = ((SessionUser)Session["SessionUser"]).OCode; int result = objDeg_BLL.InsertDeignation(designationObj); } catch (Exception) { throw; } }
//-------Update------------------------------------ public int UpdateDesignation(HRM_DESIGNATIONS objDeg, int designationID) { try { HRM_DESIGNATIONS obj = _context.HRM_DESIGNATIONS.First(x => x.DEG_ID == designationID); obj.DEG_NAME = objDeg.DEG_NAME; obj.GRADE = objDeg.GRADE; obj.GROSS_SAL = objDeg.GROSS_SAL; obj.HOUSE_RENT = objDeg.HOUSE_RENT; obj.BASIC = objDeg.BASIC; obj.MEDICAL = objDeg.MEDICAL; obj.CONVEYANCE = objDeg.CONVEYANCE; obj.FixedAllowance = objDeg.FixedAllowance; obj.AttendanceBonus = objDeg.AttendanceBonus; obj.Holiday_Allowance = objDeg.Holiday_Allowance; obj.EDIT_USER = objDeg.EDIT_USER; obj.EDIT_DATE = objDeg.EDIT_DATE; _context.SaveChanges(); return(1); } catch (Exception ex) { throw ex; } }
// FoodAllowance is Fixed Allowance // Other is Alltendance Bouns protected void btnSave_Click(object sender, EventArgs e) { try { decimal GROSS_SAL = Convert.ToDecimal(txtGrsSal.Text); decimal HOUSE_RENT = Convert.ToDecimal(txtHouseRent.Text); decimal BASIC = Convert.ToDecimal(txtBasic.Text); decimal MEDICAL = Convert.ToDecimal(txtMedical.Text); decimal Convenc = Convert.ToDecimal(txtConveyance.Text); decimal FOOD_ALLOW = Convert.ToDecimal(txtFoodAllowance.Text); decimal TOTAL = (BASIC + HOUSE_RENT + MEDICAL + Convenc + FOOD_ALLOW); if (GROSS_SAL == TOTAL) { HRM_DESIGNATIONS designationObj = new HRM_DESIGNATIONS(); designationObj.DEG_NAME = txtbxDesignation.Text; designationObj.GRADE = txtbxGrade.Text; designationObj.GROSS_SAL = Convert.ToDecimal(txtGrsSal.Text); designationObj.HOUSE_RENT = Convert.ToDecimal(txtHouseRent.Text); designationObj.BASIC = Convert.ToDecimal(txtBasic.Text); designationObj.MEDICAL = Convert.ToDecimal(txtMedical.Text); designationObj.FOOD_ALLOW = Convert.ToDecimal(txtFoodAllowance.Text); designationObj.CONVEYANCE = Convert.ToDecimal(txtConveyance.Text); designationObj.EDIT_USER = ((SessionUser)Session["SessionUser"]).UserId; designationObj.EDIT_DATE = DateTime.Now; designationObj.OCODE = ((SessionUser)Session["SessionUser"]).OCode; if (btnSave.Text == "Save") { int result = objDeg_BLL.InsertDeignation(designationObj); if (result == 1) { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "text", "func('Data Save successfully!')", true); } } else { int desginationId = Convert.ToInt32(hidDesignationId.Value); int result = objDeg_BLL.UpdateDesignation(designationObj, desginationId); if (result == 1) { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "text", "func('Data Update successfully!')", true); } } getDesignations(); ClearDesignationUi(); } else { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "text", "func('Gross Total is not Equal to Misc. Total!')", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }
private void GetSalaryIncrementLog() { DESIGNATION_BLL objDeg_BLL = new DESIGNATION_BLL(); SalaryIncrementBLL _salaryIncrementBll = new SalaryIncrementBLL(); try { string OCODE = ((SessionUser)Session["SessionUser"]).OCode; List <HRM_SalaryIncrement> salaryIncrements = _salaryIncrementBll.GetSalaryIncrementLog(OCODE); DateTime serverDate = _salaryIncrementBll.GetServerDate(); List <HRM_PersonalInformations> personalInfoes = _salaryIncrementBll.GetAllEmployess(OCODE); List <HRM_DESIGNATIONS> designationes = _salaryIncrementBll.GetAllDesgination(OCODE); List <SalaryIncrementR> slaryIncrementRes = new List <SalaryIncrementR>(); foreach (HRM_SalaryIncrement aitem in salaryIncrements) { if (serverDate >= aitem.EffectiveDate) { SalaryIncrementR _salaryIncrementR = new SalaryIncrementR(); int? desId = personalInfoes.Where(x => x.EID == aitem.EID).FirstOrDefault().DesginationId; string desName = designationes.Where(x => x.DEG_ID == desId).FirstOrDefault().DEG_NAME; string grade = designationes.Where(x => x.DEG_ID == desId).FirstOrDefault().GRADE; decimal?Gosssalary = aitem.IncrementSalary; //designationes.Where(x => x.DEG_ID == desId).FirstOrDefault().GROSS_SAL; bool Status = CheckDesignation(desName, grade, Gosssalary); if (Status == false) { InsertDesgination(desName, grade, Gosssalary); } HRM_DESIGNATIONS _Desobj = objDeg_BLL.GetDesignationIdByDesNameGradAndGoss(desName, grade, Gosssalary); if (_Desobj != null) { _salaryIncrementR.Eid = aitem.EID; _salaryIncrementR.IncrementDate = aitem.IncrementDate; _salaryIncrementR.Grade = grade; _salaryIncrementR.SalaryIncrementStatus = "Salary Increment"; _salaryIncrementR.EffectiveDate = aitem.EffectiveDate; _salaryIncrementR.previousSalary = aitem.previousSalary; _salaryIncrementR.Slary = Convert.ToDecimal(aitem.IncrementSalary); _salaryIncrementR.DesId = _Desobj.DEG_ID; _salaryIncrementR.Ocode = ((SessionUser)Session["SessionUser"]).OCode; _salaryIncrementR.EDIT_USER = ((SessionUser)Session["SessionUser"]).UserId; _salaryIncrementR.EDIT_DATE = DateTime.Now; slaryIncrementRes.Add(_salaryIncrementR); } } } if (slaryIncrementRes.Count > 0) { int result = _salaryIncrementBll.AutomaticSalaryUpdate(slaryIncrementRes); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }
internal HRM_DESIGNATIONS GetDesignationId(string Desgination, string Grad, decimal Gosssalary) { try { HRM_DESIGNATIONS _desgination = _context.HRM_DESIGNATIONS.FirstOrDefault(x => x.DEG_NAME == Desgination && x.GRADE == Grad && x.GROSS_SAL == Gosssalary); return(_desgination); } catch (Exception) { throw; } }
//-------Insert------------------------------------ public int InsertDeignation(HRM_DESIGNATIONS objDeg) { try { _context.HRM_DESIGNATIONS.AddObject(objDeg); _context.SaveChanges(); return(1); } catch (Exception ex) { throw new Exception(ex.Message.ToString()); } }
//-------Delete------------------------------------ public int DeleteDesignation(int designationID) { try { HRM_DESIGNATIONS objDept = _context.HRM_DESIGNATIONS.First(x => x.DEG_ID == designationID); _context.HRM_DESIGNATIONS.DeleteObject(objDept); _context.SaveChanges(); return(1); } catch (Exception ex) { throw ex; } }
internal bool CheckDesignation(string Desgination, string Grad, decimal Gosssalary) { try { bool status = false; HRM_DESIGNATIONS _desgination = _context.HRM_DESIGNATIONS.FirstOrDefault(x => x.DEG_NAME == Desgination && x.GRADE == Grad && x.GROSS_SAL == Gosssalary); if (_desgination != null) { status = true; } return(status); } catch (Exception) { throw; } }
protected void btnUpdate_click(object sender, EventArgs e) { try { DESIGNATION_BLL objDeg_BLL = new DESIGNATION_BLL(); HRM_PersonalInformations personalInfo = new HRM_PersonalInformations(); string EmployeeId = Convert.ToString(Session["EID"]); string grossSalary; personalInfo.Grade = txtbxGarde.Text; grossSalary = txtbxGrossSalary.Text.ToString(); personalInfo.Salary = Convert.ToDecimal(grossSalary); string DesginationName = ddlDesignations.SelectedItem.Text.ToString(); bool Status = CheckDesignation(DesginationName, Convert.ToString(personalInfo.Grade), Convert.ToDecimal(personalInfo.Salary)); if (Status == false) { //Change Logic Provide By MasumVai ----- Edited------- Kamruzzaman. double gross_Salary = Convert.ToDouble(personalInfo.Salary); double medical = 250; double taransport = 200; double food = 650; double withoutMedical = (gross_Salary - (medical + taransport + food)); double Basic = (withoutMedical) / 1.4; double houseRent = (Basic * 40) / 100; HRM_DESIGNATIONS designationObj = new HRM_DESIGNATIONS(); designationObj.DEG_NAME = ddlDesignations.SelectedItem.ToString(); designationObj.GRADE = personalInfo.Grade; designationObj.GROSS_SAL = Convert.ToDecimal(gross_Salary); designationObj.HOUSE_RENT = Convert.ToDecimal(houseRent); designationObj.BASIC = Convert.ToDecimal(Basic); designationObj.MEDICAL = Convert.ToDecimal(medical); designationObj.CONVEYANCE = Convert.ToDecimal(taransport); designationObj.FOOD_ALLOW = Convert.ToDecimal(food); designationObj.EDIT_USER = ((SessionUser)Session["SessionUser"]).UserId; designationObj.EDIT_DATE = DateTime.Now; designationObj.OCODE = ((SessionUser)Session["SessionUser"]).OCode; int resultforDesgination = objDeg_BLL.InsertDeignation(designationObj); } HRM_DESIGNATIONS _Desobj = objDeg_BLL.GetDesignationId(DesginationName, Convert.ToString(personalInfo.Grade), Convert.ToDecimal(personalInfo.Salary)); if (_Desobj != null) { personalInfo.DesginationId = _Desobj.DEG_ID; personalInfo.Grade = _Desobj.GRADE; personalInfo.Salary = _Desobj.GROSS_SAL; personalInfo.EmployeeType = Convert.ToInt32(drpEmployeeType.SelectedValue); personalInfo.EmpCategoryId = Convert.ToInt32(drpEmployeeCate.SelectedValue); personalInfo.RegionsId = Convert.ToInt32(drpRegion.SelectedValue); personalInfo.OfficeId = Convert.ToInt32(ddlOffice.SelectedValue); personalInfo.DepartmentId = Convert.ToInt32(ddlDepartment.SelectedValue); personalInfo.SectionId = Convert.ToInt32(ddlSection.SelectedValue); personalInfo.SubSectionId = Convert.ToInt32(ddlSubSections.SelectedValue); //personalInfo.EffectiveSlary = Convert.ToDecimal(txtbxEffectiveSlary.Text); personalInfo.EffectiveSlary = 0; //personalInfo.DesginationId = Convert.ToInt32(ddlDesignations.SelectedValue); personalInfo.ShiftCode = ddlShift.SelectedValue.ToString(); personalInfo.OTApplicable = Convert.ToBoolean(drpdwnOTApplicable.SelectedValue); personalInfo.Attendance_Bouns = Convert.ToBoolean(drpAttandenceApplicable.SelectedValue); if (drpLateApplicable.SelectedValue == "0") { personalInfo.Late_Applicable = false; } else { personalInfo.Late_Applicable = Convert.ToBoolean(drpLateApplicable.SelectedValue); } if (drpAbsenceApplicable.SelectedValue == "0") { personalInfo.Absence_Applicable = false; } else { personalInfo.Absence_Applicable = Convert.ToBoolean(drpAbsenceApplicable.SelectedValue); } if (drpTaxApplicable.SelectedValue == "0") { personalInfo.Tax_Applicable = false; } else { personalInfo.Tax_Applicable = Convert.ToBoolean(drpTaxApplicable.SelectedValue); } if (drpPFApplicable.SelectedValue == "0") { personalInfo.PF_Applicable = false; } else { personalInfo.PF_Applicable = Convert.ToBoolean(drpPFApplicable.SelectedValue); } personalInfo.JoiningDate = Convert.ToDateTime(txtbxJoingDate.Text); personalInfo.ProbationPeriodFrom = Convert.ToDateTime(txtbxProbationProbationPeriodFrom.Text); personalInfo.ProbationPeriodTo = Convert.ToDateTime(txtbxProbationPeriodTo.Text); personalInfo.ConfiramtionDate = Convert.ToDateTime(txtbxConformationDate.Text); personalInfo.JobResponsibility = txtbxJobResponsibility.Text; if (EmployeeId != null) { int result = employeeSetUpBll.UpdateemployemetPart(EmployeeId, personalInfo); if (result == 1) { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "text", "func('Data Update successfully!')", true); // lblModalMessage.Text = "Data Update Successfully."; GetEmployemntInfo(EmployeeId); } } } } catch (Exception) { throw; } }
internal HRM_DESIGNATIONS GetDesignationIdByDesNameGradAndGoss(string desName, string grade, decimal?Gosssalary) { HRM_DESIGNATIONS _desgination = _context.HRM_DESIGNATIONS.FirstOrDefault(x => x.DEG_NAME == desName && x.GRADE == grade && x.GROSS_SAL == Gosssalary); return(_desgination); }
//-------Update------------------------------------ public int UpdateDesignation(HRM_DESIGNATIONS objDeg, int designationID) { return(objCtx_DAL.UpdateDesignation(objDeg, designationID)); }
//-------Insert------------------------------------ public int InsertDeignation(HRM_DESIGNATIONS objDeg) { return(objCtx_DAL.InsertDeignation(objDeg)); }
protected void btnTrStaffSubmit_Click(object sender, EventArgs e) { try { HRM_EMP_TRANSFER objTrns = new HRM_EMP_TRANSFER(); string employeeID = Convert.ToString(txtEid_TRNS.Text); string desName = drpdwnDesigantion.SelectedItem.ToString(); string grade = txtbxGarde.Text; decimal? Gosssalary = Convert.ToDecimal(txtbxGrossSalary.Text); bool Status = CheckDesignation(desName, grade, Gosssalary); if (Status == false) { InsertDesgination(desName, grade, Gosssalary); } decimal PreviousGrossSalary = 0; HRM_DESIGNATIONS _Desobj = objDeg_BLL.GetDesignationIdByDesNameGradAndGoss(desName, grade, Gosssalary); if (_Desobj != null) { int regID_TO = Convert.ToInt32(ddlRegion_TR.SelectedValue); int ofcID_TO = Convert.ToInt32(ddlOffice_TR.SelectedValue); int deptID_TO = Convert.ToInt32(ddlDepartment_TR.SelectedValue); int sectionID_TO = Convert.ToInt32(ddlSection_TR.SelectedValue); int subSecID_TO = Convert.ToInt32(ddlSubSec_TR.SelectedValue); //-------------------From------------------------------- objTrns.Regions_ID_FROM = Convert.ToInt32(lblRegion_TRNS.Text); objTrns.Office_ID_FROM = Convert.ToInt32(lblOffice_TRNS.Text); objTrns.DPT_ID_FROM = Convert.ToInt32(lblDepartment_TRNS.Text); objTrns.SEC_ID_FROM = Convert.ToInt32(lblSection_TRNS.Text); objTrns.SUB_SEC_ID_FROM = Convert.ToInt32(lblSubSection_TRNS.Text); objTrns.DEG_ID_FROM = Convert.ToInt32(lblDesignation_TRNS.Text); objTrns.GrossSalaryFrom = Convert.ToDecimal(lblStepGrossSalary.Text); objTrns.GradeFrom = lblGrade_TRNS.Text; PreviousGrossSalary = Convert.ToDecimal(objTrns.GrossSalaryFrom); //-------------------to------------------------------- objTrns.Regions_ID_TO = regID_TO; objTrns.Office_ID_TO = ofcID_TO; objTrns.DPT_ID_TO = deptID_TO; objTrns.SEC_ID_TO = sectionID_TO; objTrns.SUB_SEC_ID_TO = subSecID_TO; objTrns.DEG_ID_TO = _Desobj.DEG_ID; objTrns.GradeTo = _Desobj.GRADE; objTrns.GorssSalaryTo = _Desobj.GROSS_SAL; objTrns.Status = hidTransferStatus.Value.ToString(); objTrns.EID = employeeID; objTrns.TRANSFER_DATE = DateTime.Now.Date; objTrns.EDIT_USER = ((SessionUser)Session["SessionUser"]).UserId; objTrns.EDIT_DATE = DateTime.Now; objTrns.OCODE = ((SessionUser)Session["SessionUser"]).OCode; } int result = objAdm_BLL.SaveEmployee_Transfer(objTrns, employeeID, PreviousGrossSalary); if (result == 1) { BindGridEmployeeTransfer(); ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Save Successfully')", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }
protected void txtUpdate_Click(object sender, EventArgs e) { try { DESIGNATION_BLL objDeg_BLL = new DESIGNATION_BLL(); Increment_BLL objIncrementBll = new Increment_BLL(); int DesginationId = Convert.ToInt16(DropDownList1.SelectedValue); string Grad = txtGrade.Text.Trim(); decimal Gosssalary = Convert.ToDecimal(txtGrossSalary.Text.Trim()); string DesginationName = DropDownList1.SelectedItem.ToString(); bool Status = CheckDesignation(DesginationName, Grad, Gosssalary); if (Status == false) { HRM_DESIGNATIONS designationObj = new HRM_DESIGNATIONS(); designationObj.DEG_NAME = DropDownList1.SelectedItem.ToString(); designationObj.GRADE = txtGrade.Text; designationObj.GROSS_SAL = Gosssalary; designationObj.HOUSE_RENT = Convert.ToDecimal(txtHouseRent.Text); designationObj.BASIC = Convert.ToDecimal(txtBasic.Text); designationObj.MEDICAL = Convert.ToDecimal(txtMedical.Text); designationObj.FOOD_ALLOW = Convert.ToDecimal(txtbxFoodAllowance.Text); designationObj.CONVEYANCE = Convert.ToDecimal(txtConveynce.Text); designationObj.EDIT_USER = ((SessionUser)Session["SessionUser"]).UserId; designationObj.EDIT_DATE = DateTime.Now; designationObj.OCODE = ((SessionUser)Session["SessionUser"]).OCode; int result = objDeg_BLL.InsertDeignation(designationObj); } HRM_DESIGNATIONS _Desobj = objDeg_BLL.GetDesignationId(DesginationName, Grad, Gosssalary); if (_Desobj != null) { int desId = _Desobj.DEG_ID; string eid = txtEid_LV.Text; int result = objDeg_BLL.UpdatePersonalInfoForSalaryUpdate(eid, desId, Gosssalary); if (result == 1) { HRM_SalaryUpdate objEmp = new HRM_SalaryUpdate(); objEmp.EID = eid; objEmp.CurrendSalary = Gosssalary; objEmp.DegID = DesginationId; objEmp.Grade = Grad; objEmp.EDIT_DATE = DateTime.Now; objEmp.Previoussalary = Convert.ToDecimal(txtCurrent_Salary.Text); objEmp.EDIT_DATE = DateTime.Now; objEmp.OCODE = ((SessionUser)Session["SessionUser"]).OCode; int resultstatus = objIncrementBll.SalaryUpdate(objEmp); if (resultstatus == 1) { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "text", "func('Salary Update successfully!')", true); } } } UIClear(); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }
// FoodAllowance is Fixed Allowance // Other is Alltendance Bouns protected void btnSave_Click(object sender, EventArgs e) { try { decimal GROSS_SAL = Convert.ToDecimal(txtGrsSal.Text); decimal HOUSE_RENT = Convert.ToDecimal(txtHouseRent.Text); decimal BASIC = Convert.ToDecimal(txtBasic.Text); decimal MEDICAL = Convert.ToDecimal(txtMedical.Text); decimal CONVEYANCE = Convert.ToDecimal(txtConveyance.Text); decimal FiresdAllowance = Convert.ToDecimal(txtFiexedAllowance.Text); decimal OTHERS = Convert.ToDecimal(txtOthers.Text); decimal HolidayAllowance = Convert.ToDecimal(txtbxHolidayAllowance.Text); decimal TOTAL = (BASIC + HOUSE_RENT + MEDICAL + CONVEYANCE + FiresdAllowance + OTHERS + HolidayAllowance); if (GROSS_SAL == TOTAL) { HRM_DESIGNATIONS designationObj = new HRM_DESIGNATIONS(); designationObj.DEG_NAME = txtbxDesignation.Text; designationObj.GRADE = txtbxGrade.Text; designationObj.GROSS_SAL = Convert.ToDecimal(txtGrsSal.Text); designationObj.HOUSE_RENT = Convert.ToDecimal(txtHouseRent.Text); designationObj.BASIC = Convert.ToDecimal(txtBasic.Text); designationObj.MEDICAL = Convert.ToDecimal(txtMedical.Text); designationObj.CONVEYANCE = Convert.ToDecimal(txtConveyance.Text); designationObj.FixedAllowance = Convert.ToDecimal(txtFiexedAllowance.Text); designationObj.AttendanceBonus = Convert.ToDecimal(txtOthers.Text); designationObj.Holiday_Allowance = Convert.ToDecimal(txtbxHolidayAllowance.Text); designationObj.EDIT_USER = ((SessionUser)Session["SessionUser"]).UserId; designationObj.EDIT_DATE = DateTime.Now; designationObj.OCODE = ((SessionUser)Session["SessionUser"]).OCode; if (btnSave.Text == "Submit") { int result = objDeg_BLL.InsertDeignation(designationObj); if (result == 1) { // lblMessage.Text = "Data Added successfully!"; // lblMessage.ForeColor = System.Drawing.Color.Green; ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Save Successfully')", true); } } else { int desginationId = Convert.ToInt32(hidDesignationId.Value); int result = objDeg_BLL.UpdateDesignation(designationObj, desginationId); if (result == 1) { // lblMessage.Text = "Data Update successfully!"; // lblMessage.ForeColor = System.Drawing.Color.Green; ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Update Successfully')", true); } } getDesignations(); ClearDesignationUi(); } else { // lblMessage.Text = ""; ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Gross Total is not Equal to Misc. Total!')", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }