Ejemplo n.º 1
0
        public string GetSubCountyNameBySubCountyId(int subCountyId)
        {
            ILookupCounty lookupCountyRepository = new LookupCountyRepository();

            return
                (lookupCountyRepository.FindBy(c => c.SubcountyId == subCountyId).Take(1).FirstOrDefault().SubcountyName);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
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());
        }
Ejemplo n.º 4
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());
        }
Ejemplo n.º 5
0
        public string GetWardNameByWardId(int wardId)
        {
            ILookupCounty lookupCountyRepository = new LookupCountyRepository();

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

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