Beispiel #1
0
        public JsonResult SaveEmployeeBasicNEmploymentInfo(EmployeeDetails objEmployeeDetails)
        {
            try
            {
                objLoginHelper = (LoginHelper)Session["LogInInformation"];

                Hrm_EmployeeInfo objEmployeeInfo = new Hrm_EmployeeInfo();
                objEmployeeInfo = hrmsData.ProcessEmployeeBasicNEmploymentInfo(objEmployeeDetails);

                Hrm_EmployeeWiseBankAccount objEmployeeWiseBankAccount = new Hrm_EmployeeWiseBankAccount();
                objEmployeeWiseBankAccount = hrmsData.ProcessEmployeeWiseBankAccount(objEmployeeDetails);

                Hrm_EmployeeWiseSalaryStructureMaster         objEmployeeSalaryStructureMaster = new Hrm_EmployeeWiseSalaryStructureMaster();
                List <Hrm_EmployeeWiseSalaryStructureDetails> lstEmloyeeSalaryStructureDetails = new List <Hrm_EmployeeWiseSalaryStructureDetails>();

                if (!hrmsData.EmployeeExistOrNot(objEmployeeDetails.EmployeeID))
                {
                    if (!Helper.EmployeeIdValidation(objEmployeeDetails.EmployeeID))
                    {
                        return(new JsonResult {
                            Data = ExceptionHelper.ExceptionCustomErrorMessage("Employee Id Is Not Valid")
                        });
                    }

                    objEmployeeSalaryStructureMaster = hrmsData.ProcessEmployeeWiseSalaryStructureMaster(objEmployeeInfo.EmployeeID, objEmployeeInfo.LastDesignation, objEmployeeInfo.LastEmploymentType, objEmployeeInfo.JoiningDate);
                    lstEmloyeeSalaryStructureDetails = hrmsData.ProcessEmployeeWiseSalaryStructureDetails(objEmployeeInfo.EmployeeID, objEmployeeSalaryStructureMaster.SalaryStructureSeqNo, objEmployeeInfo.LastDesignation, objEmployeeInfo.LastEmploymentType);

                    objEmployeeInfo.CreatedBy = objLoginHelper.LogInID;
                    objEmployeeInfo.CreatedOn = DateTime.Now;

                    hrmsData.CreateEmployeeBasicNEmploymentInfo(objEmployeeInfo, objEmployeeSalaryStructureMaster, lstEmloyeeSalaryStructureDetails, objEmployeeWiseBankAccount);
                }
                else
                {
                    objEmployeeInfo.ModifiedBy = objLoginHelper.LogInID;
                    objEmployeeInfo.ModifiedOn = DateTime.Now;

                    //objEmployeeSalaryStructureMaster = hrmsData.ProcessEmployeeWiseSalaryStructureMasterUpdate(objEmployeeInfo.EmployeeID, objEmployeeInfo.LastDesignation, objEmployeeInfo.LastEmploymentType, objEmployeeInfo.JoiningDate);
                    //lstEmloyeeSalaryStructureDetails = hrmsData.ProcessEmployeeWiseSalaryStructureDetails(objEmployeeInfo.EmployeeID, objEmployeeSalaryStructureMaster.SalaryStructureSeqNo, objEmployeeInfo.LastDesignation, objEmployeeInfo.LastEmploymentType);

                    hrmsData.UpdateEmployeeBasicNEmploymentInfo(objEmployeeInfo, objEmployeeSalaryStructureMaster, lstEmloyeeSalaryStructureDetails, objEmployeeWiseBankAccount);
                }

                return(new JsonResult {
                    Data = ExceptionHelper.ExceptionMessage(string.Empty)
                });
            }
            catch (Exception ex)
            {
                return(new JsonResult {
                    Data = ExceptionHelper.ExceptionMessage(ex)
                });
            }
        }
Beispiel #2
0
        public Hrm_EmployeeWiseSalaryStructureMaster ProcessEmployeeWiseSalaryStructureMasterUpdate(string employeeId, string lastDesignation, string lastEmploymentType, DateTime joiningDate)
        {
            try
            {
                Hrm_EmployeeWiseSalaryStructureMaster objEmployeeSalaryStructureMaster = new Hrm_EmployeeWiseSalaryStructureMaster();
                byte salaryStructureSeqNo = this.EmployeeWiseSalaryStructureSeqenceNumberMax(employeeId);

                objEmployeeSalaryStructureMaster.EmployeeID           = employeeId;
                objEmployeeSalaryStructureMaster.SalaryStructureSeqNo = salaryStructureSeqNo;
                objEmployeeSalaryStructureMaster.HDesignationID       = lastDesignation;
                objEmployeeSalaryStructureMaster.EmploymentTypeID     = lastEmploymentType;
                objEmployeeSalaryStructureMaster.SSEffectiveFromDate  = joiningDate.Date;
                objEmployeeSalaryStructureMaster.SSEffectiveToDate    = new DateTime(2021, 12, 31);

                return(objEmployeeSalaryStructureMaster);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Beispiel #3
0
 public void UpdateEmployeeBasicNEmploymentInfo(Hrm_EmployeeInfo objEmployeeInfo, Hrm_EmployeeWiseSalaryStructureMaster objEmployeeSalaryStructureMaster, List <Hrm_EmployeeWiseSalaryStructureDetails> lstEmloyeeSalaryStructureDetails, Hrm_EmployeeWiseBankAccount objEmployeeWiseBankAccount)
 {
     HRMSService.UpdateEmployeeBasicNEmploymentInfo(objEmployeeInfo, objEmployeeSalaryStructureMaster, lstEmloyeeSalaryStructureDetails, objEmployeeWiseBankAccount);
 }