Ejemplo n.º 1
0
        public int Save(CountryCity city)
        {
            int res=0;
            if (city.id > 0)
                res =  _countryCityDao.Update(city);
            else
                res =  _countryCityDao.Insert(city);

            //add by hbqian in 201305012 for修改城市后天气服务的静态城市列表能重新生效
            CityCodeService.codes = this.GetCities();
            //重新取天气
            if (!string.IsNullOrEmpty(city.name))
            {
                if (CityCodeService.plantTemp.ContainsKey(city.name))
                {
                    CityCodeService.plantTemp.Remove(city.name);
                }
            }
            return res;
        }
Ejemplo n.º 2
0
 public int Save(CountryCity city)
 {
     if (city.id > 0)
         return _countryCityDao.Update(city);
     return _countryCityDao.Insert(city);
 }
Ejemplo n.º 3
0
 public CountryCity Get(CountryCity cc)
 {
     return _countryCityDao.Get(cc);
 }
Ejemplo n.º 4
0
 public ActionResult Country_edit(CountryCity cc)
 {
     string start = Request.Form["start"];
     string end = Request.Form["end"];
     string days = Request.Form["hours"];
     cc.code = string.Format("{0}&{1}&{2}", start, end, days);
     CountryCityService.GetInstance().Save(cc);
     return Redirect("/admin/countries");
 }
Ejemplo n.º 5
0
        public ActionResult Country_edit(string id)
        {
            int cid = 0;
            int.TryParse(id, out cid);
            CountryCity country = CountryCityService.GetInstance().Get(new CountryCity() { id = cid });
            if (country == null)
                country = new CountryCity { weather_code = string.Empty };
            if (country.weather_code == null)
                country.weather_code = string.Empty;

            return View(@"countrycity/country_edit", country);
        }
Ejemplo n.º 6
0
 public ActionResult City_edit(CountryCity cc)
 {
     string lat = Request.Form["lat"];
     string lon = Request.Form["lon"];
     cc.latlon = string.Format("{0},{1}", lat, lon);
     CountryCityService.GetInstance().Save(cc);
     return Redirect("/admin/cities/" + cc.pid);
 }
Ejemplo n.º 7
0
 public ActionResult City_edit(CountryCity cc)
 {
     CountryCityService.GetInstance().Save(cc);
     return Redirect("/admin/cities/" + cc.pid);
 }