Beispiel #1
0
 private static IList <DictItem> GetExtendPropertiesOfItems(IList <DictItem> items)
 {
     for (int i = 0; i <= items.Count - 1; i++)
     {
         items[i] = DictItemService.GetExtendPropertiesOfItem(items[i]);
     }
     return(items);
 }
Beispiel #2
0
        public static IList <Province> GetAllProvince()
        {
            IList <Province> list = new List <Province>();

            foreach (DictItem current in DictItemService.GetDictItemsBy("DISTINCT_0", "Sequence", false))
            {
                list.Add(new Province
                {
                    ProvinceID   = current.ItemID,
                    ProvinceName = current.Title,
                    Sequence     = current.Sequence
                });
            }
            return(list);
        }
Beispiel #3
0
        public static Province GetProvinceByID(string provinceID)
        {
            DictItem dictItemByID = DictItemService.GetDictItemByID(provinceID);

            if (dictItemByID != null)
            {
                return(new Province
                {
                    ProvinceID = dictItemByID.ItemID,
                    ProvinceName = dictItemByID.Title,
                    Sequence = dictItemByID.Sequence
                });
            }
            return(null);
        }
Beispiel #4
0
        public static City GetCityByID(string cityID)
        {
            DictItem dictItemByID = DictItemService.GetDictItemByID(cityID);

            if (dictItemByID != null)
            {
                return(new City
                {
                    CityID = dictItemByID.ItemID,
                    CityName = dictItemByID.Title,
                    ProvinceID = dictItemByID.ParentItemID,
                    Sequence = dictItemByID.Sequence
                });
            }
            return(null);
        }
Beispiel #5
0
        public static IList <City> GetCitiesByProvince(string provinceID)
        {
            IList <City> list = new List <City>();

            foreach (DictItem current in DictItemService.GetDictItemsBy(provinceID, "Sequence", false))
            {
                list.Add(new City
                {
                    CityID     = current.ItemID,
                    CityName   = current.Title,
                    Sequence   = current.Sequence,
                    ProvinceID = provinceID
                });
            }
            return(list);
        }
Beispiel #6
0
        public static string GetAddress(IList <string> ids)
        {
            if (ids == null || ids.Count < 1)
            {
                return("");
            }
            string text = string.Empty;

            foreach (string current in ids)
            {
                if (!StringHelper.isNullOrEmpty(current))
                {
                    DictItem dictItemByID = DictItemService.GetDictItemByID(current);
                    if (dictItemByID != null)
                    {
                        text = text + dictItemByID.Title + " ";
                    }
                }
            }
            return(text);
        }
Beispiel #7
0
        public static IList <DictItem> GetDictItemsByParentID(string parentItemID, string orderBy, bool desc)
        {
            int num = 0;

            return(DictItemService.GetExtendPropertiesOfItems(DictItemService.itemGateway.GetDictItemsBy(parentItemID, orderBy, desc, 0, 9999, out num)));
        }
Beispiel #8
0
 public static DictItem GetDictItemByID(string itemID)
 {
     return(DictItemService.GetExtendPropertiesOfItem(DictItemService.itemGateway.GetDictItemByID(itemID)));
 }