Пример #1
0
        private ContractorsBasicSalariesViewModel GetByContractorBasicSalaryID(int id)
        {
            ContractorsBasicSalariesBLL       ContractorBasicSalaryBLL = new ContractorsBasicSalariesBLL().GetByContractorBasicSalaryID(id);
            ContractorsBasicSalariesViewModel ContractorBasicSalaryVM  = new ContractorsBasicSalariesViewModel();

            if (ContractorBasicSalaryBLL != null)
            {
                ContractorBasicSalaryVM.ContractorBasicSalaryID = ContractorBasicSalaryBLL.ContractorBasicSalaryID;
                ContractorBasicSalaryVM.EmployeeCodeID          = ContractorBasicSalaryBLL.EmployeeCode.EmployeeCodeID;
                ContractorBasicSalaryVM.BasicSalary             = ContractorBasicSalaryBLL.BasicSalary;
                ContractorBasicSalaryVM.TransfareAllowance      = ContractorBasicSalaryBLL.TransfareAllowance;
                ContractorBasicSalaryVM.EmployeeCode            = ContractorBasicSalaryBLL.EmployeeCode;
                //ContractorBasicSalaryVM.CreatedDate = ContractorBasicSalaryBLL.CreatedDate;
                //ContractorBasicSalaryVM.CreatedBy = ContractorBasicSalaryVM.GetCreatedByDisplayed(ContractorBasicSalaryBLL.CreatedBy);

                ContractorBasicSalaryVM.EmployeeVM = new EmployeesViewModel()
                {
                    EmployeeCodeID = ContractorBasicSalaryBLL.EmployeeCode.EmployeeCodeID,
                    EmployeeCodeNo = ContractorBasicSalaryBLL.EmployeeCode.EmployeeCodeNo,
                    EmployeeNameAr = ContractorBasicSalaryBLL.EmployeeCode.Employee.EmployeeNameAr,
                    EmployeeIDNo   = ContractorBasicSalaryBLL.EmployeeCode.Employee.EmployeeIDNo,
                };
            }
            return(ContractorBasicSalaryVM);
        }
