Ejemplo n.º 1
0
        public ActionResult GetLenders(int EmployeeCarrerHistoryID, int PromotionPeriodID)
        {
            EmployeesCareersHistoryBLL emp = new EmployeesCareersHistoryBLL().GetByEmployeeCareerHistoryID(EmployeeCarrerHistoryID);
            PromotionsPeriodsBLL       PromotionPeriodBLL = new PromotionsPeriodsBLL().GetByPromotionPeriodID(PromotionPeriodID);

            return(Json(new { data = new LendersBLL().GetByEmployeeCodeID(emp.EmployeeCode.EmployeeCodeID, emp.JoinDate.Date, PromotionPeriodBLL.PromotionEndDate) }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public ActionResult GetAbsence(int EmployeeCarrerHistoryID, int PromotionPeriodID)
        {
            EmployeesCareersHistoryBLL emp = new EmployeesCareersHistoryBLL().GetByEmployeeCareerHistoryID(EmployeeCarrerHistoryID);
            PromotionsPeriodsBLL       PromotionPeriodBLL          = new PromotionsPeriodsBLL().GetByPromotionPeriodID(PromotionPeriodID);
            List <TimeAttendanceBLL>   EmployeesEvaluationsBLLList = new EmployeesCodesBLL().GetAbsenceByEmployeeCodeID(emp.EmployeeCode.EmployeeCodeID, emp.JoinDate.Date, PromotionPeriodBLL.PromotionEndDate);
            var data = EmployeesEvaluationsBLLList.Select(x => new
            {
                AbsenceDate = x.Date,
            });

            return(Json(new { data = data }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 3
0
        public JsonResult UpdateCareerDegree(int EmployeeCareerHistoryID, int CareerDegreeID)
        {
            EmployeesCareersHistoryBLL EmployeesCareersHistory = new EmployeesCareersHistoryBLL();

            EmployeesCareersHistory.EmployeeCareerHistoryID = EmployeeCareerHistoryID;
            EmployeesCareersHistory.CareerDegree            = new CareersDegreesBLL()
            {
                CareerDegreeID = CareerDegreeID
            };
            EmployeesCareersHistory.LoginIdentity = this.UserIdentity;

            Result result = EmployeesCareersHistory.UpdateCareerDegree();

            return(Json(new { data = EmployeeCareerHistoryID }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 4
0
        public ActionResult GetExceptionalVacations(int EmployeeCarrerHistoryID, int PromotionPeriodID)
        {
            EmployeesCareersHistoryBLL emp = new EmployeesCareersHistoryBLL().GetByEmployeeCareerHistoryID(EmployeeCarrerHistoryID);
            PromotionsPeriodsBLL       PromotionPeriodBLL = new PromotionsPeriodsBLL().GetByPromotionPeriodID(PromotionPeriodID);
            var data = new ExceptionalVacationsBLL().GetExceptionalVacationsByEmployeeCodeID(emp.EmployeeCode.EmployeeCodeID, emp.JoinDate.Date, PromotionPeriodBLL.PromotionEndDate).Select(x => new
            {
                VacationID        = x.VacationID,
                VacationStartDate = x.VacationStartDate,
                VacationEndDate   = x.VacationEndDate,
                VacationPeriod    = x.VacationPeriod,
            });

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

            //return Json(new { data = new EmployeesCodesBLL().GetVacationsWithDetailsByEmployeeCodeID(id) }, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 5
0
        public JsonResult DeleteEmployeeCareerHistoryByEmployeeCareerHistoryID(int EmployeeCareerHistoryID, int EmployeeCodeID)
        {
            EmployeesCareersHistoryBLL EmployeesCareersHistory = new EmployeesCareersHistoryBLL();

            EmployeesCareersHistory.LoginIdentity = this.UserIdentity;
            EmployeesCareersHistory.EmployeeCode  = new EmployeesCodesBLL()
            {
                EmployeeCodeID = EmployeeCodeID
            };
            Result result = EmployeesCareersHistory.Remove(EmployeeCareerHistoryID);

            return(Json(new
            {
                data = EmployeesCareersHistory
            }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 6
0
        public ActionResult GetStopWorks(int EmployeeCarrerHistoryID, int PromotionPeriodID)
        {
            EmployeesCareersHistoryBLL emp = new EmployeesCareersHistoryBLL().GetByEmployeeCareerHistoryID(EmployeeCarrerHistoryID);
            PromotionsPeriodsBLL       PromotionPeriodBLL = new PromotionsPeriodsBLL().GetByPromotionPeriodID(PromotionPeriodID);
            var data = new StopWorksBLL().GetByEmployeeCodeIDConvicted(emp.EmployeeCode.EmployeeCodeID, emp.JoinDate.Date, PromotionPeriodBLL.PromotionEndDate).Select(x => new
            {
                StopWorkID        = x.StopWorkID,
                StopWorkStartDate = x.StopWorkStartDate,
                StopWorkPeriod    = x.StopWorkPeriod,
                StopWorkEndDate   = x.StopWorkEndDate,
                IsConvicted       = x.IsConvicted
            });

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

            //return Json(new { data = new EmployeesCodesBLL().GetVacationsWithDetailsByEmployeeCodeID(id) }, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 7
0
        public ActionResult GetScholarships(int EmployeeCarrerHistoryID, int PromotionPeriodID)
        {
            EmployeesCareersHistoryBLL emp = new EmployeesCareersHistoryBLL().GetByEmployeeCareerHistoryID(EmployeeCarrerHistoryID);
            PromotionsPeriodsBLL       PromotionPeriodBLL = new PromotionsPeriodsBLL().GetByPromotionPeriodID(PromotionPeriodID);
            var data = new BaseScholarshipsBLL().GetByEmployeeCodeIDNotPassed(emp.EmployeeCode.EmployeeCodeID, emp.JoinDate.Date, PromotionPeriodBLL.PromotionEndDate).Select(x => new
            {
                ScholarshipID        = x.ScholarshipID,
                ScholarshipStartDate = x.ScholarshipStartDate,
                ScholarshipPeriod    = x.ScholarshipPeriod,
                ScholarshipEndDate   = x.ScholarshipEndDate,
                IsPassed             = x.IsPassed
            });

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

            //return Json(new { data = new EmployeesCodesBLL().GetVacationsWithDetailsByEmployeeCodeID(id) }, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 8
0
        public JsonResult GetEmployeesOfOrganizationJob(int OrganizationJobID)
        {
            List <EmployeesCareersHistoryBLL> EmployeesCareersHistoryBLLList = new EmployeesCareersHistoryBLL().GetEmployeesByOrganizationJobID(OrganizationJobID);

            var data = EmployeesCareersHistoryBLLList.Select(x => new
            {
                EmployeeCodeNo        = x.EmployeeCode.EmployeeCodeNo,
                EmployeeNameAr        = x.EmployeeCode.Employee.EmployeeNameAr,
                CareerDegreeName      = x.CareerDegree.CareerDegreeName,
                JoinDate              = x.JoinDate,
                JobName               = x.OrganizationJob.Job.JobName,
                RankName              = x.OrganizationJob.Rank.RankName,
                JobNo                 = x.OrganizationJob.JobNo,
                OrganizationName      = x.OrganizationJob.OrganizationStructure.OrganizationName,
                IsActive              = x.IsActive,
                CareerHistoryTypeName = x.CareerHistoryType.CareerHistoryTypeName
            });

            return(Json(new { data = data }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 9
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));
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Task 221    :   Break last assigning when new Career history record created.
        /// Dated       :   08-12-2020
        /// </summary>
        /// <param name="CareerHistoryVM"></param>
        /// <returns></returns>
        public HttpResponseMessage Save(CareerHistoryViewModel CareerHistoryVM)
        {
            if (CareerHistoryVM.EmployeeCodeID == 0)
            {
                throw new CustomException(Resources.Globalization.RequiredEmployeeText);
            }
            else
            {
                //EmployeesCareersHistoryBLL LastActiveCareerHistory = new EmployeesCareersHistoryBLL().GetEmployeeCurrentJob(CareerHistoryVM.EmployeeCodeID);

                EmployeesCareersHistoryBLL Obj = new EmployeesCareersHistoryBLL()
                {
                    EmployeeCode = new EmployeesCodesBLL()
                    {
                        EmployeeCodeID = CareerHistoryVM.EmployeeCodeID
                    },
                    EmployeeCareerHistoryID = CareerHistoryVM.EmployeeCareerHistoryID,
                    JoinDate        = (DateTime)CareerHistoryVM.JoinDate,
                    OrganizationJob = new OrganizationsJobsBLL()
                    {
                        OrganizationJobID = CareerHistoryVM.OrganizationJobID
                    },
                    CareerDegree = new CareersDegreesBLL()
                    {
                        CareerDegreeID = CareerHistoryVM.CareerDegreeID
                    },
                    CareerHistoryType = new CareersHistoryTypesBLL()
                    {
                        CareerHistoryTypeID = CareerHistoryVM.CareerHistoryTypeID
                    },
                };
                Result result = null;
                if (CareerHistoryVM.EmployeeCareerHistoryID != 0)
                {
                    Obj.LoginIdentity = UserIdentity;
                    result            = Obj.Update();
                }
                else
                {
                    Obj.LoginIdentity = UserIdentity;
                    result            = Obj.Add();
                }

                if ((System.Type)result.EnumType == typeof(CareersHistoryValidationEnum))
                {
                    if (result.EnumMember == CareersHistoryValidationEnum.RejectedBecauseOfAlreadyHiringBefore.ToString())
                    {
                        throw new CustomException(Resources.Globalization.ValidationHiringAlreadyExistText);
                    }
                    else if (result.EnumMember == CareersHistoryValidationEnum.RejectedHiringDateUpdatingBecauseOfAlreadyActionsBefore.ToString())
                    {
                        throw new CustomException(Resources.Globalization.ValidationHiringJoinDateUpdatingText);
                    }
                    else if (result.EnumMember == CareersHistoryValidationEnum.RejectedBecauseOfExistsInPromotionsRecordsEmployees.ToString())
                    {
                        throw new CustomException(Resources.Globalization.RecordRalatedWithOtherDataCanNotUpdateText);
                    }
                    else if (result.EnumMember == CareersHistoryValidationEnum.RejectedBecauseOfJoinDateMustBeLessThanHiringRecordJoinDate.ToString())
                    {
                        throw new CustomException(Resources.Globalization.ValidationJoinDateMustBeLessThanHiringRecordJoinDateText);
                    }
                }

                return(new HttpResponseMessage(HttpStatusCode.OK));
            }
        }