Beispiel #1
0
        public virtual List <PlacementBLL> GetEmployeesInPlaced()
        {
            try
            {
                List <PlacementBLL>            EmployeesInPlacedBLLList = new List <PlacementBLL>();
                List <EmployeesCareersHistory> Employees = new EmployeesCareersHistoryDAL().GetActiveEmployeesCareersHistory();
                List <Assignings> Assignings             = new AssigningsDAL().GetAssignings();
                List <OrganizationsStructures> OrganizationsStructures = new OrganizationsStructuresDAL().GetOrganizationStructure();
                int[] EmployeeCareerHistoryIDs = Assignings.Select(c => (int)c.EmployeeCareerHistoryID).ToArray();
                int[] ManagerCodeIDs           = OrganizationsStructures.Where(p => p.ManagerCodeID.HasValue == true).Select(c => c.ManagerCodeID.Value).ToArray(); //.Select(c => (int)c.ManagerCodeID).ToArray();
                Employees.RemoveAll(x => EmployeeCareerHistoryIDs.Contains(x.EmployeeCareerHistoryID));
                Employees.RemoveAll(o => ManagerCodeIDs.Contains(o.EmployeeCodeID));

                foreach (var item in Employees)
                {
                    EmployeesInPlacedBLLList.Add(new PlacementBLL()
                    {
                        EmployeeCareerHistory = new EmployeesCareersHistoryBLL().MapEmployeeCareerHistory(item)
                    });
                    //new OrganizationsStructuresBLL().GetOrganizationNameTillLastParentExceptPresident(((InternalAssigningBLL)AssigningBLL).Organization.OrganizationID);
                    EmployeesInPlacedBLLList.ForEach(x => x.EmployeeCareerHistory.OrganizationJob.OrganizationStructure.FullOrganizationName = new OrganizationsStructuresBLL().GetOrganizationNameTillLastParentExceptPresident(x.EmployeeCareerHistory.OrganizationJob.OrganizationStructure.OrganizationID));
                }
                return(EmployeesInPlacedBLLList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        public List <EmployeesCareersHistoryBLL> GetEmployeesByOrganizationJobID(int OrganizationJobID)
        {
            List <EmployeesCareersHistoryBLL> DeservedEmployeesBLLList = new List <EmployeesCareersHistoryBLL>();
            List <EmployeesCareersHistory>    DeservedEmployeesList    = new EmployeesCareersHistoryDAL().GetEmployeesByOrganizationJobID(OrganizationJobID).ToList();

            foreach (var item in DeservedEmployeesList)
            {
                DeservedEmployeesBLLList.Add(new EmployeesCareersHistoryBLL().MapEmployeeCareerHistory(item));
            }
            return(DeservedEmployeesBLLList);
        }
Beispiel #3
0
        public List <EmployeesCareersHistoryBLL> GetNotActiveJobsByRankID(int RankID, List <int> EmployeeCodeIDs)
        {
            List <EmployeesCareersHistoryBLL> EmployeesBLLList = new List <EmployeesCareersHistoryBLL>();
            List <EmployeesCareersHistory>    EmployeesList    = new EmployeesCareersHistoryDAL().GetNotActiveJobsByRankID(RankID, EmployeeCodeIDs).ToList();

            foreach (var item in EmployeesList)
            {
                EmployeesBLLList.Add(new EmployeesCareersHistoryBLL().MapEmployeeCareerHistory(item));
            }
            return(EmployeesBLLList);
        }
Beispiel #4
0
        public List <EmployeesCareersHistoryBLL> GetActiveEmployeesByRankID(int RankID)
        {
            List <EmployeesCareersHistoryBLL> DeservedEmployeesBLLList = new List <EmployeesCareersHistoryBLL>();
            List <EmployeesCareersHistory>    DeservedEmployeesList    = new EmployeesCareersHistoryDAL().GetActiveEmployeesByRankID(RankID).ToList();

            foreach (var item in DeservedEmployeesList)
            {
                DeservedEmployeesBLLList.Add(new EmployeesCareersHistoryBLL().MapEmployeeCareerHistory(item));
            }
            return(DeservedEmployeesBLLList);
        }
Beispiel #5
0
        //public List<EmployeesCareersHistoryBLL> GetDeservedEmployeesInPromotion(int RankID, DateTime PromotionEndDate, int DaysCount)
        //{
        //    List<EmployeesCareersHistoryBLL> DeservedEmployeesBLLList = new List<EmployeesCareersHistoryBLL>();
        //    List<EmployeesCareersHistory> DeservedEmployeesList = new EmployeesCareersHistoryDAL().GetActiveEmployeesByRankID(RankID).Where(x => PromotionEndDate >= x.JoinDate.AddDays(DaysCount)).ToList();
        //    foreach (var item in DeservedEmployeesList)
        //    {
        //        DeservedEmployeesBLLList.Add(new EmployeesCareersHistoryBLL().MapEmployeeCareerHistory(item));
        //    }
        //    return DeservedEmployeesBLLList;
        //}

        //       public EmployeesCareersHistoryBLL GetDeservedEmployeeInPromotionByEmployeeCodeID(int EmployeeCodeID, DateTime PromotionEndDate, int DaysCount)
        //       {
        //reutthis.GetEmployeeCurrentJob(EmployeeCodeID)
        //       }

        public EmployeesCareersHistoryBLL Get(OrganizationsJobsBLL OrganizationJob, CareersHistoryTypesEnum CareerHistoryType, EmployeesCodesBLL EmployeeCode)
        {
            EmployeesCareersHistory    EmployeeCareerHistory    = new EmployeesCareersHistoryDAL().GetByOrganizationJobIDEmployeeCodeIDCareerHistoryTypeID(OrganizationJob.OrganizationJobID, (int)CareerHistoryType, EmployeeCode.EmployeeCodeID);
            EmployeesCareersHistoryBLL EmployeeCareerHistoryBLL = null;

            if (EmployeeCareerHistory != null)
            {
                EmployeeCareerHistoryBLL = new EmployeesCareersHistoryBLL().MapEmployeeCareerHistory(EmployeeCareerHistory);
            }

            return(EmployeeCareerHistoryBLL);
        }
Beispiel #6
0
        public EmployeesCareersHistoryBLL GetEmployeeCurrentJob(int EmployeeCodeID)
        {
            EmployeesCareersHistory    EmployeeCareerHistory    = new EmployeesCareersHistoryDAL().GetActiveJobByEmployeeCodeID(EmployeeCodeID);
            EmployeesCareersHistoryBLL EmployeeCareerHistoryBLL = new EmployeesCareersHistoryBLL();

            if (EmployeeCareerHistory != null)
            {
                EmployeeCareerHistoryBLL = new EmployeesCareersHistoryBLL().MapEmployeeCareerHistory(EmployeeCareerHistory);
            }

            return(EmployeeCareerHistoryBLL);
        }
Beispiel #7
0
        public EmployeesCareersHistoryBLL GetByEmployeeCareerHistoryID(int EmployeeCareerHistoryID)
        {
            EmployeesCareersHistory    EmployeeCareerHistory    = new EmployeesCareersHistoryDAL().GetEmployeesCareersHistoryByEmployeeCareerHistoryID(EmployeeCareerHistoryID);
            EmployeesCareersHistoryBLL EmployeeCareerHistoryBLL = new EmployeesCareersHistoryBLL();

            if (EmployeeCareerHistory != null)
            {
                EmployeeCareerHistoryBLL = new EmployeesCareersHistoryBLL().MapEmployeeCareerHistory(EmployeeCareerHistory);
            }

            return(EmployeeCareerHistoryBLL);
        }
Beispiel #8
0
        public DateTime GetHiringDate(int EmployeeCodeID)
        {
            DateTime HiringDate = DateTime.Now;
            EmployeesCareersHistory EmployeeCareerHistory = new EmployeesCareersHistoryDAL().GetEmployeesCareersHistoryByEmployeeCodeID(EmployeeCodeID)
                                                            .FirstOrDefault(x => x.EmployeeCodeID.Equals(EmployeeCodeID) &&
                                                                            x.CareerHistoryTypeID.Equals((int)CareersHistoryTypesEnum.Hiring));

            if (EmployeeCareerHistory != null && EmployeeCareerHistory.EmployeeCareerHistoryID > 0)
            {
                HiringDate = EmployeeCareerHistory.JoinDate;
            }

            return(HiringDate);
        }
Beispiel #9
0
        public EmployeesCareersHistoryBLL GetEmployeePreviousJob(int EmployeeCodeID)
        {
            EmployeesCareersHistoryBLL CurrentJob = this.GetEmployeeCurrentJob(EmployeeCodeID);
            RanksBLL PreviousRank = new RanksBLL().GetPreviousRankByRankID(CurrentJob.OrganizationJob.Rank.RankID);

            EmployeesCareersHistory    EmployeeCareerHistory    = new EmployeesCareersHistoryDAL().GetByEmployeeCodeIDRankID(EmployeeCodeID, PreviousRank.RankID);
            EmployeesCareersHistoryBLL EmployeeCareerHistoryBLL = new EmployeesCareersHistoryBLL();

            if (EmployeeCareerHistory != null)
            {
                EmployeeCareerHistoryBLL = new EmployeesCareersHistoryBLL().MapEmployeeCareerHistory(EmployeeCareerHistory);
            }

            return(EmployeeCareerHistoryBLL);
        }
Beispiel #10
0
        public Result IncreaseCareerDegree()
        {
            try
            {
                int    newCareerDegree;
                Result result = new Result();
                List <EmployeesCareersHistory> Employees         = new EmployeesCareersHistoryDAL().GetActiveEmployeesCareersHistory();
                List <EmployeesCareersHistory> EmployeesToUpdate = new List <EmployeesCareersHistory>();

                foreach (var EmpCareerHistory in Employees)
                {
                    newCareerDegree = EmpCareerHistory.CareerDegreeID + 1;

                    // checking if new career degree exists or not, if not exists skip
                    if (!new CareersDegreesBLL().GetCareersDegrees().Exists(c => c.CareerDegreeID == newCareerDegree))
                    {
                        continue;
                    }

                    // checking if new career degree & rank has 'basic salary' exists or not, if not exists skip
                    BasicSalariesBLL BasicSalary = new BasicSalariesBLL().GetBasicSalary(EmpCareerHistory.OrganizationsJobs.RankID, newCareerDegree);
                    if (BasicSalary.BasicSalary <= 0)
                    {
                        continue;
                    }

                    // Update record
                    EmpCareerHistory.CareerDegreeID  = newCareerDegree;
                    EmpCareerHistory.LastUpdatedBy   = this.LoginIdentity != null ? this.LoginIdentity.EmployeeCodeID : (int?)null;
                    EmpCareerHistory.LastUpdatedDate = DateTime.Now;

                    EmployeesToUpdate.Add(EmpCareerHistory);
                }

                new EmployeesCareersHistoryDAL().UpdateCareerDegree(EmployeesToUpdate);
                //#endregion
                result.Entity     = this;
                result.EnumType   = typeof(CareersHistoryValidationEnum);
                result.EnumMember = CareersHistoryValidationEnum.Done.ToString();
                return(result);
            }
            catch
            {
                throw;
            }
        }
Beispiel #11
0
        public void DeactivateAllCareerHistoryOfEmployee(int EmployeeCodeID)
        {
            try
            {
                List <EmployeesCareersHistory> EmployeesCareersHistoryList = new EmployeesCareersHistoryDAL().GetEmployeesCareersHistoryByEmployeeCodeID(EmployeeCodeID);
                EmployeesCareersHistory        EmployeeCareerHistory       = new EmployeesCareersHistory();
                foreach (var item in EmployeesCareersHistoryList)
                {
                    EmployeeCareerHistory                 = item;
                    EmployeeCareerHistory.IsActive        = false;
                    EmployeeCareerHistory.LastUpdatedDate = DateTime.Now;
                    EmployeeCareerHistory.LastUpdatedBy   = this.LoginIdentity.EmployeeCodeID;

                    new EmployeesCareersHistoryDAL().UpdateIsActive(EmployeeCareerHistory);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }