public ActionResult Add(int id = 0) { #region Check Rights bool hasRights; if (id == 0) { hasRights = AdminHelper.CheckUserAction(ScreenEnum.Agent, ActionEnum.Add); } else { hasRights = AdminHelper.CheckUserAction(ScreenEnum.Agent, ActionEnum.Edit); } if (!hasRights) { return(RedirectToAction("UnAuthorized", "Home", new { area = "" })); } #endregion ViewData["CityList"] = ListCommonHelper.GetCityGrouped(); AgentVm agentObj = AgentHelper.GetAgentInfo(id); return(View(agentObj)); }