public ActionResult Create(string Tab)
        {
            ValueList valueList = GStoreDb.ValueLists.Create();

            valueList.SetDefaultsForNew(CurrentClientOrThrow);
            ValueListEditAdminViewModel viewModel = new ValueListEditAdminViewModel(CurrentStoreFrontOrThrow, CurrentUserProfileOrThrow, valueList, Tab, isStoreAdminEdit: true, isCreatePage: true);

            return(View("Create", viewModel));
        }
示例#2
0
        public ActionResult Create(int?clientId)
        {
            if (GStoreDb.Clients.IsEmpty())
            {
                AddUserMessage("No Clients in database.", "You must create a Client before you can add Value Lists.", UserMessageType.Warning);
                return(RedirectToAction("Create", "ClientSysAdmin"));
            }

            ValueList model = GStoreDb.ValueLists.Create();

            Client client = null;

            if (clientId.HasValue && clientId.Value > 0)
            {
                client = GStoreDb.Clients.FindById(clientId.Value);
            }
            model.SetDefaultsForNew(client);
            this.BreadCrumbsFunc = htmlHelper => this.ValueListBreadcrumb(htmlHelper, model.ClientId, model);
            return(View(model));
        }