コード例 #1
0
 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 = "" }));
     }
 }
コード例 #2
0
 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 = "" }));
     }
 }