public ActionResult EditShelfDetails(int id, ShelfModel shelf) { try { ShelfRepository ShelfRepo = new ShelfRepository(); ShelfRepo.UpdateShelf(shelf); var profileData = this.Session["UserProfile"] as UserSession; LogModel logModel = new LogModel() { UserId = profileData.UserID, TableName = "Shelf", Activity = "Updated Shelf", LogDate = DateTime.Now }; logRepository logRepository = new logRepository(); logRepository.AddLog(logModel); return(RedirectToAction("GetAllShelfDetails")); } catch { return(RedirectToAction("GetAllShelfDetails")); } }