Ejemplo n.º 1
0
        private IActionResult register(UserTypes type)
        {
            switch (type)
            {
            case UserTypes.Buyer:
                User.Profile = new Buyer(Name, Email, "", "", Username, Password);
                Buyers.Create((Buyer)User.Profile);
                return(RedirectToPage("ShopCart"));

            case UserTypes.Bringer:
                User.Profile = new Bringer(Name, Email, "", 0, new List <Order>(), Username, Password);
                Bringers.Create((Bringer)User.Profile);
                throw new NotImplementedException("We have no bringer pages yet");
                return(RedirectToPage("<Bringer Start Page Here>"));    // send to start page for bringers

            case UserTypes.Store:
                User.Profile = new Store(Name, Email, "", "", 0, Username, Password);
                Stores.Create((Store)User.Profile);
                return(RedirectToPage("/Catalog/ProductCatalog"));

            default:
                //This should not happen, please throw an exception here
                return(Page());
            }
        }