Example #1
0
        private static void InitCustomers(AppContext context)
        {
            var customer = new Customer()
            {
                UserName = "******",
                Email = "*****@*****.**",
                Password = "******",

                FirstName = "unigo",
                LastName = "unigo",
                Active = true,
                Deleted = false,
                CreatedOnUtc = DateTime.UtcNow,
                LastActivityDateUtc = DateTime.UtcNow
            };

            if (context.Set<Customer>().Any())
                return;

            var customrole = context.Set<CustomerRole>().FirstOrDefault(x => x.SystemName == "Admin");

            customer.CustomerRoles.Add(customrole);

            context.Set<Customer>().AddOrUpdate(customer);

            context.SaveChanges();
        }
Example #2
0
        private static void InitCustomers(AppContext context)
        {
            var customer = new Customer()
            {
                CompanyName = "My Rental Pos",
                Email = "*****@*****.**",
                //Password = "******",
                FirstName = "Guest",
                LastName = "User",
                StoreId=1,
                ZipCode = "",
                Address = "",
                City = "",
                PhoneNumber = "",
                State = "",
                CreatedDate = DateTime.UtcNow
            };

            if (context.Set<Customer>().Any())
                return;

            context.Set<Customer>().AddOrUpdate(customer);

            context.SaveChanges();
        }
Example #3
0
 private static void InitEmailAccount(AppContext context)
 {
     var settings = new List<EmailAccount>
                        {
                            new EmailAccount
                                {
                                    DisplayName = "Tool Depot",
                                    Email = "*****@*****.**",
                                    Host = "127.0.0.1",
                                    Port = 25,
                                    EnableSsl = false,
                                    IsDefault = true,
                                    Username = "******",
                                    Password = "******",
                                    UseDefaultCredentials = true
                                }
                        };
     if (!context.Set<EmailAccount>().Any())
     {
         settings.ForEach(x => context.Set<EmailAccount>().Add(x));
     }
     context.SaveChanges();
 }
Example #4
0
        private static void InitPermissions(AppContext context)
        {
            var settings = new List<PermissionRecord>
                               {
                                   new PermissionRecord
                                       {
                                           Name = "Access admin area",
                                           SystemName = "AccessAdminPanel",
                                           Category = "Standard"
                                       }
                               };
            if (!context.Set<PermissionRecord>().Any())
            {
                settings.ForEach(x => context.Set<PermissionRecord>().Add(x));
            }

            context.SaveChanges();
        }
Example #5
0
 private static void InitScheduleTask(AppContext context)
 {
     var settings = new List<ScheduleTask>
                        {
                            new ScheduleTask
                                {
                                    Name = "Send Emails",
                                    Seconds = 60,
                                    Type = "ToolDepot.Services.Email.QueuedMessagesSendTask, ToolDepot",
                                    Enabled = true,
                                    StopOnError = false,
                                    LastStartUtc = null,
                                    LastEndUtc = null,
                                    LastSuccessUtc = null
                                },
                            new ScheduleTask
                                {
                                    Name = "Keep alive",
                                    Seconds = 300,
                                    Type = "ToolDepot.Services.Common.KeepAliveTask, ToolDepot",
                                    Enabled = true,
                                    StopOnError = false,
                                    LastStartUtc = null,
                                    LastEndUtc = null,
                                    LastSuccessUtc = null
                                }
                        };
     if (!context.Set<ScheduleTask>().Any())
     {
         settings.ForEach(x => context.Set<ScheduleTask>().Add(x));
     }
     context.SaveChanges();
 }
Example #6
0
        private static void InitRoles(AppContext context)
        {
            var settings = new List<CustomerRole>
                               {
                                   new CustomerRole
                                       {
                                           Id = 1,
                                           Name = "Tool Depot Admin",
                                           Active = true,
                                           IsSystemRole = true,
                                           SystemName = "Admin",
                                           IsGlobal = true
                                       }
                               };
            if (!context.Set<CustomerRole>().Any(x => x.SystemName == SystemCustomerRoleNames.Admin))
            {
                settings.ForEach(x => context.Set<CustomerRole>().AddOrUpdate(x));

            }
            context.SaveChanges();
        }
Example #7
0
 private static void InitEmployee(AppContext context)
 {
     var settings = new List<Employee>
                        {
                            new Employee
                                {
                                    StoreId = 1,
                                    UserName = "******",
                                    Active = true,
                                    CreatedDate = DateTime.UtcNow,
                                    Email = "*****@*****.**",
                                    FirstName = "John",
                                    LastName = "Smith",
                                    LastActivityDateUtc = DateTime.UtcNow,
                                    LastLoginDateUtc = DateTime.UtcNow,
                                    Password = "******"
                                }
                        };
     if (!context.Set<Employee>().Any())
     {
         settings.ForEach(x=>context.Set<Employee>().AddOrUpdate(x));
     }
     context.SaveChanges();
 }
Example #8
0
 private static void InitStore(AppContext context)
 {
     var settings = new List<Store>
                        {
                            new Store
                                {
                                    BaseUrl = "http://*****:*****@gmail.com",
                                    StoreName = "My Rental Pos",
                                    IsActive = true,
                                    Image = "",
                                    IsGlobal = true,
                                    LogOutUrl = "http://localhost:53646",
                                    Owner = "Zeeshan Raja",
                                    CreatedDate = DateTime.UtcNow
                                }
                        };
     if (!context.Set<Store>().Any())
     {
         settings.ForEach(x => context.Set<Store>().Add(x));
     }
     context.SaveChanges();
 }