Пример #2
0
        public ActionResult EditContractorsBasicSalaries(ContractorsBasicSalariesViewModel ContractorBasicSalaryVM)
        {
            ContractorsBasicSalariesBLL ContractorBasicSalaryBLL = new ContractorsBasicSalariesBLL();

            ContractorBasicSalaryBLL.ContractorBasicSalaryID = ContractorBasicSalaryVM.ContractorBasicSalaryID;
            ContractorBasicSalaryBLL.EmployeeCode            = new EmployeesCodesBLL()
            {
                EmployeeCodeID = ContractorBasicSalaryVM.EmployeeCodeID
            };
            ContractorBasicSalaryBLL.BasicSalary        = ContractorBasicSalaryVM.BasicSalary;
            ContractorBasicSalaryBLL.TransfareAllowance = ContractorBasicSalaryVM.TransfareAllowance;
            ContractorBasicSalaryBLL.LoginIdentity      = UserIdentity;

            Result result = ContractorBasicSalaryBLL.Update();

            if (result.EnumMember == GovernmentFundsValidationEnum.Done.ToString())
            {
            }
            else if (result.EnumMember == ContractorsBasicSalariesValidationEnum.RejectedBecauseOfEmployeeMustBeContractualEmployee.ToString())
            {
                throw new CustomException(Resources.Globalization.ValidationEmployeeMustBeContractualEmployeeText);
            }

            return(Json(new { ContractorBasicSalaryID = ContractorBasicSalaryBLL.ContractorBasicSalaryID }, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
        public JsonResult GetAllContractorsBasicSalaries()
        {
            var data = new ContractorsBasicSalariesBLL().GetContractorsBasicSalaries().Select(x => new
            {
                ContractorBasicSalaryID = x.ContractorBasicSalaryID,
                EmployeeCodeNo          = x.EmployeeCode.EmployeeCodeNo,
                EmployeeNameAr          = x.EmployeeCode.Employee.EmployeeNameAr,
                BasicSalary             = x.BasicSalary,
                TransfareAllowance      = x.TransfareAllowance
            });

            return(Json(new { data = data }, JsonRequestBehavior.AllowGet));
        }
Пример #4
0
 public ActionResult DeleteContractorsBasicSalaries(ContractorsBasicSalariesViewModel ContractorBasicSalaryVM)
 {
     try
     {
         ContractorsBasicSalariesBLL ContractorBasicSalaryBLL = new ContractorsBasicSalariesBLL();
         ContractorBasicSalaryBLL.LoginIdentity = UserIdentity;
         ContractorBasicSalaryBLL.Remove(ContractorBasicSalaryVM.ContractorBasicSalaryID);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Пример #5
0
        public JsonResult GetContractorsBasicSalaries()
        {
            ContractorsBasicSalariesBLL ContractorsBasicSalariesBLL = new ContractorsBasicSalariesBLL()
            {
                Search   = Search,
                Order    = Order,
                OrderDir = OrderDir,
                StartRec = StartRec,
                PageSize = PageSize
            };
            var data = ContractorsBasicSalariesBLL.GetContractorsBasicSalaries(out TotalRecordsOut, out RecFilterOut).Select(x => new
            {
                ContractorBasicSalaryID = x.ContractorBasicSalaryID,
                EmployeeCodeNo          = x.EmployeeCode.EmployeeCodeNo,
                EmployeeNameAr          = x.EmployeeCode.Employee.EmployeeNameAr,
                RankCategoryName        = x.EmployeeCode.EmployeeCurrentJob.OrganizationJob.Rank.RankCategory.RankCategoryName,
                BasicSalary             = x.BasicSalary,
                TransfareAllowance      = x.TransfareAllowance,
            });

            return(Json(new { draw = Convert.ToInt32(Draw), recordsTotal = TotalRecordsOut, recordsFiltered = RecFilterOut, data = data }, JsonRequestBehavior.AllowGet));
        }
Пример #6
0
        public ActionResult HiringNewEmployeePost(HiringNewEmployeesViewModel HiringNewEmployeesViewModel)
        {
            EmployeesBLL _employeeBll = new EmployeesBLL()
            {
                EmployeeIDNo              = HiringNewEmployeesViewModel.EmployeeIDNo,
                FirstNameAr               = HiringNewEmployeesViewModel.FirstNameAr,
                MiddleNameAr              = HiringNewEmployeesViewModel.MiddleNameAr,
                GrandFatherNameAr         = HiringNewEmployeesViewModel.GrandFatherNameAr,
                FifthNameAr               = HiringNewEmployeesViewModel.FifthNameAr,
                LastNameAr                = HiringNewEmployeesViewModel.LastNameAr,
                FirstNameEn               = HiringNewEmployeesViewModel.FirstNameEn,
                MiddleNameEn              = HiringNewEmployeesViewModel.MiddleNameEn,
                GrandFatherNameEn         = HiringNewEmployeesViewModel.GrandFatherNameEn,
                FifthNameEn               = HiringNewEmployeesViewModel.FifthNameEn,
                LastNameEn                = HiringNewEmployeesViewModel.LastNameEn,
                EmployeeBirthDate         = HiringNewEmployeesViewModel.EmployeeBirthDate,
                EmployeeBirthPlace        = HiringNewEmployeesViewModel.EmployeeBirthPlace,
                EmployeeMobileNo          = HiringNewEmployeesViewModel.EmployeeMobileNo,
                EmployeePassportNo        = HiringNewEmployeesViewModel.EmployeePassportNo,
                EmployeeEMail             = HiringNewEmployeesViewModel.EmployeeEMail,
                EmployeeIDIssueDate       = HiringNewEmployeesViewModel.EmployeeIDIssueDate,
                EmployeePassportSource    = HiringNewEmployeesViewModel.EmployeePassportSource,
                EmployeePassportIssueDate = HiringNewEmployeesViewModel.EmployeePassportIssueDate,
                EmployeePassportEndDate   = HiringNewEmployeesViewModel.EmployeePassportEndDate,
                EmployeeIDExpiryDate      = HiringNewEmployeesViewModel.EmployeeIDExpiryDate,
                EmployeeIDCopyNo          = HiringNewEmployeesViewModel.EmployeeIDCopyNo,
                EmployeeIDIssuePlace      = HiringNewEmployeesViewModel.EmployeeIDIssuePlace,
                DependentCount            = HiringNewEmployeesViewModel.DependentCount,
                MaritalStatus             = new MaritalStatusBLL()
                {
                    MaritalStatusID = HiringNewEmployeesViewModel.MaritalStatus.MaritalStatusID
                },
                Gender = new GendersBLL()
                {
                    GenderID = HiringNewEmployeesViewModel.Gender.GenderID
                },
                Nationality = new CountriesBLL {
                    CountryID = HiringNewEmployeesViewModel.CountryID
                },
                LoginIdentity = UserIdentity
            };
            EmployeesCodesBLL _employeesCode = new EmployeesCodesBLL();

            _employeesCode.EmployeeCodeNo = HiringNewEmployeesViewModel.EmployeeCodeNo;
            _employeesCode.Employee       = new EmployeesBLL()
            {
                EmployeeID = HiringNewEmployeesViewModel.EmployeeID
            };
            _employeesCode.EmployeeType = new EmployeesTypesBLL()
            {
                EmployeeTypeID = 1
            };
            _employeesCode.LoginIdentity = this.UserIdentity;
            EmployeesCareersHistoryBLL _employeesCareersHistory = new EmployeesCareersHistoryBLL()
            {
                JoinDate        = HiringNewEmployeesViewModel.JoinDate,
                OrganizationJob = new OrganizationsJobsBLL()
                {
                    OrganizationJobID = HiringNewEmployeesViewModel.OrganizationJobID
                },
                CareerDegree = new CareersDegreesBLL()
                {
                    CareerDegreeID = HiringNewEmployeesViewModel.CareerDegreeID
                },
                CareerHistoryType = new CareersHistoryTypesBLL()
                {
                    CareerHistoryTypeID = HiringNewEmployeesViewModel.CareerHistoryTypeID
                },
            };
            EmployeesQualificationsBLL _employeeQualification = new EmployeesQualificationsBLL();

            _employeeQualification.QualificationDegree = new QualificationsDegreesBLL()
            {
                QualificationDegreeID = HiringNewEmployeesViewModel.QualificationDegreeID
            };
            _employeeQualification.Qualification = new QualificationsBLL()
            {
                QualificationID = HiringNewEmployeesViewModel.QualificationID
            };
            _employeeQualification.GeneralSpecialization = new GeneralSpecializationsBLL()
            {
                GeneralSpecializationID = HiringNewEmployeesViewModel.GeneralSpecializationID
            };
            _employeeQualification.ExactSpecialization = new ExactSpecializationsBLL()
            {
                ExactSpecializationID = HiringNewEmployeesViewModel.ExactSpecializationID.HasValue ? (int)HiringNewEmployeesViewModel.ExactSpecializationID : 0
            };
            _employeeQualification.UniSchName        = HiringNewEmployeesViewModel.UniSchName;
            _employeeQualification.Department        = HiringNewEmployeesViewModel.Department;
            _employeeQualification.FullGPA           = HiringNewEmployeesViewModel.FullGPA;
            _employeeQualification.GPA               = HiringNewEmployeesViewModel.GPA;
            _employeeQualification.StudyPlace        = HiringNewEmployeesViewModel.StudyPlace;
            _employeeQualification.GraduationDate    = HiringNewEmployeesViewModel.GraduationDate;
            _employeeQualification.GraduationYear    = HiringNewEmployeesViewModel.GraduationYear;
            _employeeQualification.QualificationType = new QualificationsTypesBLL()
            {
                QualificationTypeID = HiringNewEmployeesViewModel.QualificationTypeID
            };
            _employeeQualification.LoginIdentity = UserIdentity;
            ContractorsBasicSalariesBLL _contractorBasicSalaryBLL = new ContractorsBasicSalariesBLL();

            _contractorBasicSalaryBLL.BasicSalary        = HiringNewEmployeesViewModel.BasicSalary;
            _contractorBasicSalaryBLL.TransfareAllowance = HiringNewEmployeesViewModel.TransfareAllowance;
            _contractorBasicSalaryBLL.LoginIdentity      = UserIdentity;
            List <EmployeesAllowancesBLL> _employeesAllowancesBLL = new List <EmployeesAllowancesBLL>();

            foreach (var item in HiringNewEmployeesViewModel.Allowances)
            {
                if (item.IsSelected)
                {
                    _employeesAllowancesBLL.Add(new EmployeesAllowancesBLL()
                    {
                        EmployeeCareerHistory = _employeesCareersHistory, Allowance = item, AllowanceStartDate = DateTime.Now, IsActive = true, LoginIdentity = UserIdentity
                    });
                }
            }
            _employeeBll.AddHiringNewEmployee(_employeeBll, _employeesCode, _employeesCareersHistory, _employeeQualification, _contractorBasicSalaryBLL, _employeesAllowancesBLL);
            //return View("Employees/Index");

            return(Json(new { ID = 0 }, JsonRequestBehavior.AllowGet));
        }