Exemple #1
0
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <OrderStatus>()
     {
         new OrderStatus
         {
             Code = OrderStatuses.Canceled
         },
         new OrderStatus
         {
             Code = OrderStatuses.Confirmed
         },
         new OrderStatus
         {
             Code = OrderStatuses.Delivered
         },
         new OrderStatus
         {
             Code = OrderStatuses.Finished
         },
         new OrderStatus
         {
             Code = OrderStatuses.Shipping
         },
         new OrderStatus
         {
             Code = OrderStatuses.Unconfirmed
         }
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <Route>()
     {
         new Route
         {
             AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.LoginComponent).Id,
             Title       = "Admin Login",
             Url         = "login",
             InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
             Category    = new Category
             {
                 CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.Product).Id,
                 ParentId        = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.Admin).Id,
                 Characteristics = new List <CategoryCharacteristic>()
                 {
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                         Value            = "Admin Login"
                     },
                 }
             },
         },
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <CategoryType>()
     {
         new CategoryType
         {
             Code = CategoryTypes.Product
         },
         new CategoryType
         {
             Code = CategoryTypes.Top
         },
         new CategoryType
         {
             Code = CategoryTypes.Footer
         },
         new CategoryType
         {
             Code = CategoryTypes.Hidden
         },
         new CategoryType
         {
             Code = CategoryTypes.TopUser
         },
         new CategoryType
         {
             Code = CategoryTypes.Left
         }
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <Route>()
     {
         new Route
         {
             AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.SubCategoryComponent).Id,
             Title       = "Catalog",
             Url         = "catalog",
             InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
             Parameter   = DatabaseSeedCodes.Catalog,
             Category    = new Category
             {
                 CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.Left).Id,
                 ParentId        = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.Admin).Id,
                 Characteristics = new List <CategoryCharacteristic>()
                 {
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                         Value            = "Catalog"
                     },
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IconClass).Id,
                         Value            = "fa fa-book"
                     },
                 }
             },
         },
         new Route
         {
             AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.SubCategoryComponent).Id,
             Title       = "Sales",
             Url         = "sales",
             InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
             Parameter   = DatabaseSeedCodes.Sales,
             Category    = new Category
             {
                 CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.Left).Id,
                 ParentId        = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.Admin).Id,
                 Characteristics = new List <CategoryCharacteristic>()
                 {
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                         Value            = "Sales"
                     },
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IconClass).Id,
                         Value            = "fa fa-shopping-cart"
                     },
                 }
             },
         },
     });
 }
Exemple #5
0
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <AngularComponent>()
     {
         new AngularComponent
         {
             Code           = AngularComponents.BasketComponent,
             InputFieldsets = new List <InputFieldset>()
             {
                 new InputFieldset
                 {
                     Code        = "BasketInfo",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
                     InputFields = new List <InputField>()
                     {
                     }
                 },
                 new InputFieldset
                 {
                     Code        = "FooterActions",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Checkout",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Button
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Atsiskaitymas"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                     Value            = "btn btn-success"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Url).Id,
                                     Value            = "/vartotojas/atsiskaitymas"
                                 },
                             }
                         },
                     }
                 },
             },
         },
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <AngularComponent>()
     {
         new AngularComponent
         {
             Code = AngularComponents.LogoutComponent,
         },
     });
 }
Exemple #7
0
        public static void Seed <TDbContet>(TDbContet dbContext)
            where TDbContet : DbContext
        {
            DatabaseSeedExtensions.AddSeeds(dbContext, new List <Route>()
            {
                new Route
                {
                    // TODO: AngularComponentId should be AdminOrderComponent
                    AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.ListOrderAdminComponent).Id,
                    Title       = "Orders",
                    Url         = "orders",
                    InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                    Parameter   = DatabaseSeedCodes.SalesOrders,
                    Category    = new Category
                    {
                        CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.Left).Id,
                        ParentId        = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.Sales).Id,
                        Characteristics = new List <CategoryCharacteristic>()
                        {
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                Value            = "Orders"
                            },
                        }
                    },
                },
            });

            DatabaseSeedExtensions.AddSeeds(dbContext, new List <Route>()
            {
                new Route
                {
                    AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.EditOrderAdminComponent).Id,
                    Title       = "Order Edit",
                    Url         = "edit",
                    InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                    Parameter   = DatabaseSeedCodes.SalesOrdersEdit,
                    Category    = new Category
                    {
                        CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.Left).Id,
                        ParentId        = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.SalesOrders).Id,
                        Characteristics = new List <CategoryCharacteristic>()
                        {
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                Value            = "Order Edit"
                            },
                        }
                    },
                },
            });
        }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <SystemSetting>()
     {
         new SystemSetting
         {
             Code  = SystemSettingOptions.ActiveInputForm.Name,
             Value = InputFormCodes.Lucid
         },
     });
 }
Exemple #9
0
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <LocaleLanguageResource>()
     {
         new LocaleLanguageResource
         {
             Code       = AngularComponents.AddCategoryAdminComponent,
             LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
             Value      = "labai gerai"
         },
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <Route>()
     {
         new Route
         {
             AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.SubCategoryComponent).Id,
             Title       = "Kanceliarinės prekės",
             Url         = "kanceliarines-prekes",
             InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
             Parameter   = DatabaseSeedCodes.Stationary,
             Category    = new Category
             {
                 CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.Product).Id,
                 ParentId        = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.Home).Id,
                 Characteristics = new List <CategoryCharacteristic>()
                 {
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                         Value            = "Kanceliarinės prekės",
                     },
                 }
             },
         },
         new Route
         {
             AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.SubCategoryComponent).Id,
             Title       = "Info",
             Url         = "info",
             InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
             Parameter   = DatabaseSeedCodes.Info,
             Category    = new Category
             {
                 CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.Top).Id,
                 ParentId        = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.Home).Id,
                 Characteristics = new List <CategoryCharacteristic>()
                 {
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                         Value            = "Info",
                     },
                 }
             },
         },
     });
 }
Exemple #11
0
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <Language>()
     {
         new Language
         {
             Code = Languages.Lithuanian,
         },
         new Language
         {
             Code = Languages.English,
         }
     });
 }
Exemple #12
0
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <ProductDetailType>()
     {
         new ProductDetailType
         {
             Code = ProductDetailTypes.ColorId
         },
         new ProductDetailType
         {
             Code = ProductDetailTypes.Url
         }
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <ImageSizeType>()
     {
         new ImageSizeType
         {
             Code = ImageSizeTypes.Small
         },
         new ImageSizeType
         {
             Code = ImageSizeTypes.Big
         }
     });
 }
