Ejemplo n.º 1
0
        public String GetClientId()
        {
            if (RegisterHost == null)
            {
                return(null);
            }
            if (RegisterHost.Length < 3)
            {
                return(null);
            }
            if (Tenant == 0)
            {
                return(null);
            }
            // a-la SQL GetClientId
            var x = RegisterHost.Substring(0, 3).ToUpperInvariant();

            if (x[1] == 'O')
            {
                x = x.Substring(0, 1) + x.Substring(2, 1);
            }
            else
            {
                x = x.Substring(0, 2);
            }
            return($"{x}-{Tenant}");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// NOTE: specified controller folder, as this may have been triggered by the surface controller
        /// </summary>
        /// <param name="renderModel"></param>
        /// <returns></returns>
        public override ActionResult Index(RenderModel renderModel)
        {
            RegisterHost model = (RegisterHost)renderModel.Content;

            if (this.Members.IsLoggedInPartier())
            {
                if (this.Members.GetCurrentMember() is PartyHost)
                {
                    PartyHost partyHost = (PartyHost)this.Members.GetCurrentMember();

                    if (!partyHost.HasRequestedPartyKit)
                    {
                        return(View("RegisterHost/RegisterHostPartyKit", model));
                    }

                    return(this.Redirect(partyHost.PartyUrl));
                }
                else
                {
                    // user already registered but not a host, so redirect back to home
                    return(this.Redirect(Home.GetCurrentHome(model).Url));
                }
            }

            //return View("RegisterHost", model);
            return(View("RegisterHost/RegisterHost", model));
        }
        public ActionResult RenderProfileTShirtSizeForm()
        {
            ProfileTShirtSizeForm profileTShirtSizeForm = new ProfileTShirtSizeForm();

            RegisterHost registerHost = (RegisterHost)this.Umbraco.TypedContentSingleAtXPath("//" + RegisterHost.Alias);

            this.ViewBag.TShirtSizes = registerHost.TShirtSizes;

            PartyHost partyHost = (PartyHost)this.Members.GetCurrentPartier();

            profileTShirtSizeForm.TShirtSize = partyHost.TShirtSize;

            return(this.PartialView("Profile/Forms/ProfileTShirtSizeForm", profileTShirtSizeForm));
        }
        [ChildActionOnly] // (Cannot redirect from a Child Action)
        public ActionResult RenderRegisterHostForm()
        {
            // get the renderModel for the current page
            RegisterHost model = (RegisterHost)this.CurrentPage;

            // get marketing sources for a dropdown
            List <string> marketingSources = new List <string>(model.MarketingSources);

            // add an empty option the the beginning
            marketingSources.Insert(0, string.Empty);

            // add a dropdown to the viewbag
            this.ViewBag.MarketingSources = new SelectList(marketingSources);

            return(this.PartialView("RegisterHost/Forms/RegisterHostForm", new RegisterHostForm()));
        }
        public ActionResult RenderRegisterHostPartyKitForm()
        {
            // get the renderModel for the current page
            RegisterHost model = (RegisterHost)this.CurrentPage;

            this.ViewBag.TShirtSizes = model.TShirtSizes;

            // set first / last name, as this will be available if user connected via facebook

            RegisterHostPartyKitForm registerHostPartyKitForm = new RegisterHostPartyKitForm();

            PartyHost partyHost = (PartyHost)this.Members.GetCurrentMember();

            registerHostPartyKitForm.FirstName = partyHost.FirstName;
            registerHostPartyKitForm.LastName  = partyHost.LastName;

            return(this.PartialView("RegisterHost/Forms/RegisterHostPartyKitForm", registerHostPartyKitForm));
        }