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