Exemple #14
0
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <ShippingMethod>()
     {
         new ShippingMethod
         {
             Code  = ShippingMethods.Courier,
             Price = 4.99M
         },
         new ShippingMethod
         {
             Code  = ShippingMethods.Shop,
             Price = 0.00M
         },
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <PaymentMethod>()
     {
         new PaymentMethod
         {
             Code = PaymentMethods.Banklink,
             PaymentMethodTypes = new List <PaymentMethodType>()
             {
                 new PaymentMethodType()
                 {
                     Code = PaymentMethodTypes.Citadele.Code
                 },
                 new PaymentMethodType()
                 {
                     Code = PaymentMethodTypes.DanskeBank.Code
                 },
                 new PaymentMethodType()
                 {
                     Code = PaymentMethodTypes.Dnb.Code
                 },
                 new PaymentMethodType()
                 {
                     Code = PaymentMethodTypes.Nordea.Code
                 },
                 new PaymentMethodType()
                 {
                     Code = PaymentMethodTypes.Seb.Code
                 },
                 new PaymentMethodType()
                 {
                     Code = PaymentMethodTypes.SiauliaiBank.Code
                 },
                 new PaymentMethodType()
                 {
                     Code = PaymentMethodTypes.Swedbank.Code
                 },
             }
         },
         new PaymentMethod
         {
             Code = PaymentMethods.Cash
         },
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <InputForm>()
     {
         new InputForm
         {
             Code = InputFormCodes.Admin
         },
         new InputForm
         {
             Code = InputFormCodes.Lucid
         },
         new InputForm
         {
             Code = InputFormCodes.CommonInputForm
         },
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <Route>()
     {
         new Route
         {
             AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.DashboardAdminComponent).Id,
             Title       = "Dashboard",
             Url         = "admin",
             InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
             Parameter   = DatabaseSeedCodes.Admin,
             Category    = new Category
             {
                 CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.Left).Id,
                 Characteristics = new List <CategoryCharacteristic>()
                 {
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                         Value            = "Dashboard"
                     },
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Description).Id,
                         Value            = "<strong>Welcome to The EK-Shop Admin Panel!</strong><br><br>Most of the functionality is still in the developing or testing stage."
                     },
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IconClass).Id,
                         Value            = "fa fa-home"
                     },
                 }
             },
         },
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <Characteristic>()
     {
         new Characteristic
         {
             Code = CharacteristicCodes.AccessLevel
         },
         new Characteristic
         {
             Code = CharacteristicCodes.Name
         },
         new Characteristic
         {
             Code = CharacteristicCodes.Description
         },
         new Characteristic
         {
             Code = CharacteristicCodes.BreadcrumbName
         },
         new Characteristic
         {
             Code = CharacteristicCodes.NavigationName
         },
         new Characteristic
         {
             Code = CharacteristicCodes.AltInfo
         },
         new Characteristic
         {
             Code = CharacteristicCodes.Parameter
         },
         new Characteristic
         {
             Code = CharacteristicCodes.ValidateMaxValueMessage
         },
         new Characteristic
         {
             Code = CharacteristicCodes.ValidateMinValueMessage
         },
         new Characteristic
         {
             Code = CharacteristicCodes.HtmlType
         },
         new Characteristic
         {
             Code = CharacteristicCodes.IsDisabled
         },
         new Characteristic
         {
             Code = CharacteristicCodes.IsHidden
         },
         new Characteristic
         {
             Code = CharacteristicCodes.ValidateMaxValue
         },
         new Characteristic
         {
             Code = CharacteristicCodes.ValidateMinValue
         },
         new Characteristic
         {
             Code = CharacteristicCodes.Label
         },
         new Characteristic
         {
             Code = CharacteristicCodes.PrimaryCssClass
         },
         new Characteristic
         {
             Code = CharacteristicCodes.IsRequired
         },
         new Characteristic
         {
             Code = CharacteristicCodes.IsRequiredMessage
         },
         new Characteristic
         {
             Code = CharacteristicCodes.Characteristic
         },
         new Characteristic
         {
             Code = CharacteristicCodes.FieldType
         },
         new Characteristic
         {
             Code = CharacteristicCodes.ApiUrl
         },
         new Characteristic
         {
             Code = CharacteristicCodes.Placeholder
         },
         new Characteristic
         {
             Code = CharacteristicCodes.Order
         },
         new Characteristic
         {
             Code = CharacteristicCodes.Url
         },
         new Characteristic
         {
             Code = CharacteristicCodes.UrlQuery
         },
         new Characteristic
         {
             Code = CharacteristicCodes.PopoverFocusButton
         },
         new Characteristic
         {
             Code = CharacteristicCodes.PopoverMessage
         },
         new Characteristic
         {
             Code = CharacteristicCodes.PopoverTitle
         },
         new Characteristic
         {
             Code = CharacteristicCodes.IsYesNoPopoverRequired
         },
         new Characteristic
         {
             Code = CharacteristicCodes.NgRepeatCssClass
         },
         new Characteristic
         {
             Code = CharacteristicCodes.ValidateRegexValue
         },
         new Characteristic
         {
             Code = CharacteristicCodes.ValidateRegexValueMessage
         },
         new Characteristic
         {
             Code = CharacteristicCodes.IsShowHomePage
         },
         new Characteristic
         {
             Code = CharacteristicCodes.IconClass
         },
     });
 }
        public static void Seed <TDbContet>(TDbContet dbContext)
            where TDbContet : DbContext
        {
            DatabaseSeedExtensions.AddSeeds(dbContext, new List <Phrase>()
            {
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethodTypes.Citadele.Code,
                    Value      = PaymentMethodTypes.Citadele.Name
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethodTypes.DanskeBank.Code,
                    Value      = PaymentMethodTypes.DanskeBank.Name
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethodTypes.Dnb.Code,
                    Value      = PaymentMethodTypes.Dnb.Name
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethodTypes.Nordea.Code,
                    Value      = PaymentMethodTypes.Nordea.Name
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethodTypes.Seb.Code,
                    Value      = PaymentMethodTypes.Seb.Name
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethodTypes.SiauliaiBank.Code,
                    Value      = PaymentMethodTypes.SiauliaiBank.Name
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethodTypes.Swedbank.Code,
                    Value      = PaymentMethodTypes.Swedbank.Name
                },

                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = CategoryTypes.Footer,
                    Value      = "Footer"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = CategoryTypes.Left,
                    Value      = "Left"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = CategoryTypes.Product,
                    Value      = "Product"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = CategoryTypes.Top,
                    Value      = "Top"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = CategoryTypes.TopUser,
                    Value      = "Top User Section"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = AngularComponents.HomeComponent,
                    Value      = "Home Category"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = AngularComponents.ProductComponent,
                    Value      = "Product"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = AngularComponents.SubCategoryComponent,
                    Value      = "Sub Category"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = AngularComponents.TextCategoryComponent,
                    Value      = "Custom Text Based Category"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = ShippingMethods.Courier,
                    Value      = "Atsiėmimas iš kurjerio"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = ShippingMethods.Shop,
                    Value      = "Atsiėmimas parduotuvėje"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethods.Banklink,
                    Value      = "El. bankininkystė"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethods.Cash,
                    Value      = "Grynais"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethodTypes.Citadele.Code,
                    Value      = PaymentMethodTypes.Citadele.Name
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethodTypes.DanskeBank.Code,
                    Value      = PaymentMethodTypes.DanskeBank.Name
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethodTypes.Dnb.Code,
                    Value      = PaymentMethodTypes.Dnb.Name
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethodTypes.Nordea.Code,
                    Value      = PaymentMethodTypes.Nordea.Name
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethodTypes.Seb.Code,
                    Value      = PaymentMethodTypes.Seb.Name
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethodTypes.SiauliaiBank.Code,
                    Value      = PaymentMethodTypes.SiauliaiBank.Name
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = PaymentMethodTypes.Swedbank.Code,
                    Value      = PaymentMethodTypes.Swedbank.Name
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = OrderStatuses.Canceled,
                    Value      = "Atšauktas"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = OrderStatuses.Confirmed,
                    Value      = "Patvirtintas"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = OrderStatuses.Delivered,
                    Value      = "Pristatytas"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = OrderStatuses.Finished,
                    Value      = "Pabaigtas"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = OrderStatuses.Shipping,
                    Value      = "Siunčiamas"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                    Code       = OrderStatuses.Unconfirmed,
                    Value      = "Nepatvirtintas"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = OrderStatuses.Canceled,
                    Value      = "Canceled"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = OrderStatuses.Confirmed,
                    Value      = "Confirmed"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = OrderStatuses.Delivered,
                    Value      = "Delivered"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = OrderStatuses.Finished,
                    Value      = "Finished"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = OrderStatuses.Shipping,
                    Value      = "Shipping"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = OrderStatuses.Unconfirmed,
                    Value      = "Unconfirmed"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = ShippingMethods.Courier,
                    Value      = "Withdrawal from courier"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = ShippingMethods.Shop,
                    Value      = "Withdrawal from shop"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = PaymentMethods.Banklink,
                    Value      = "Bank-link"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = PaymentMethods.Cash,
                    Value      = "Cash"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = PaymentMethodTypes.Citadele.Code,
                    Value      = "Citadele"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = PaymentMethodTypes.DanskeBank.Code,
                    Value      = "Dasnke bank"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = PaymentMethodTypes.Dnb.Code,
                    Value      = "Dnb"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = PaymentMethodTypes.Nordea.Code,
                    Value      = "Nordea"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = PaymentMethodTypes.Seb.Code,
                    Value      = "Seb"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = PaymentMethodTypes.SiauliaiBank.Code,
                    Value      = "Siauliai bank"
                },
                new Phrase
                {
                    LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                    Code       = PaymentMethodTypes.Swedbank.Code,
                    Value      = "Swedbank"
                },
            });
        }
        public static void Seed <TDbContet>(TDbContet dbContext)
            where TDbContet : DbContext
        {
            DatabaseSeedExtensions.AddSeeds(dbContext, new List <AngularComponent>()
            {
                new AngularComponent
                {
                    Code           = AngularComponents.EditOrderAdminComponent,
                    InputFieldsets = new List <InputFieldset>()
                    {
                        new InputFieldset
                        {
                            Code            = "AdditionalInfo",
                            InputFormId     = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                            Characteristics = new List <InputFieldsetCharacteristic>()
                            {
                                new InputFieldsetCharacteristic
                                {
                                    CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                    Value            = "Info"
                                },
                            },
                            InputFields = new List <InputField>()
                            {
                                new InputField
                                {
                                    Code            = "ShippingMethod",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Dropdown
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "Shipping method"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequired).Id,
                                            Value            = "true"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "1"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "PaymentMethod",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Dropdown
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "Payment method"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequired).Id,
                                            Value            = "true"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "2"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "PaymentMethodType",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Dropdown
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "Payment method type"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "3"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "OrderStatus",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Dropdown
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "Order status"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequired).Id,
                                            Value            = "true"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "4"
                                        },
                                    }
                                },
                            }
                        },
                        new InputFieldset
                        {
                            Code            = "BillingInfo",
                            InputFormId     = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                            Characteristics = new List <InputFieldsetCharacteristic>()
                            {
                                new InputFieldsetCharacteristic
                                {
                                    CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                    Value            = "Billing Info"
                                },
                            },
                            InputFields = new List <InputField>()
                            {
                                new InputField
                                {
                                    Code            = "Name",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "Name"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                            Value            = HtmlTypes.Text
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequired).Id,
                                            Value            = "true"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Textbox
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "1"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "LastName",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "Last name"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                            Value            = HtmlTypes.Text
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequired).Id,
                                            Value            = "true"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Textbox
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "2"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "Email",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "Email"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                            Value            = HtmlTypes.Text
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequired).Id,
                                            Value            = "true"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Textbox
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "3"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "PhoneNumber",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "Phone"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                            Value            = HtmlTypes.Text
                                        },

                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequiredMessage).Id,
                                            Value            = "Required field"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequired).Id,
                                            Value            = "true"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Textbox
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "4"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "IsBuyerCompany",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "Is buyer company"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Checkbox
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "5"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "CompanyName",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "Company name"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                            Value            = HtmlTypes.Text
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Textbox
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "6"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "CompanyCode",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "Comany code"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                            Value            = HtmlTypes.Text
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Textbox
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "7"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "CompanyVat",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "Company VAT"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                            Value            = HtmlTypes.Text
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Textbox
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "8"
                                        },
                                    }
                                },
                            }
                        },
                        new InputFieldset
                        {
                            Code            = "BillingShippingInfo",
                            InputFormId     = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                            Characteristics = new List <InputFieldsetCharacteristic>()
                            {
                                new InputFieldsetCharacteristic
                                {
                                    CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                    Value            = "Shipping Info"
                                },
                            },
                            InputFields = new List <InputField>()
                            {
                                new InputField
                                {
                                    Code            = "Address",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "Address"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                            Value            = HtmlTypes.Text
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Textbox
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "1"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "City",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "City"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                            Value            = HtmlTypes.Text
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Textbox
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "2"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "PostCode",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                            Value            = "Post code"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                            Value            = HtmlTypes.Number
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Textbox
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "3"
                                        },
                                    }
                                },
                            }
                        },
                        new InputFieldset
                        {
                            Code            = "BasketInfo",
                            InputFormId     = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                            Characteristics = new List <InputFieldsetCharacteristic>()
                            {
                                new InputFieldsetCharacteristic
                                {
                                    CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                    Value            = "Basket Info"
                                },
                            },
                            InputFields = new List <InputField>()
                            {
                            }
                        },
                        new InputFieldset
                        {
                            Code        = "BasketInfoTableHeader",
                            InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                            InputFields = new List <InputField>()
                            {
                                new InputField
                                {
                                    Code            = "Name",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Text
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                            Value            = "Product name"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "1"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "Quantity",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Text
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                            Value            = "Quantity"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "2"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "Price",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Text
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                            Value            = "Price"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "3"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "TotalPrice",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Text
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                            Value            = "Total price"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "4"
                                        },
                                    }
                                },
                            }
                        },
                        new InputFieldset
                        {
                            Code        = "OrderFooterActions",
                            InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                            InputFields = new List <InputField>()
                            {
                                new InputField
                                {
                                    Code            = "Save",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Button
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                            Value            = "Save"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                            Value            = "btn btn-success"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "3"
                                        },
                                    }
                                },
                                new InputField
                                {
                                    Code            = "Cancel",
                                    Characteristics = new List <InputFieldCharacteristic>()
                                    {
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                            Value            = FieldTypes.Button
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                            Value            = "Cancel"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                            Value            = "btn btn-primary"
                                        },
                                        new InputFieldCharacteristic
                                        {
                                            CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                            Value            = "2"
                                        },
                                    }
                                },
                            }
                        },
                        new InputFieldset
                        {
                            Code        = "CategoryHeader",
                            InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id
                        },
                    }
                },
            });
        }
