public ActionResult Index() { var userName = System.Web.HttpContext.Current.User.Identity.Name; var user = _systemService.GetUserAndRole(0, userName); if (user == null) { return(RedirectToAction("Index", "Login")); } if (user.UserR == 0) { return(RedirectToAction("Index", "Home")); } var model = new SupplierViewModel { Stores = new SelectList(_systemService.StoreList(), "Id", "Name"), Countries = new SelectList(_systemService.CountryList(), "Id", "Name"), Types = new SelectList(_systemService.SupplierTypeList(), "Id", "Name"), Suppliers = new SelectList(_systemService.SupplierList(), "Id", "Name"), UserLogin = user }; return(View(model)); }