Esempio n. 1
0
        //[Authorize]
        // //*******************************************  Add this method to set the ViewModel "arole variable"
        public ActionResult IndexAdmin()
        {  // ****************************************** this set the viewmodel admin role (
            var vm = new EventViewModel(true);

            vm.HandleRequest();
            return(View("Index", vm));
        }
Esempio n. 2
0
        //[Authorize]
        public ActionResult Index()
        {
            var vm = new EventViewModel();

            vm.HandleRequest();
            return(View(vm));
        }
Esempio n. 3
0
        public ActionResult IndexAdmin(EventViewModel vm)
        {                                    // ****************************************** this set the viewmodel admin role (
            vm.IsValid = ModelState.IsValid; // added *****************************
            vm.HandleRequest();

            // redirect if we need to add marketing material to the product
            if (vm.EventCommand.Equals("updateMaterials"))
            {
                return(RedirectToAction("IndexAdmin", "MarketingMaterial", new { id = vm.EventArgument, role = true }));
            }
            else if (vm.EventCommand.Equals("updateAttendance"))
            {
                return(RedirectToAction("IndexAdmin", "Attendee", new { id = vm.EventArgument, role = true }));
            }
            // NOTE: Must clear the model state in order to bind
            //       the @Html helpers to the new model values if modelstate is valid
            if (vm.IsValid)   // added *******************************
            {
                ModelState.Clear();
            }
            return(View("Index", vm));
        }