Exemple #21
0
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <AngularComponent>()
     {
         new AngularComponent
         {
             Code           = AngularComponents.ListOrderAdminComponent,
             InputFieldsets = new List <InputFieldset>()
             {
                 new InputFieldset
                 {
                     Code        = "OrderPagination",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Pagination",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Pagination
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.UrlQuery).Id,
                                     Value            = "page"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Parameter).Id,
                                     Value            = "{ \"firstText\": \"First\", \"lastText\": \"Last\", \"previousText\": \"Previous\", \"nextText\": \"Next\" }"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "PageSize",
                             Value           = "12",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Dropdown
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.UrlQuery).Id,
                                     Value            = "pagesize"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Parameter).Id,
                                     Value            = "{ \"items\": [ { \"value\": 1, \"text\": \"Items per page\", \"isHeader\": true }, { \"value\": 6, \"text\": \"6\", \"isHeader\": false }, { \"value\": 12, \"text\": \"12\", \"isHeader\": false }, { \"value\": 24, \"text\": \"24\", \"isHeader\": false }, { \"value\": 36, \"text\": \"36\", \"isHeader\": false } ] }"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                     Value            = "pagination-button"
                                 },
                             }
                         },
                     }
                 },
                 new InputFieldset
                 {
                     Code        = "OrderHeaderLeft",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "OrderId",
                             Characteristics = new List <InputFieldCharacteristic>
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Textbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Order id"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                     Value            = HtmlTypes.Number
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.UrlQuery).Id,
                                     Value            = "filteroderid"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "1"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "BillingName",
                             Characteristics = new List <InputFieldCharacteristic>
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Textbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Billing name"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.UrlQuery).Id,
                                     Value            = "filterbillingname"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "2"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "BillingLastName",
                             Characteristics = new List <InputFieldCharacteristic>
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Textbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Billing last name"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.UrlQuery).Id,
                                     Value            = "filterbillinglastname"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "3"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "BillingEmail",
                             Characteristics = new List <InputFieldCharacteristic>
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Textbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Billing email"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.UrlQuery).Id,
                                     Value            = "filterbillingemail"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "4"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "SubmitSearch",
                             Characteristics = new List <InputFieldCharacteristic>
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Button
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Search"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                     Value            = "btn btn-primary"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "5"
                                 },
                             }
                         },
                     }
                 },
                 new InputFieldset
                 {
                     Code        = "OrderHeaderRight",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     InputFields = new List <InputField>()
                     {
                     }
                 },
                 new InputFieldset
                 {
                     Code        = "PrimaryTableHeader",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Id",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Order #"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "1"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "OrderStatus",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Order Status"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "2"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "Customer",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Customer"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "3"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "CreatedOn",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Created on"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "4"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "TotalPrice",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Total price"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "5"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "Action",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Action"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "6"
                                 },
                             }
                         },
                     }
                 },
                 new InputFieldset
                 {
                     Code        = "PrimaryTableActions",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Edit",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Button
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                     Value            = "btn btn-link"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Url).Id,
                                     Value            = "/admin/sales/orders/edit"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Edit"
                                 },
                             }
                         },
                     }
                 },
             }
         },
     });
 }
        public static void Seed <TDbContet>(TDbContet dbContext)
            where TDbContet : DbContext
        {
            DatabaseSeedExtensions.AddSeeds(dbContext, new List <Route>()
            {
                new Route
                {
                    AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.SubCategoryComponent).Id,
                    Title       = "Vartotojo sąsaja",
                    Url         = "vartotojas",
                    InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
                    Parameter   = DatabaseSeedCodes.ClientUser,
                    Category    = new Category
                    {
                        CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.TopUser).Id,
                        ParentId        = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.Home).Id,
                        Characteristics = new List <CategoryCharacteristic>()
                        {
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                Value            = "Vartotojo sąsaja"
                            },
                        }
                    },
                },
            });

            DatabaseSeedExtensions.AddSeeds(dbContext, new List <Route>()
            {
                new Route
                {
                    AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.LoginComponent).Id,
                    Title       = "Prisijungimas",
                    Url         = "Prisijungimas",
                    InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
                    Category    = new Category
                    {
                        CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.TopUser).Id,
                        ParentId        = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.ClientUser).Id,
                        Characteristics = new List <CategoryCharacteristic>()
                        {
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                Value            = "Prisijungimas"
                            },
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.AccessLevel).Id,
                                Value            = AccessLevels.OnlyGuest
                            },
                        }
                    },
                },
                new Route
                {
                    AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.RegistrationComponent).Id,
                    Title       = "Registracija",
                    Url         = "registracija",
                    InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
                    Category    = new Category
                    {
                        CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.TopUser).Id,
                        ParentId        = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.ClientUser).Id,
                        Characteristics = new List <CategoryCharacteristic>()
                        {
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                Value            = "Registracija"
                            },
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.AccessLevel).Id,
                                Value            = AccessLevels.OnlyGuest
                            },
                        },
                    },
                },
                new Route
                {
                    AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.ProfileComponent).Id,
                    Title       = "Profilis",
                    Url         = "profilis",
                    InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
                    Category    = new Category
                    {
                        CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.TopUser).Id,
                        ParentId        = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.ClientUser).Id,
                        Characteristics = new List <CategoryCharacteristic>()
                        {
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                Value            = "Profilis"
                            },
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.AccessLevel).Id,
                                Value            = AccessLevels.OnlyAuthenticated
                            },
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                Value            = "2"
                            },
                        },
                    },
                },
                new Route
                {
                    AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.BasketComponent).Id,
                    Title       = "Krepšelis",
                    Url         = "krepselis",
                    InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
                    Category    = new Category
                    {
                        CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.TopUser).Id,
                        ParentId        = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.ClientUser).Id,
                        Characteristics = new List <CategoryCharacteristic>()
                        {
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                Value            = "Krepšelis"
                            },
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.AccessLevel).Id,
                                Value            = AccessLevels.OnlyAuthenticated
                            },
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                Value            = "1"
                            },
                        },
                    },
                },
                new Route
                {
                    AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.OrderComponent).Id,
                    Title       = "Atsiskaitymas",
                    Url         = "atsiskaitymas",
                    InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
                    Category    = new Category
                    {
                        CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.Hidden).Id,
                        ParentId        = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.ClientUser).Id,
                        Characteristics = new List <CategoryCharacteristic>()
                        {
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                Value            = "Atsiskaitymas"
                            },
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.AccessLevel).Id,
                                Value            = AccessLevels.OnlyAuthenticated
                            },
                        },
                    },
                },
                new Route
                {
                    AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.LogoutComponent).Id,
                    Title       = "Atsijungti",
                    Url         = "atsijungti",
                    InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
                    Category    = new Category
                    {
                        CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.TopUser).Id,
                        ParentId        = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.ClientUser).Id,
                        Characteristics = new List <CategoryCharacteristic>()
                        {
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                Value            = "Atsijungti"
                            },
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.AccessLevel).Id,
                                Value            = AccessLevels.OnlyAuthenticated
                            },
                            new CategoryCharacteristic
                            {
                                CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                Value            = "3"
                            },
                        },
                    },
                },
            });
        }
