// // GET: /Loan/Create public ActionResult Create() { IUser currentUser = Authorization.GetAuthroizedUser(); if ( currentUser == null ) return Redirect( "/" ); if ( currentUser.IsClient() ) { List<TariffModel> tariffs; try { TariffModel tariffModel = new TariffModel(); tariffs = tariffModel.SelectAll().ConvertAll( x => ( TariffModel ) x ); } catch { tariffs = new List<TariffModel>(); } ViewData[ "tariffs" ] = tariffs; } else { return Redirect( "/" ); } return View(); }
public ActionResult Index() { IUser currentUser = Authorization.GetAuthroizedUser(); if ( currentUser == null ) return Redirect( "/" ); try { if ( currentUser.IsSuperuser() ) { TariffModel model = new TariffModel(); List<TariffModel> tariffList = model.SelectAll().ConvertAll( x => ( TariffModel ) x ); ViewData[ "tariffList" ] = tariffList; return View(); } } catch { ViewData[ "tariffList" ] = new List<TariffModel>(); return View(); } return Redirect( "/" ); }