Beispiel #1
0
        public string GetSubCountyNameBySubCountyId(int subCountyId)
        {
            ILookupCounty lookupCountyRepository = new LookupCountyRepository();

            return
                (lookupCountyRepository.FindBy(c => c.SubcountyId == subCountyId).Take(1).FirstOrDefault().SubcountyName);
        }
Beispiel #2
0
        public string GetCountyByCountyId(int countyId)
        {
            ILookupCounty countyRepository = new LookupCountyRepository();
            string        countyName       = countyRepository.FindBy(c => c.CountyId == countyId).Take(1).FirstOrDefault().CountyName;

            return(countyName);
        }
Beispiel #3
0
        public List <LookupCounty> GetCounties()
        {
            ILookupCounty countyRepository = new LookupCountyRepository();
            var           list             = countyRepository.GetAll().GroupBy(x => x.CountyId).Select(x => x.First()).OrderBy(l => l.CountyName);

            return(list.ToList());
        }
Beispiel #4
0
        public List <LookupCounty> GetWardsList(string subcounty)
        {
            ILookupCounty lookupCountyRepository = new LookupCountyRepository();
            var           myList = lookupCountyRepository.FindBy(x => x.SubcountyName == subcounty);
            var           list   = myList.GroupBy(x => x.WardId).Select(x => x.First()).OrderBy(x => x.WardName);

            return(list.Distinct().ToList());
        }
Beispiel #5
0
        public List <LookupCounty> GetSubCounties(string county)
        {
            ILookupCounty lookupCountyRepository = new LookupCountyRepository();
            var           myList = lookupCountyRepository.FindBy(s => s.CountyName == county);
            var           list   = myList.GroupBy(x => x.SubcountyId).Select(x => x.First()).OrderBy(x => x.SubcountyName);

            return(list.ToList());
        }
Beispiel #6
0
        public string GetWardNameByWardId(int wardId)
        {
            ILookupCounty lookupCountyRepository = new LookupCountyRepository();

            return(lookupCountyRepository.FindBy(c => c.WardId == wardId).Take(1).FirstOrDefault().WardName);
        }
Beispiel #7
0
        public LookupCounty GetCountyDetailsByWardName(string wardName)
        {
            ILookupCounty countyRepository = new LookupCountyRepository();

            return(countyRepository.FindBy(c => c.WardName.ToLower() == wardName.ToLower()).FirstOrDefault());
        }