Example #1
0
        //Ham lay danh sach cac tinh thanh lam diem di
        private List <SelectListItem> GetCityDeparture()
        {
            List <SelectListItem> items = new List <SelectListItem>();
            RepositoryOBTRS       db    = new RepositoryOBTRS();
            List <int>            city  = db.GetCityStart();

            for (int i = 0; i < city.Count; i++)
            {
                items.Add(new SelectListItem {
                    Text = db.GetCityName(city[i]), Value = city[i].ToString()
                });
            }
            return(items);
        }
Example #2
0
        private List <SelectListItem> GetCityDeparture(int CityDepartureID)
        {
            List <SelectListItem> items = new List <SelectListItem>();
            RepositoryOBTRS       db    = new RepositoryOBTRS();
            List <int>            city  = db.GetCityStart();

            for (int i = 0; i < city.Count; i++)
            {
                if (Convert.ToInt32(city[i]) == CityDepartureID)
                {
                    items.Add(new SelectListItem {
                        Text = db.GetCityName(city[i]), Value = city[i].ToString(), Selected = true
                    });
                }
                else
                {
                    items.Add(new SelectListItem {
                        Text = db.GetCityName(city[i]), Value = city[i].ToString()
                    });
                }
            }
            return(items);
        }