示例#1
0
        public List <IdName> GetCityList(ReqGetCityList req)
        {
            var cityList = new List <City>();

            if (!string.IsNullOrWhiteSpace(req.StateId))
            {
                cityList =
                    Provider.Database.ReadList <City>(
                        "SELECT Id, Name FROM City WHERE StateId={0} AND IsDeleted=0 ORDER BY Name", req.StateId);
            }
            else if (!string.IsNullOrWhiteSpace(req.CountryId))
            {
                cityList =
                    Provider.Database.ReadList <City>(
                        "SELECT Id, Name FROM City WHERE CountryId={0} AND IsDeleted=0 ORDER BY Name", req.CountryId);
            }

            return(cityList.Select(c => new IdName()
            {
                Id = c.Id, Name = c.Name
            }).ToList());
        }
示例#2
0
 public List <IdName> GetCityList(ReqGetCityList req)
 {
     return(Call <List <IdName>, ReqGetCityList>(req, MethodBase.GetCurrentMethod().Name));
 }