public List <ProfileModel> GetListProfileAndRecognitionStatusBy(List <string> StarsIdList = null)
        {
            List <ProfileModel> lst = new List <ProfileModel>();

            using (LBCData context = new LBCData(ConnectionHelper.getConnectionString()))
            {
                var list = (from entity in context.LBC_PROFILE
                            where entity.EMP_STATUS_CODE == "A"
                            select entity).ToList();

                if (StarsIdList != null)
                {
                    for (int i = 0; i < StarsIdList.Count(); i++)
                    {
                        var entry = list.Where(q => q.STARS_ID == StarsIdList[i]).FirstOrDefault();
                        if (entry != null)
                        {
                            lst.Add(MapModelFromLBC_Profile(entry));
                        }
                    }
                }
                else
                {
                    foreach (LBC_PROFILE item in list)
                    {
                        lst.Add(MapModelFromLBC_Profile(item));
                    }
                }
            }

            foreach (ProfileModel item in lst)
            {
                ProfileRecognitionRepository _recognition = new ProfileRecognitionRepository();
                item.recognitionList = _recognition.GetAll(item.STARS_ID);
            }

            return(lst);
        }
        public List <ProfileModel> GetListProfileAndRecognitionStatusBy(string dlrRegion)
        {
            List <ProfileModel> lst = new List <ProfileModel>();

            using (LBCData context = new LBCData(ConnectionHelper.getConnectionString()))
            {
                if (string.IsNullOrEmpty(dlrRegion))
                {
                    var list = (from entity in context.LBC_PROFILE
                                where entity.EMP_STATUS_CODE == "A"
                                //where entity.DLR_REGION == dlrRegion || string.IsNullOrEmpty(entity.DLR_REGION)
                                select entity).ToList();
                    foreach (LBC_PROFILE item in list)
                    {
                        lst.Add(MapModelFromLBC_Profile(item));
                    }
                }
                else
                {
                    var list = (from entity in context.LBC_PROFILE
                                where entity.DLR_REGION == dlrRegion &&
                                entity.EMP_STATUS_CODE == "A"
                                select entity).ToList();
                    foreach (LBC_PROFILE item in list)
                    {
                        lst.Add(MapModelFromLBC_Profile(item));
                    }
                }
            }

            foreach (ProfileModel item in lst)
            {
                ProfileRecognitionRepository _recognition = new ProfileRecognitionRepository();
                item.recognitionList = _recognition.GetAll(item.STARS_ID);
            }

            return(lst);
        }