示例#1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                var empInfo = new ArrayList();

                EmployeeGeneralInfo empGeneralInfo = ctrlEmployeeGeneralInfo as EmployeeGeneralInfo;
                empGeneralInfo.UpdateEmpGeneralInfo(empInfo);
                CustomList <HRM_Emp> empList = (CustomList <HRM_Emp>)empInfo[0];
                SetOfficialInfo(empList[0]);

                EmployeeAddressInformation empAddrInfo = ctrlEmployeeAddressInfo as EmployeeAddressInformation;
                empAddrInfo.UpdateEmpAddr(empInfo);

                CustomList <JobResponsibility> ResponsibilityList = JobResponsibilityList;
                empInfo.Add(ResponsibilityList);

                EmployeeEducationInformation empEdu = ctrlEmployeeEducationInfo as EmployeeEducationInformation;
                empEdu.SaveEmpEducationInfo(empInfo);

                EmpHistory empHist = ctrlEmpHistory as EmpHistory;
                empHist.Update(empInfo);

                EmpAttachmentInfo empFile = ctrlEmpAttachmentInfo as EmpAttachmentInfo;
                empFile.Update(empInfo);

                EmployeeHKInfoSave(empInfo);

                ucSalaryInfo empSalary = ctrlSalaryInfo as ucSalaryInfo;
                empSalary.Save(empInfo);

                ucLanguage empLanguage = ctrlLanguage as ucLanguage;
                empLanguage.Save(empInfo);

                CustomList <HRM_EmpFamDet> FamilyDetList = EmpFamDetList;
                empInfo.Add(FamilyDetList);

                CustomList <MedicalReinSetup> lstMedicalAllowance = MedicalAllowanceSetList;
                if (lstMedicalAllowance.Count == 0)
                {
                    MedicalReinSetup newSetup = new MedicalReinSetup();
                    lstMedicalAllowance.Add(newSetup);
                }
                SetDataMedicalAllowance(ref lstMedicalAllowance);
                if (lstMedicalAllowance[0].FYKey == 0)
                {
                    lstMedicalAllowance = new CustomList <MedicalReinSetup>();
                }
                empInfo.Add(lstMedicalAllowance);

                _empManager.SaveEmployeeInfo(empInfo, "update");

                this.SuccessMessage = (StaticInfo.UpdatedSuccessfullyMsg);
            }

            catch (Exception ex)
            {
                this.ErrorMessage = ex.Message;
            }
        }
示例#2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                TextBox empCodeTextBox   = (TextBox)ctrlEmpSearch2.FindControl("txtSearch");
                TextBox firstNameTextBox = (TextBox)ctrlEmployeeGeneralInfo.FindControl("txtFirstName");
                string  empCode          = HRM_Emp.GetExistingEmp(firstNameTextBox.Text);
                if (empCode.IsNotNullOrEmpty())
                {
                    this.ErrorMessage = "Employee Name Already Exist!";
                    return;
                }
                var empInfo = new ArrayList();

                EmployeeGeneralInfo empGeneralInfo = ctrlEmployeeGeneralInfo as EmployeeGeneralInfo;
                empGeneralInfo.SaveEmpGeneralInfo(empInfo);
                CustomList <HRM_Emp> empList = (CustomList <HRM_Emp>)empInfo[0];
                SetOfficialInfo(empList[0]);

                EmployeeAddressInformation empAddrInfo = ctrlEmployeeAddressInfo as EmployeeAddressInformation;
                empAddrInfo.SaveEmpAddr(empInfo);

                CustomList <JobResponsibility> ResponsibilityList = JobResponsibilityList;
                empInfo.Add(ResponsibilityList);

                EmployeeEducationInformation empEdu = ctrlEmployeeEducationInfo as EmployeeEducationInformation;
                empEdu.SaveEmpEducationInfo(empInfo);

                EmpHistory empHist = ctrlEmpHistory as EmpHistory;
                empHist.Save(empInfo);

                EmpAttachmentInfo empFile = ctrlEmpAttachmentInfo as EmpAttachmentInfo;
                empFile.Save(empInfo);

                EmployeeHKInfoSave(empInfo);

                ucSalaryInfo empSalary = ctrlSalaryInfo as ucSalaryInfo;
                empSalary.Save(empInfo);

                ucLanguage empLanguage = ctrlLanguage as ucLanguage;
                empLanguage.Save(empInfo);

                CustomList <HRM_EmpFamDet> FamilyDetList = EmpFamDetList;
                empInfo.Add(FamilyDetList);

                //Medical
                CustomList <MedicalReinSetup> lstMedicalAllowanceSetup = new CustomList <MedicalReinSetup>();
                MedicalReinSetup newMedicalAllowance = new MedicalReinSetup();
                lstMedicalAllowanceSetup.Add(newMedicalAllowance);
                SetDataMedicalAllowance(ref lstMedicalAllowanceSetup);
                if (lstMedicalAllowanceSetup[0].FYKey == 0)
                {
                    lstMedicalAllowanceSetup = new CustomList <MedicalReinSetup>();
                }
                empInfo.Add(lstMedicalAllowanceSetup);
                //End

                _empManager.SaveEmployeeInfo(empInfo);
                this.SuccessMessage    = (StaticInfo.SavedSuccessfullyMsg);
                this.btnSave.Visible   = false;
                this.btnUpdate.Visible = true;
            }
            catch (Exception ex)
            {
                this.ErrorMessage = ex.Message;
            }
        }