예제 #1
0
        public ActionResult Delete(SportsSide.DAL.DISTRICT district)
        {
            var result = webApi.DeleteDistrict(district);

            if (result == false)
            {
                var oldDistrict = webApi.GetDistrict(district.DISTRICT_ID);
                TempData["Hata"] = "Bir hata oluştu.";
                return(View(oldDistrict));
            }
            return(RedirectToAction("Index", "Districts"));
        }
예제 #2
0
        public ActionResult Create(SportsSide.DAL.DISTRICT model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            var result = webApi.PostDistrict(model);

            if (result == false)
            {
                TempData["Hata"] = "Bir hata oluştu.";
                return(View(model));
            }
            return(RedirectToAction("Index", "Districts"));
        }
예제 #3
0
        public ActionResult Edit(SportsSide.DAL.DISTRICT model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            var result = webApi.PutDistrict(model);

            if (result == false)
            {
                TempData["Hata"] = "Bir hata oluştu.";
                ViewBag.Areas    = new SelectList(webApi.GetAreas(), "AREA_ID", "AREA_NAME");
                ViewBag.Cities   = new SelectList(webApi.GetCitiesByAreas(model.CITY.AREA.AREA_ID), "CITY_ID", "CITY_NAME");
                return(View(model));
            }
            return(RedirectToAction("Index", "Districts"));
        }