public ActionResult Edit(long id) { try { RoomsSaveModel model = new RoomsSaveModel(); model.Rooms = objAPI.GetObjectByKey <utblLCRoom>("configuration", "roomsbyid", id.ToString(), "id"); return(View(model)); } catch (AuthorizationException) { TempData["ErrMsg"] = "Your Login Session has expired. Please Login Again"; return(RedirectToAction("Login", "Account", new { Area = "" })); } }
public ActionResult Edit(RoomsSaveModel model) { try { if (ModelState.IsValid) { string jsonStr = JsonConvert.SerializeObject(model.Rooms); TempData["ErrMsg"] = objAPI.PostRecordtoApI("configuration", "saveRooms", jsonStr); return(RedirectToAction("index", "rooms", new { Area = "Admin" })); } return(View(model)); } catch (AuthorizationException) { TempData["ErrMsg"] = "Your Login Session has expired. Please Login Again"; return(RedirectToAction("Login", "Account", new { Area = "" })); } }