예제 #1
0
        //
        // 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();
        } 
예제 #2
0
        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( "/" );
        }