Exemple #23
0
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <AngularComponent>()
     {
         new AngularComponent
         {
             Code           = AngularComponents.HomeComponent,
             InputFieldsets = new List <InputFieldset>()
             {
                 new InputFieldset
                 {
                     Code        = "BaseProductCategoryHeader",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Sorting",
                             Value           = "0",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Dropdown
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Parameter).Id,
                                     Value            = "{ \"items\": [ { \"value\": \"0\", \"text\": \"Rikiavimas\", \"isHeader\": true }, { \"value\": \"Price\", \"text\": \"Pigiausi viršuje\", \"isHeader\": false }, { \"value\": \"-Price\", \"text\": \"Brangiausi viršuje\", \"isHeader\": false }, { \"value\": \"Characteristics+Name\", \"text\": \"A-Ž (pagal abėcelę)\", \"isHeader\": false }, { \"value\": \"-Characteristics+Name\", \"text\": \"Ž-A (pagal abėcelę)\", \"isHeader\": false } ] }"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.UrlQuery).Id,
                                     Value            = "sorting"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "PageSize",
                             Value           = "36",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Dropdown
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Parameter).Id,
                                     Value            = "{ \"items\": [ { \"value\": 1, \"text\": \"Rodyti po\", \"isHeader\": true }, { \"value\": 12, \"text\": \"12\", \"isHeader\": false }, { \"value\": 24, \"text\": \"24\", \"isHeader\": false }, { \"value\": 36, \"text\": \"36\", \"isHeader\": false } ] }"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.UrlQuery).Id,
                                     Value            = "pagesize"
                                 },
                             }
                         },
                     }
                 },
                 new InputFieldset
                 {
                     Code        = "CategoryPagination",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Pagination",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Pagination
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Parameter).Id,
                                     Value            = "{ \"firstText\": \"Pirmas\", \"lastText\": \"Paskutinis\", \"previousText\": \"Ankstesnis\", \"nextText\": \"Sekantis\" }"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.UrlQuery).Id,
                                     Value            = "page"
                                 },
                             }
                         },
                     }
                 },
             }
         },
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <AngularComponent>()
     {
         new AngularComponent
         {
             Code           = AngularComponents.ListProductAdminComponent,
             InputFieldsets = new List <InputFieldset>()
             {
                 new InputFieldset
                 {
                     Code        = "CategoryPagination",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Pagination",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Pagination
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.UrlQuery).Id,
                                     Value            = "page"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Parameter).Id,
                                     Value            = "{ \"firstText\": \"First\", \"lastText\": \"Last\", \"previousText\": \"Previous\", \"nextText\": \"Next\" }"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "PageSize",
                             Value           = "12",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Dropdown
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.UrlQuery).Id,
                                     Value            = "pagesize"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Parameter).Id,
                                     Value            = "{ \"items\": [ { \"value\": 1, \"text\": \"Items per page\", \"isHeader\": true }, { \"value\": 12, \"text\": \"12\", \"isHeader\": false }, { \"value\": 24, \"text\": \"24\", \"isHeader\": false }, { \"value\": 36, \"text\": \"36\", \"isHeader\": false } ] }"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                     Value            = "pagination-button"
                                 },
                             }
                         },
                     }
                 },
                 new InputFieldset
                 {
                     Code        = "CategoryHeaderLeft",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Search",
                             Characteristics = new List <InputFieldCharacteristic>
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Searchbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.UrlQuery).Id,
                                     Value            = "filtername"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Placeholder).Id,
                                     Value            = "Search for product"
                                 },
                             }
                         },
                     }
                 },
                 new InputFieldset
                 {
                     Code        = "CategoryHeaderRight",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Create",
                             Characteristics = new List <InputFieldCharacteristic>
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Button
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Add New"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                     Value            = "btn btn-primary float-right"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Url).Id,
                                     Value            = "/admin/catalog/products/edit"
                                 },
                             }
                         },
                     }
                 },
                 new InputFieldset
                 {
                     Code        = "PrimaryTableHeader",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Name",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Name"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "IsPublished",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Published"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "Action",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Action"
                                 },
                             }
                         },
                     }
                 },
                 new InputFieldset
                 {
                     Code        = "PrimaryTableActions",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Edit",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Button
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                     Value            = "btn btn-link"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Url).Id,
                                     Value            = "/admin/catalog/products/edit"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Edit"
                                 },
                             }
                         },
                     }
                 },
             }
         },
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <Route>()
     {
         new Route
         {
             AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.ProductComponent).Id,
             Title       = "Bloknotai eskizams AUTHENTIC Brown A5 80 lapų",
             Url         = "bloknotai-eskizams-authentic-brown-a5-80-lapu",
             InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
             Product     = new Product
             {
                 CategoryId = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.NoteBooks).Id,
                 Price      = 2.54M,
                 Images     = new List <Image>()
                 {
                     new Image
                     {
                         ImageSizeTypeId = dbContext.Set <ImageSizeType>().FirstOrDefault(o => o.Code == ImageSizeTypes.Small).Id,
                         Url             = "bloknotai-eskizams-authentic-brown-a5-80-lapu-1.png"
                     },
                     new Image
                     {
                         ImageSizeTypeId = dbContext.Set <ImageSizeType>().FirstOrDefault(o => o.Code == ImageSizeTypes.Big).Id,
                         Url             = "bloknotai-eskizams-authentic-brown-a5-80-lapu-HD1.png"
                     },
                 },
                 Characteristics = new List <ProductCharacteristic>()
                 {
                     new ProductCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Description).Id,
                         Translations     = new List <ProductCharacteristicTranslation>()
                         {
                             new ProductCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                 Value      = "<P class=MsoNormal style='MARGIN: 0cm 0cm 8pt'><SPAN style='FONT-SIZE: 12pt; BACKGROUND: white; COLOR: #333333; LINE-HEIGHT: 107%; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-ansi-language: LT'><FONT face=Calibri> <H2>Bloknotas eskizams AUTHENTIC Brown A4 80 lapų</H2></FONT></SPAN> <P></P> <P class=MsoNormal style='MARGIN: 0cm 0cm 8pt'><SPAN style='FONT-SIZE: 12pt; BACKGROUND: white; COLOR: #333333; LINE-HEIGHT: 107%; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-ansi-language: LT'><FONT face=Calibri>Bloknotas eskizams – nepamainomas pagalbininkas kuriant bet kokį meno kūrinį. Juk eskizuose dažniausiai nugula pačios gražiausios idėjos – pamirškite išmėtytus lapelius ir popierėlius ir griebkitės bloknoto, kuriame darbai niekad nepasimes ir atrodys kur kas tvarkingiau. A4 formatas idealus profesionalams, bet puikiai tiks ir mėgėjams, rimtai žiūrintiems į dailę. Bloknotas įrištas spirale ir turi mikro perforaciją – nė vienas eskizas nebus sugadintas bandant jį išplėšti. Bloknotas apsaugotas kieta nugarėle, tad jį patogu nešiotis, puslapiai nesiglamžo. Bloknotų pakuotė susidaro iš 5 vnt. – patogu perkant mokinių grupėms, meno mokykloms. </FONT></SPAN></P> <P class=MsoNormal style='MARGIN: 0cm 0cm 8pt'><SPAN style='FONT-SIZE: 12pt; BACKGROUND: white; COLOR: #333333; LINE-HEIGHT: 107%; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-ansi-language: LT'><FONT face=Calibri><STRONG>Trumpa bloknoto&nbsp;specifikacija:<?xml:namespace prefix = 'o' ns = 'urn:schemas-microsoft-com:office:office' /><o:p></o:p></STRONG></FONT></SPAN></P> <P class=MsoListParagraphCxSpFirst style='MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1'><SPAN style='FONT-SIZE: 12pt; FONT-FAMILY: Symbol; LINE-HEIGHT: 107%; mso-ansi-language: LT; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol'><SPAN style='mso-list: Ignore'>·<SPAN style='FONT: 7pt 'Times New Roman''>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri><SPAN style='FONT-SIZE: 12pt; BACKGROUND: white; COLOR: #333333; LINE-HEIGHT: 107%; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-ansi-language: LT'>A4, 135 gsm, 80 lapų (rudo kraftinio popieriaus) </SPAN><SPAN style='FONT-SIZE: 12pt; LINE-HEIGHT: 107%; mso-ansi-language: LT'><o:p></o:p></SPAN></FONT></P> <P class=MsoListParagraphCxSpMiddle style='MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1'><SPAN style='FONT-SIZE: 12pt; FONT-FAMILY: Symbol; LINE-HEIGHT: 107%; mso-ansi-language: LT; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol'><SPAN style='mso-list: Ignore'>·<SPAN style='FONT: 7pt 'Times New Roman''>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri><SPAN style='FONT-SIZE: 12pt; BACKGROUND: white; COLOR: #333333; LINE-HEIGHT: 107%; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-ansi-language: LT'>su mikro perforacija</SPAN><SPAN style='FONT-SIZE: 12pt; LINE-HEIGHT: 107%; mso-ansi-language: LT'><o:p></o:p></SPAN></FONT></P> <P class=MsoListParagraphCxSpLast style='MARGIN: 0cm 0cm 8pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1'><SPAN style='FONT-SIZE: 12pt; FONT-FAMILY: Symbol; LINE-HEIGHT: 107%; mso-ansi-language: LT; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol'><SPAN style='mso-list: Ignore'>·<SPAN style='FONT: 7pt 'Times New Roman''>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style='FONT-SIZE: 12pt; BACKGROUND: white; COLOR: #333333; LINE-HEIGHT: 107%; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-ansi-language: LT'><FONT face=Calibri>kieta nugarėlė, trumpa spiralė viršuje</FONT></SPAN><SPAN style='FONT-SIZE: 12pt; LINE-HEIGHT: 107%; mso-ansi-language: LT'><o:p></o:p></SPAN></P>"
                             }
                         }
                     },
                     new ProductCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                         Translations     = new List <ProductCharacteristicTranslation>()
                         {
                             new ProductCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                 Value      = "Bloknotai eskizams AUTHENTIC Brown A5 80 lapų"
                             },
                             new ProductCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                                 Value      = "Notebook AUTHENTIC Brown A5 80 pages"
                             }
                         }
                     },
                     new ProductCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsShowHomePage).Id,
                         Value            = "true"
                     },
                 }
             }
         },
         new Route
         {
             AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.ProductComponent).Id,
             Title       = "Bloknotas Kreska A7 50 lapų langeliais",
             Url         = "bloknotas-kreska-a7-50-lapu-langeliais",
             InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
             Product     = new Product
             {
                 CategoryId = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.NoteBooks).Id,
                 Price      = 0.58M,
                 Images     = new List <Image>()
                 {
                     new Image
                     {
                         ImageSizeTypeId = dbContext.Set <ImageSizeType>().FirstOrDefault(o => o.Code == ImageSizeTypes.Small).Id,
                         Url             = "bloknotas-kreska-a7-50-lapu-langeliais-1.png"
                     },
                     new Image
                     {
                         ImageSizeTypeId = dbContext.Set <ImageSizeType>().FirstOrDefault(o => o.Code == ImageSizeTypes.Big).Id,
                         Url             = "bloknotas-kreska-a7-50-lapu-langeliais-HD1.png"
                     },
                     new Image
                     {
                         ImageSizeTypeId = dbContext.Set <ImageSizeType>().FirstOrDefault(o => o.Code == ImageSizeTypes.Small).Id,
                         Url             = "bloknotas-kreska-a7-50-lapu-langeliais-2.png"
                     },
                     new Image
                     {
                         ImageSizeTypeId = dbContext.Set <ImageSizeType>().FirstOrDefault(o => o.Code == ImageSizeTypes.Big).Id,
                         Url             = "bloknotas-kreska-a7-50-lapu-langeliais-HD2.png"
                     },
                 },
                 ProductDetails = new List <ProductDetail>()
                 {
                     new ProductDetail
                     {
                         ProductDetailTypeId = dbContext.Set <ProductDetailType>().FirstOrDefault(o => o.Code == ProductDetailTypes.ColorId).Id,
                         Value           = "#9c6baf",
                         Characteristics = new List <ProductDetailCharacteristic>()
                         {
                             new ProductDetailCharacteristic
                             {
                                 CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                 Translations     = new List <ProductDetailCharacteristicTranslation>()
                                 {
                                     new ProductDetailCharacteristicTranslation()
                                     {
                                         LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                         Value      = "Purpurinis"
                                     },
                                     new ProductDetailCharacteristicTranslation()
                                     {
                                         LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                                         Value      = "Purple"
                                     }
                                 }
                             },
                         }
                     },
                     new ProductDetail
                     {
                         ProductDetailTypeId = dbContext.Set <ProductDetailType>().FirstOrDefault(o => o.Code == ProductDetailTypes.ColorId).Id,
                         Value           = "#f63294",
                         Characteristics = new List <ProductDetailCharacteristic>()
                         {
                             new ProductDetailCharacteristic
                             {
                                 CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                 Translations     = new List <ProductDetailCharacteristicTranslation>()
                                 {
                                     new ProductDetailCharacteristicTranslation()
                                     {
                                         LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                         Value      = "Rožinis"
                                     },
                                     new ProductDetailCharacteristicTranslation()
                                     {
                                         LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                                         Value      = "Pink"
                                     }
                                 }
                             }
                         }
                     }
                 },
                 Characteristics = new List <ProductCharacteristic>()
                 {
                     new ProductCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Description).Id,
                         Translations     = new List <ProductCharacteristicTranslation>()
                         {
                             new ProductCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                 Value      = "<P class=MsoNormal style='MARGIN: 0cm 0cm 10pt'> <H2>Bloknotas Kreska A7 50 lapų langeliais</H2> <P></P> <P class=MsoNormal style='MARGIN: 0cm 0cm 10pt'><FONT size=3><FONT face='Times New Roman'>Jeigu turite labai daug minčių arba kiekvieną dieną turite atlikti begalią darbų, kurie dažnai pasimiršta – bloknotas Kreska kiekvieną dieną turėtų būti Jūsų kišenėje! Nesvarbu, ar esate moksleivis, ar studentas, ar samdomas darbuotojas, ar verslininkas – jeigu visos Jūsų mintys bus užrašytos ant lapelio – kur kas lengviau atsiminsite kada ir ką turite padaryti.<?xml:namespace prefix = 'o' ns = 'urn:schemas-microsoft-com:office:office' /><o:p></o:p></FONT></FONT></P> <P class=MsoNormal style='MARGIN: 0cm 0cm 10pt'><FONT size=3 face='Times New Roman'>Bloknotas yra nedidelis, taigi puikiai telpa į kišenę. Įsigijus kartu ir tušinuką – kad ir kur būtumėte galėsite pasižymėti pačias gražiausias, įžvalgiausias ar reikalingiausias mintis. Svarbiausia, kad šio bloknoto kaina yra tikrai nedidelė, taigi tai gali būti ir labai puiki dovana. Jeigu turite nustebinti didelį skaičių žmonių, tačiau finansai yra riboti – padovanokite jiems vietą, kurioje gali rašyti savo puikias mintis.</FONT><o:p></o:p></P>"
                             }
                         }
                     },
                     new ProductCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                         Translations     = new List <ProductCharacteristicTranslation>()
                         {
                             new ProductCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                 Value      = "Bloknotas Kreska A7 50 lapų langeliais"
                             },
                             new ProductCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                 Value      = "Notebook Kreska A7 50 pages"
                             }
                         }
                     },
                     new ProductCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsShowHomePage).Id,
                         Value            = "true"
                     },
                 }
             }
         },
         new Route
         {
             AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.ProductComponent).Id,
             Title       = "Lipnūs lapeliai 50x75mm NEON 100 lapų Yidoo",
             Url         = "lipnus-lapeliai-50x75mm-neon-100-lapu-yidoo",
             InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
             Product     = new Product
             {
                 CategoryId = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.StickyNotes).Id,
                 Price      = 1,
                 Discount   = 0.11M,
                 Images     = new List <Image>()
                 {
                     new Image
                     {
                         ImageSizeTypeId = dbContext.Set <ImageSizeType>().FirstOrDefault(o => o.Code == ImageSizeTypes.Small).Id,
                         Url             = "lipnus-lapeliai-50x75mm-neon-100-lapu-yidoo-1.png"
                     },
                 },
                 Characteristics = new List <ProductCharacteristic>()
                 {
                     new ProductCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Description).Id,
                         Translations     = new List <ProductCharacteristicTranslation>()
                         {
                             new ProductCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                 Value      = "<H2>Lipnūs lapeliai 50x75mm NEON 100 lapų Yidoo</H2> <P class=MsoNormal style='MARGIN: 0cm 0cm 10pt'><FONT size=3><FONT face='Times New Roman'>XX amžiaus antroje pusėje buvo atrasti greitai limpantys klijai, kurie ant paviršiaus nepalieka jokių žymių. Nieko keisto, kad jie labai greitai išpopuliarėjo ir tuo pačiu buvo panaudojami plačiau. Lipnūs lapeliai šiuo metu daugelio žmonių kasdienybės dalis.<?xml:namespace prefix = 'o' ns = 'urn:schemas-microsoft-com:office:office' /><o:p></o:p></FONT></FONT></P> <P class=MsoNormal style='MARGIN: 0cm 0cm 10pt'><FONT size=3><FONT face='Times New Roman'>S. Silver atrado klijus, kurie daug kartu limpa ir tuo pačiu yra lengvai nuklijuojami nuo bet kokio paviršiaus. Klijų išradėjo bendradarbis pastebėjo, kad klijai labai gelsti tuomet, kai reikia ant paviršiaus priklijuoti kokius nors popieriaus lapus (šiuo atveju tai buvo giesmynai klijuojami ant medinių laikiklių). Štai taip ir buvo sugalvoti lipnūs lapeliai.<o:p></o:p></FONT></FONT></P> <P class=MsoNormal style='MARGIN: 0cm 0cm 10pt'><FONT size=3 face='Times New Roman'>Tokia paprasta atsiradimo istorija ir toks paprastas daiktas, tačiau mes jį naudojame kiekvieną dieną.</FONT><o:p></o:p></P>"
                             }
                         }
                     },
                     new ProductCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                         Translations     = new List <ProductCharacteristicTranslation>()
                         {
                             new ProductCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                 Value      = "Lipnūs lapeliai 50x75mm NEON 100 lapų Yidoo"
                             },
                             new ProductCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                 Value      = "Sticky notes 50x75mm NEON 100 sheets Yidoo"
                             }
                         }
                     },
                     new ProductCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsShowHomePage).Id,
                         Value            = "true"
                     },
                 }
             }
         },
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <AngularComponent>()
     {
         new AngularComponent
         {
             Code           = AngularComponents.LoginComponent,
             InputFieldsets = new List <InputFieldset>()
             {
                 new InputFieldset
                 {
                     Code        = "Login",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Email",
                             Value           = "*****@*****.**",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Placeholder).Id,
                                     Translations     = new List <InputFieldCharacteristicTranslation>()
                                     {
                                         new InputFieldCharacteristicTranslation()
                                         {
                                             LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                                             Value      = "Email"
                                         }
                                     },
                                     Value = "Email"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                     Value            = HtmlTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequiredMessage).Id,
                                     Value            = "Required field."
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequired).Id,
                                     Value            = "true"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Textbox,
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "1",
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "Password",
                             Value           = "123123",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Placeholder).Id,
                                     Value            = "Password"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                     Value            = HtmlTypes.Password
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequiredMessage).Id,
                                     Value            = "Required field."
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequired).Id,
                                     Value            = "true"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Textbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "2"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "Login",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Login"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                     Value            = "btn btn-default"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Button
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "3"
                                 },
                             }
                         },
                     }
                 },
                 new InputFieldset
                 {
                     Code            = "Login",
                     InputFormId     = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
                     Characteristics = new List <InputFieldsetCharacteristic>()
                     {
                         new InputFieldsetCharacteristic
                         {
                             CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                             Value            = "Vartotojo duomenys"
                         },
                     },
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Email",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "El. paštas"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                     Value            = HtmlTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequiredMessage).Id,
                                     Value            = "Laukelis yra privalomas."
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequired).Id,
                                     Value            = "true"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Textbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "1"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "Password",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Slaptažodis"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                     Value            = HtmlTypes.Password
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequiredMessage).Id,
                                     Value            = "Laukelis yra privalomas."
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequired).Id,
                                     Value            = "true"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Textbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "2"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "Login",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Prisijungti"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                     Value            = "btn btn-default"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Button
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "3"
                                 },
                             }
                         },
                     }
                 },
             },
         },
     });
 }
