示例#1
0
        public ActionResult Index(LOBViewModel lobViewModel)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    lobViewModel.lobDesc = lobViewModel.lobDesc.Trim();

                    lobViewModel.AddLOB(lobViewModel);
                    TempData["daID"] = lobViewModel.DAID;
                    lobViewModel.GetScreenAccessRights("LOB Details");
                    return(RedirectToAction("Index", "LOB"));
                }

                lobViewModel.GetLobDetails(lobViewModel.DAID);
                lobViewModel.GetScreenAccessRights("LOB Details");
                return(View(lobViewModel));
            }
            catch (Exception ex)
            {
                errorlogviewmodel = new ErrorLogViewModel();
                errorlogviewmodel.LogError(ex);
                return(View("Error"));
            }
        }
示例#2
0
        public ActionResult Index(int?id)
        {
            try
            {
                if (System.Web.HttpContext.Current.Request.UrlReferrer.ToString().IndexOf("Products") > 0)
                {
                    Session["PreviousURL"] = System.Web.HttpContext.Current.Request.UrlReferrer;
                }
                LOBViewModel lobViewModel = new LOBViewModel();
                if (id == null)
                {
                    id = (int)TempData["daID"];
                }
                lobViewModel.GetLobDetails((int)id);
                lobViewModel.GetScreenAccessRights("LOB Details");
                lobViewModel.DAID = (int)id;

                return(View(lobViewModel));
            }
            catch (Exception ex)
            {
                errorlogviewmodel = new ErrorLogViewModel();
                errorlogviewmodel.LogError(ex);
                return(View("Error"));
            }
        }