public ActionResult DeviceList(tbl_MasterDeviceList obj, string hid) { if (Session["User"] == null) { return(RedirectToAction("LogIn", "LogIn")); } if (((tbl_UserDetail)Session["User"]).GroupPages.Contains("DeviceList")) { try { new MvcHelper((tbl_UserDetail)Session["User"]); if (string.IsNullOrEmpty(hid)) { MvcHelper.SaveMasterDeviceList(obj); } else { MvcHelper.EditMasterDeviceList(obj, Convert.ToInt64(hid)); } TempData["Success"] = "Data saved successfully."; } catch (Exception ex) { TempData["Error"] = "Something went wrong."; } return(RedirectToAction("DeviceList")); } else { return(RedirectToAction("Error", "ErrorPage")); } }