Exemple #27
0
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <AngularComponent>()
     {
         new AngularComponent
         {
             Code           = AngularComponents.EditCategoryAdminComponent,
             InputFieldsets = new List <InputFieldset>()
             {
                 new InputFieldset
                 {
                     Code            = "CategoryInfo",
                     InputFormId     = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     Characteristics = new List <InputFieldsetCharacteristic>()
                     {
                         new InputFieldsetCharacteristic
                         {
                             CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                             Value            = "Category Info"
                         },
                     },
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Name",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Name"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                     Value            = HtmlTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Characteristic).Id,
                                     Value            = CharacteristicCodes.Name
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.ClassifierTextbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.ApiUrl).Id,
                                     Value            = "/classifier/getPhrasesByTerm"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "1"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "Description",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Description"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                     Value            = HtmlTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Characteristic).Id,
                                     Value            = CharacteristicCodes.Description
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.HtmlEditor
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "2"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "CategoryTypeCode",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                     Value            = HtmlTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Dropdown
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Category positioning type"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "3"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "ParentId",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Dropdown
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Parent Category"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "4"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "AngularComponentCode",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Dropdown
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Category Type"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequired).Id,
                                     Value            = "true"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsRequiredMessage).Id,
                                     Value            = "Very important field is required."
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "5"
                                 },
                             },
                         },
                         new InputField
                         {
                             Code            = "Order",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Textbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Order"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                     Value            = HtmlTypes.Number
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Characteristic).Id,
                                     Value            = CharacteristicCodes.Order
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "6"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "IsDisabled",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Checkbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Is Published"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Characteristic).Id,
                                     Value            = CharacteristicCodes.IsDisabled
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "7"
                                 },
                             }
                         },
                     }
                 },
                 new InputFieldset
                 {
                     Code            = "CategorySeo",
                     InputFormId     = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     Characteristics = new List <InputFieldsetCharacteristic>()
                     {
                         new InputFieldsetCharacteristic
                         {
                             CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                             Value            = "SEO"
                         },
                     },
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Title",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Meta title"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Textbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                     Value            = HtmlTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "1"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "Description",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Meta description"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Textbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                     Value            = HtmlTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "2"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "Url",
                             Value           = string.Empty,
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "SEO friendly url"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Textbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                     Value            = HtmlTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "3"
                                 },
                             }
                         },
                     }
                 },
                 new InputFieldset
                 {
                     Code            = "CategoryProducts",
                     InputFormId     = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     Characteristics = new List <InputFieldsetCharacteristic>()
                     {
                         new InputFieldsetCharacteristic
                         {
                             CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                             Value            = "Products"
                         },
                     },
                 },
                 new InputFieldset
                 {
                     Code        = "FooterActions", // CategoryFooterActions?
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Save",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Button
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Save"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                     Value            = "btn btn-success"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "3"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "Cancel",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Button
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Cancel"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                     Value            = "btn btn-primary"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "2"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "Delete",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Button
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Delete"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                     Value            = "btn btn-danger"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PopoverTitle).Id,
                                     Value            = "Are you sure?"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PopoverMessage).Id,
                                     Value            = "This action will delete all possible sub categories and category products. Are you sure you want to delete this category?"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.IsYesNoPopoverRequired).Id,
                                     Value            = "true"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Order).Id,
                                     Value            = "1"
                                 },
                             }
                         },
                     }
                 },
                 new InputFieldset
                 {
                     Code            = "CategoryAdditionalInfo",
                     InputFormId     = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     Characteristics = new List <InputFieldsetCharacteristic>()
                     {
                         new InputFieldsetCharacteristic
                         {
                             CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                             Value            = "Additional Info"
                         },
                     },
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "BreadcrumbName",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Breadcrumb Name"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                     Value            = HtmlTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Characteristic).Id,
                                     Value            = CharacteristicCodes.BreadcrumbName
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.ClassifierTextbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.ApiUrl).Id,
                                     Value            = "/classifier/getPhrasesByTerm"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "NavigationName",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Navigation Name"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.HtmlType).Id,
                                     Value            = HtmlTypes.Text
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Characteristic).Id,
                                     Value            = CharacteristicCodes.NavigationName
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.ClassifierTextbox
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.ApiUrl).Id,
                                     Value            = "/classifier/getPhrasesByTerm"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "AccessLevel",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Access Level"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Characteristic).Id,
                                     Value            = CharacteristicCodes.AccessLevel
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.FieldType).Id,
                                     Value            = FieldTypes.Dropdown
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Parameter).Id,
                                     Value            = "{ \"items\": [ { \"value\": \"" + AccessLevels.OnlyAuthenticated + "\", \"text\": \"Only for authenticated users\", \"isHeader\": false }, { \"value\": \"" + AccessLevels.OnlyGuest + "\", \"text\": \"Only for guests\", \"isHeader\": false } ] }"
                                 },
                             }
                         },
                     }
                 },
                 new InputFieldset
                 {
                     Code            = "CategoryInputFields",
                     InputFormId     = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id,
                     Characteristics = new List <InputFieldsetCharacteristic>()
                     {
                         new InputFieldsetCharacteristic
                         {
                             CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                             Value            = "UI Elements"
                         },
                     },
                 },
                 new InputFieldset
                 {
                     Code        = "CategoryHeader",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.Admin).Id
                 },
             }
         },
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <AngularComponent>()
     {
         new AngularComponent
         {
             Code           = AngularComponents.ProductComponent,
             InputFieldsets = new List <InputFieldset>()
             {
                 new InputFieldset
                 {
                     Code        = "BaseProductBody",
                     InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
                     InputFields = new List <InputField>()
                     {
                         new InputField
                         {
                             Code            = "Quantity",
                             Value           = "1",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Label).Id,
                                     Value            = "Kiekis"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.ValidateMinValueMessage).Id,
                                     Value            = "Mažiausiai į krepšelį galima įdėti {Characteristics.ValidateMinValue} prekę."
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.ValidateMaxValueMessage).Id,
                                     Value            = "Daugiausiai į krepšelį galima įdėti {Characteristics.ValidateMaxValue} prekių."
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.ValidateMinValue).Id,
                                     Value            = "1"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.ValidateMaxValue).Id,
                                     Value            = "1000"
                                 },
                             }
                         },
                         new InputField
                         {
                             Code            = "BasketAdd",
                             Characteristics = new List <InputFieldCharacteristic>()
                             {
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                     Value            = "Į krepšelį"
                                 },
                                 new InputFieldCharacteristic
                                 {
                                     CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.PrimaryCssClass).Id,
                                     Value            = "btn btn-success"
                                 },
                             }
                         },
                     }
                 },
             }
         },
     });
 }
