Пример #1
0
        public IActionResult Update(DTownDistrictViewModel dtdView)
        {
            int    id = Convert.ToInt32(TempData["id"]);
            string rc = TownHelpers.UpdateDistrictTowns(dtdView, id);

            TempData["sender"] = UPDATE;
            TempData["id"]     = id;
            return(RedirectToAction("Index"));
        }
Пример #2
0
        public IActionResult Create(DTownDistrictViewModel dtd)
        {
            //todo: Create constants for sp for create and update
            //todo: Call function, passing in the model, and sp name.
            //todo: redirect to index to display the new record with ListId
            //todo: z Create page -- add vars containers
            string rc = "";

            if (ModelState.IsValid)
            {
                rc = TownHelpers.UpdateDistrictTowns(dtd, TownId);
            }

            // Int or string?
            if (rc.Length > 0)
            {
                TempData["id"] = Convert.ToInt32(rc);
            }
            TempData["sender"] = CREATE;
            return(RedirectToAction("Index"));
        }