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