Ejemplo n.º 1
0
        public ActionResult UnMapView(string viewId)
        {
            string userkey   = ConfigurationManager.AppSettings["userkey"];
            string uid       = ConfigurationManager.AppSettings["uid"];
            string LoginUser = (string)Session["LoginSAPID"];

            try
            {
                Employer.Employer employer = new Employer.Employer();
                var unMap       = employer.UnMapRoleView(viewId, LoginUser, userkey, uid);
                var unmapStatus = unMap.Split('~');

                if (unmapStatus[0] != "01")
                {
                    TempData["error"] = unmapStatus[1];
                    ViewBag.Error     = TempData["error"];
                    return(RedirectToAction("MapViewsToRole"));
                }
                else
                {
                    TempData["error"] = unmapStatus[1];
                    ViewBag.Error     = TempData["error"];
                    return(RedirectToAction("MapViewsToRole"));
                }
            }
            catch (Exception ex)
            {
                LogError logerror = new LogError();
                logerror.ErrorLog("", LoginUser, "", "AdminViews/UnMapView", "AdminViews", "UnMapView", "UnMapRoleView Error", ex.Message.ToString(), 0);
                TempData["error"] = ex.Message.ToString();
                ViewBag.Error     = TempData["error"];
                return(View());;
            }
        }