protected void btnSaveStatment_Click(object sender, EventArgs e) { try { HRM_EmployeeStatement employeeStatementobj = new HRM_EmployeeStatement(); employeeStatementobj.EID = Convert.ToString(Session["EID"]); employeeStatementobj.NameOfRelative = txtbxNameOfRelative.Text; employeeStatementobj.RelativeEID = txtbxEidNumber.Text; employeeStatementobj.Relation = txtbxRelation.Text; employeeStatementobj.EDIT_DATE = DateTime.Now; employeeStatementobj.EDIT_USER = ((SessionUser)Session["SessionUser"]).UserId; employeeStatementobj.OCODE = ((SessionUser)Session["SessionUser"]).OCode; int result = employeeSetupDal.SaveEmployeeSatement(employeeStatementobj); if (result == 1) { //lblMgStament.Text = "Data Save Successfully."; ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Save successfully!')", true); } } catch (Exception ex) { throw ex; } ClearStatmentInformationField(); }
protected void statemenUpdate_Click(object sender, EventArgs e) { try { string empid = ""; string eid = Convert.ToString(Session["EID"]); string OCODE = ((SessionUser)Session["SessionUser"]).OCode; List <HRM_EmployeeStatement> employeeStatments = employeeSetupDal.GetStatementList(eid, OCODE); if (employeeStatments.Count > 0) { foreach (HRM_EmployeeStatement aitem in employeeStatments) { empid = aitem.EID; } } HRM_EmployeeStatement employeeStatementobj = new HRM_EmployeeStatement(); employeeStatementobj.EID = Convert.ToString(Session["EID"]); employeeStatementobj.NameOfRelative = txtbxNameOfRelative.Text; employeeStatementobj.RelativeEID = txtbxEId.Text; employeeStatementobj.Relation = txtbxRelation.Text; employeeStatementobj.EDIT_DATE = DateTime.Now; employeeStatementobj.EDIT_USER = ((SessionUser)Session["SessionUser"]).UserId; employeeStatementobj.OCODE = ((SessionUser)Session["SessionUser"]).OCode; if (empid != "") { int result = employeeSetupDal.UpdateEmployeeSatement(employeeStatementobj, eid); if (result == 1) { ClearStatement(); lblStatementMessage.Text = "Data Update Successfully."; getStatementInfo(); } } else { int result = employeeSetupDal.SaveEmployeeSatement(employeeStatementobj); if (result == 1) { ClearStatement(); lblStatementMessage.Text = "Data Save Successfully."; getStatementInfo(); } } } catch (Exception) { throw; } }