Esempio n. 1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new v3xContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <v3xContext> >()))
            {
                // Look for any movies.
                if (context.People.Any())
                {
                    return;   // DB has been seeded
                }

                context.People.AddRange(
                    new People
                {
                    Name        = "Lee Keen Shen",
                    Password    = "******",
                    Email       = "*****@*****.**",
                    Role        = "superadmin",
                    Tel         = "016-5654444",
                    Nationality = "Malaysian",
                    DateOfBirth = "01/02/1950",
                    Address     = "Ipoh Perak"
                },
                    new People
                {
                    Name        = "CS",
                    Password    = "******",
                    Email       = "*****@*****.**",
                    Role        = "admin",
                    Tel         = "016-999999",
                    Nationality = "Malaysian",
                    DateOfBirth = "31/02/2030",
                    Address     = "Penang"
                },
                    new People
                {
                    Name        = "yen ping",
                    Password    = "******",
                    Email       = "*****@*****.**",
                    Role        = "employee",
                    Tel         = "016-111111",
                    Nationality = "Malaysian",
                    DateOfBirth = "01/02/1888",
                    Address     = "Johor Tebrau"
                }


                    );
                context.SaveChanges();
            }
        }
 public AdminController(ILogger <AdminController> logger, v3xContext context)
 {
     _logger  = logger;
     _context = context;
 }
Esempio n. 3
0
 public EmployeeController(ILogger <EmployeeController> logger, v3xContext context)
 {
     _logger  = logger;
     _context = context;
 }
Esempio n. 4
0
 public HomeController(ILogger <HomeController> logger, v3xContext context)
 {
     _logger  = logger;
     _context = context;
 }
Esempio n. 5
0
 public SuperadminController(ILogger <SuperadminController> logger, v3xContext context)
 {
     _logger  = logger;
     _context = context;
 }
Esempio n. 6
0
 public PeopleController(v3xContext context)
 {
     _context = context;
 }