Exemple #29
0
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <Route>()
     {
         new Route
         {
             AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.HomeComponent).Id,
             Title       = "Titulinis",
             Url         = string.Empty,
             InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
             Parameter   = DatabaseSeedCodes.Home,
             Category    = new Category
             {
                 CategoryTypeId  = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.Product).Id,
                 Characteristics = new List <CategoryCharacteristic>()
                 {
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                         Translations     = new List <CategoryCharacteristicTranslation>()
                         {
                             new CategoryCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                 Value      = "Prekių katalogas"
                             },
                             new CategoryCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                                 Value      = "Products catalog"
                             }
                         },
                     },
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.BreadcrumbName).Id,
                         Translations     = new List <CategoryCharacteristicTranslation>()
                         {
                             new CategoryCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                 Value      = "Titulinis"
                             },
                             new CategoryCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                                 Value      = "Home"
                             }
                         },
                     },
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Description).Id,
                         Translations     = new List <CategoryCharacteristicTranslation>()
                         {
                             new CategoryCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                 Value      = "<h1><center>Produktų sąrašas su charakteristiką: IsShowHomePage</center></h1>"
                             }
                         }
                     }
                 }
             },
         },
     });
 }
 public static void Seed <TDbContet>(TDbContet dbContext)
     where TDbContet : DbContext
 {
     DatabaseSeedExtensions.AddSeeds(dbContext, new List <Route>()
     {
         new Route
         {
             AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.ProductCategoryComponent).Id,
             Title       = "Bloknotai",
             Url         = "bloknotai",
             InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
             Parameter   = DatabaseSeedCodes.NoteBooks,
             Category    = new Category
             {
                 CategoryTypeId = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.Product).Id,
                 ParentId       = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.PaperProducts).Id,
                 Images         = new List <Image>()
                 {
                     new Image
                     {
                         ImageSizeTypeId = dbContext.Set <ImageSizeType>().FirstOrDefault(o => o.Code == ImageSizeTypes.Small).Id,
                         Url             = "bloknotai.png",
                         Characteristics = new List <ImageCharacteristic>()
                         {
                             new ImageCharacteristic
                             {
                                 CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                                 Translations     = new List <ImageCharacteristicTranslation>()
                                 {
                                     new ImageCharacteristicTranslation()
                                     {
                                         LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                         Value      = "Random alt tagas"
                                     },
                                     new ImageCharacteristicTranslation()
                                     {
                                         LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                                         Value      = "Random alt tag"
                                     }
                                 },
                             }
                         },
                     },
                 },
                 Characteristics = new List <CategoryCharacteristic>()
                 {
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                         Translations     = new List <CategoryCharacteristicTranslation>()
                         {
                             new CategoryCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                 Value      = "Bloknotai"
                             },
                             new CategoryCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                                 Value      = "Notebooks"
                             }
                         },
                     },
                 }
             },
         },
         new Route
         {
             AngularComponentId = dbContext.Set <AngularComponent>().FirstOrDefault(o => o.Code == AngularComponents.ProductCategoryComponent).Id,
             Title       = "Lipnūs Lapeliai",
             Url         = "lipnus-lapeliai",
             InputFormId = dbContext.Set <InputForm>().FirstOrDefault(o => o.Code == InputFormCodes.CommonInputForm).Id,
             Parameter   = DatabaseSeedCodes.StickyNotes,
             Category    = new Category
             {
                 CategoryTypeId = dbContext.Set <CategoryType>().FirstOrDefault(o => o.Code == CategoryTypes.Product).Id,
                 ParentId       = dbContext.Set <Category>().FirstOrDefault(o => o.Route.Parameter == DatabaseSeedCodes.PaperProducts).Id,
                 Images         = new List <Image>()
                 {
                     new Image
                     {
                         ImageSizeTypeId = dbContext.Set <ImageSizeType>().FirstOrDefault(o => o.Code == ImageSizeTypes.Small).Id,
                         Url             = "lipnus_lapeliai.png"
                     }
                 },
                 Characteristics = new List <CategoryCharacteristic>()
                 {
                     new CategoryCharacteristic
                     {
                         CharacteristicId = dbContext.Set <Characteristic>().FirstOrDefault(o => o.Code == CharacteristicCodes.Name).Id,
                         Translations     = new List <CategoryCharacteristicTranslation>()
                         {
                             new CategoryCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.Lithuanian).Id,
                                 Value      = "Lipnūs lapeliai"
                             },
                             new CategoryCharacteristicTranslation()
                             {
                                 LanguageId = dbContext.Set <Language>().FirstOrDefault(o => o.Code == Languages.English).Id,
                                 Value      = "Sticky notes"
                             }
                         }
                     },
                 }
             },
         },
     });
 }