public ActionResult NewRequest()
        {
            //Currently Broken due to new Api token***********************************

            ////Empty User
            //TransporationRequest userFill = new TransporationRequest() { User = new Transportation.User() };

            ////Fill Empty User from db
            //userFill.User.FirstName = LoginController.GetAuthorize(Request.Cookies[LoginController.userToken]).userInfo.FirstName;
            //userFill.User.LastName = LoginController.GetAuthorize(Request.Cookies[LoginController.userToken]).userInfo.LastName;
            //userFill.User.BannerId = LoginController.GetAuthorize(Request.Cookies[LoginController.userToken]).userInfo.EmployeeId.Substring(1);
            //userFill.User.OfficePhoneNumber = LoginController.GetAuthorize(Request.Cookies[LoginController.userToken]).userInfo.OfficePhone;
            //userFill.User.Email = LoginController.GetAuthorize(Request.Cookies[LoginController.userToken]).userInfo.Email;
            //return View(userFill);

            UniversalDropDownClass _drop = new UniversalDropDownClass();

            //Populate Global Variables
            _Users           = new SelectList(_drop.PopulateUsers(), "Text", "Value");
            _VehicleAddons   = new SelectList(_drop.PopulateVehiclesAddons(), "Text", "Value");
            _VehicleTypes    = new SelectList(_drop.PopulateVehicles(), "Text", "Value");
            _GasCards        = new SelectList(_drop.PopulateGasCards(), "Text", "Value");;
            _ApprovedDrivers = new SelectList(_drop.PopulateApprovedDrivers(), "Text", "Value");
            //Populate ViewData's
            ViewData["UserDropdown"]            = _Users;
            ViewData["VehicleAddonsDropdown"]   = _VehicleAddons;
            ViewData["VehicleTypesDropdown"]    = _VehicleTypes;
            ViewData["GasCardsDropdown"]        = _GasCards;
            ViewData["ApprovedDriversDropdown"] = _ApprovedDrivers;


            return(View());
        }
예제 #2
0
        public ActionResult NewRequest()
        {
            //var User = LoginController.GetAuthorize(Request.Cookies[LoginController.userToken]);
            _LoggedInUser = LoginController.GetAuthorize(Request.Cookies[LoginController.userToken]);

            //Check if logged in
            if (_LoggedInUser == null)
            {
                //If no user is logged in then redirect to login page
                return(RedirectToAction("../Login/Index"));
            }

            //Empty User
            TransportationRequest_View_DemoForSymposium userFill = new TransportationRequest_View_DemoForSymposium();

            userFill.BannerId          = _LoggedInUser.userInfo.EmployeeId.Substring(1);
            userFill.FirstName         = _LoggedInUser.userInfo.FirstName;
            userFill.LastName          = _LoggedInUser.userInfo.LastName;
            userFill.OfficePhoneNumber = _LoggedInUser.userInfo.OfficePhone;
            userFill.Email             = _LoggedInUser.userInfo.Email;

            UniversalDropDownClass _drop = new UniversalDropDownClass();

            //Populate Global Variables
            _Users           = new SelectList(_drop.PopulateUsers(), "Text", "Value");
            _VehicleAddons   = new SelectList(_drop.PopulateVehiclesAddons(), "Text", "Value");
            _Vehicles        = new SelectList(_drop.PopulateVehicles(), "Text", "Value");
            _GasCards        = new SelectList(_drop.PopulateGasCards(), "Text", "Value");;
            _ApprovedDrivers = new SelectList(_drop.PopulateApprovedDrivers(), "Text", "Value");
            _VehicleTypes    = new SelectList(_drop.PopulateVehicleTypes(), "Text", "Value");

            //Populate ViewData's
            ViewData["UserDropdown"]            = _Users;
            ViewData["VehicleAddonsDropdown"]   = _VehicleAddons;
            ViewData["VehicleTypesDropdown"]    = _VehicleTypes;
            ViewData["VehiclesDropdown"]        = _Vehicles;
            ViewData["GasCardsDropdown"]        = _GasCards;
            ViewData["ApprovedDriversDropdown"] = _ApprovedDrivers;

            return(View(userFill));
        }