Ejemplo n.º 1
0
        protected void btnUpdate_click(object sender, EventArgs e)
        {
            HRM_PersonalInformations personalInfo = new HRM_PersonalInformations();
            string            OCODE            = ((SessionUser)Session["SessionUser"]).OCode;
            EmployeeSetup_BLL employeeSetUpBll = new EmployeeSetup_BLL();
            string            Requested_Eid    = txtbxMachineID.Text;

            string employeeId = "";

            try
            {
                bool status = true;

                if (hidMachineId.Value != txtbxMachineID.Text.Trim())
                {
                    GlobalClass.IsEidValid = employeeSetUpBll.CheckBioIDExitance(OCODE, Requested_Eid);
                    if (GlobalClass.IsEidValid > 0)
                    {
                        status = false;
                    }
                }

                if (status)
                {
                    employeeId                 = Convert.ToString(Session["EID"]);
                    personalInfo.FirstName     = txtbxFirstName.Text.Trim();
                    personalInfo.LastName      = txtbxLastName.Text.Trim();
                    personalInfo.Gender        = ddlGender.Text.Trim();
                    personalInfo.DateOfBrith   = Convert.ToDateTime(txtbxdateOfBrith.Text);
                    personalInfo.BloodGroup    = ddlBloodGrp.Text.Trim();
                    personalInfo.MaritalStatus = ddlMariedSts.Text;
                    personalInfo.Religion      = ddlReligion.Text;
                    personalInfo.BIO_MATRIX_ID = txtbxMachineID.Text.Trim();
                    personalInfo.Nationality   = ddlNationality.Text;
                    personalInfo.NationalID    = txtbxNId.Text;
                    int result = empSetupDal.UpdatePersonalInfo(personalInfo, employeeId);
                    if (result == 1)
                    {
                        lblModalMessage.Text = "Data Update Successfully.";

                        GetPersonalInfo(employeeId);
                    }
                    else
                    {
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Machine-ID Conflict!')", true);
                    ModalPopupExtender.Show();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }