Пример #1
0
        private void LoadDefaultRoles(DataKioskEntities context)
        {
            if (!context.Roles.Any())
            {
                var role = new Role {
                    Name = "Super Admin", Status = true
                };
                context.Roles.AddOrUpdate(m => m.Name, role);
                context.SaveChanges();

                role = new Role {
                    Name = "Portal Admin", Status = true
                };
                context.Roles.AddOrUpdate(m => m.Name, role);
                context.SaveChanges();

                role = new Role {
                    Name = "Bank User", Status = true
                };
                context.Roles.AddOrUpdate(m => m.Name, role);
                context.SaveChanges();

                role = new Role {
                    Name = "Bank Admin", Status = true
                };
                context.Roles.AddOrUpdate(m => m.Name, role);
                context.SaveChanges();

                //role = new Role { Name = "*", Status = true };
                //context.Roles.AddOrUpdate(m => m.Name, role);
                //context.SaveChanges();
            }
        }
Пример #2
0
        private void LoadUserTypes(DataKioskEntities context)
        {
            if (!context.UserTypes.Any())
            {
                var userType = new UserType {
                    Name = "EpayPlus"
                };
                context.UserTypes.AddOrUpdate(m => m.Name, userType);
                context.SaveChanges();

                userType = new UserType {
                    Name = "Organization"
                };
                context.UserTypes.AddOrUpdate(m => m.Name, userType);
                context.SaveChanges();
            }
        }
Пример #3
0
 private void LoadDefaultOrganization(DataKioskEntities context)
 {
     if (!context.Organizations.Any())
     {
         var organization = new Organization
         {
             Name                = "UBA",
             Address             = "UBA House Leventis",
             Email               = "*****@*****.**",
             PhoneNumber         = "08034000000",
             RegisteredByUserId  = 1,
             TimeStampRegistered = DateTime.Now,
             Status              = 1
         };
         context.Organizations.AddOrUpdate(m => m.Name, organization);
         context.SaveChanges();
     }
 }
Пример #4
0
        private void ProcessStateLookUps(DataKioskEntities context)
        {
            try
            {
                if (!context.States.Any())
                {
                    var state = new State {
                        Name = "Abia"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Adamawa"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Anambra"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Akwa Ibom"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Bauchi"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Bayelsa"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Benue"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Borno"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Cross River"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Delta"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Ebonyi"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Enugu"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Edo"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Ekiti"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Gombe"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Imo"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Jigawa"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Kaduna"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Kano"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Katsina"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Kebbi"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Kogi"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Kwara"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Lagos"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Nasarawa"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Niger"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Ogun"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Ondo"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Osun"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Oyo"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Plateau"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Rivers"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Sokoto"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Taraba"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "Yobe"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();

                    state = new State {
                        Name = "FCT Abuja"
                    };
                    context.States.AddOrUpdate(m => m.Name, state);
                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                BugManager.LogApplicationBug(ex.StackTrace, ex.Source, ex.Message);
            }
        }