Exemplo n.º 1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                // Look for any movies.

                if (context.Canteen.Any())
                {
                    return;   // DB has been seeded
                }
                context.Canteen.AddRange(
                    new Canteen
                {
                    Name = "nabuy",

                    Email = "*****@*****.**",

                    Line = "tee29909",
                    Call = "0805694931",

                    Status            = "Open",
                    Canteen_CompanyID = 1
                }
                    );
                context.SaveChanges();
                /*---------------------------------*/
            }
        }
Exemplo n.º 2
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                // Look for any movies.

                if (context.Company.Any())
                {
                    return;   // DB has been seeded
                }

                context.Company.AddRange(
                    new Company
                {
                    CompanyName = "Tbkk",
                    Image       = "Emp1.jpg",
                    Status      = "Open"
                }
                    );



                context.SaveChanges();
            }
        }
Exemplo n.º 3
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                if (context.LineToken.Any())
                {
                    return;   // DB has been seeded
                }


                context.LineToken.AddRange(
                    new LineToken
                {
                    TokenCar          = "YGWdtLg5mavVWPlBmU0CT2WcZspAguWgZljx7FXBIEk",
                    TokenFood         = "gpLcFbnpq8RcdSP67A4vFdZMKlfz9vBDlI0IVB2TsXV",
                    Company_CompanyID = 1
                }
                    );



                context.SaveChanges();
            }
        }
Exemplo n.º 4
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                // Look for any movies.

                if (context.Location.Any())
                {
                    return;   // DB has been seeded
                }

                context.Location.AddRange(
                    new Location
                {
                    LocationName = "2t30",
                    Note         = "note",
                    Status       = "Open"
                }
                    );

                context.SaveChanges();
                /*---------------------------------*/
            }
        }
Exemplo n.º 5
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                // Look for any movies.

                if (context.EmployeeType.Any())
                {
                    return;   // DB has been seeded
                }


                context.EmployeeType.AddRange(
                    new EmployeeType
                {
                    EmployeeTypeName = "Full Time"
                }
                    );
                context.EmployeeType.AddRange(
                    new EmployeeType
                {
                    EmployeeTypeName = "Part Time"
                }
                    );



                context.SaveChanges();
                /*---------------------------------*/
            }
        }
Exemplo n.º 6
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            var date = DateTime.Now;

            date = new DateTime(date.Year, date.Month, date.Day);
            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                context.OT.AddRange(
                    new OT
                {
                    TimeStart    = new DateTime(date.Year, date.Month, date.Day, 8, 0, 0),
                    TimeEnd      = new DateTime(date.Year, date.Month, date.Day, 15, 0, 0),
                    date         = new DateTime(date.Year, date.Month, date.Day, 0, 0, 0),
                    TypeOT       = date.ToString("dddd", new CultureInfo("en-US")),
                    TypStatus    = "Open",
                    OT_CompanyID = 1
                }
                    );

                context.SaveChanges();
            }



            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                var OT = context.OT.FirstOrDefault(e => e.date == date);



                for (int j = 1; j <= 20; j++)
                {
                    int      random = new Random().Next(1, 3);
                    DateTime Start  = (!((int)OT.date.DayOfWeek == 0 || (int)OT.date.DayOfWeek == 6)) ? new DateTime(OT.date.Year, OT.date.Month, OT.date.Day, 17, 0, 0) : new DateTime(OT.date.Year, OT.date.Month, OT.date.Day, 8, 0, 0);
                    DateTime End    = (!((int)OT.date.DayOfWeek == 0 || (int)OT.date.DayOfWeek == 6)) ? new DateTime(OT.date.Year, OT.date.Month, OT.date.Day, 20, 0, 0) : (random % 2 == 0) ? new DateTime(OT.date.Year, OT.date.Month, OT.date.Day, 17, 0, 0) : new DateTime(OT.date.Year, OT.date.Month, OT.date.Day, 20, 0, 0);
                    context.DetailOT.AddRange(
                        new DetailOT
                    {
                        TimeStart              = Start,
                        TimeEnd                = End,
                        Hour                   = End - Start,
                        Type                   = (!((int)OT.date.DayOfWeek == 0 || (int)OT.date.DayOfWeek == 6)) ? "Back" : (random == 1) ? "Go" : (random == 2) ? "Back" : "Go and Back",
                        Status                 = "Allow",
                        Point_PointID          = new Random().Next(2, 6),
                        FoodSet_FoodSetID      = new Random().Next(2, 4),
                        OT_OTID                = OT.OTID,
                        Employee_EmpID         = j,
                        Employee_UserAdd_EmpID = 20
                    }
                        );
                }

                context.SaveChanges();
            }
        }
Exemplo n.º 7
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                // Look for any movies.

                if (context.Part.Any())
                {
                    return;   // DB has been seeded
                }



                context.Part.AddRange(
                    new Part
                {
                    Name  = "No",
                    Price = 0,
                }
                    );


                context.Part.AddRange(
                    new Part
                {
                    Name  = "บางแสน",
                    Price = 200,
                }
                    );

                context.Part.AddRange(
                    new Part
                {
                    Name  = "พัทยา",
                    Price = 500,
                }
                    );

                context.Part.AddRange(
                    new Part
                {
                    Name  = "บ่านบึง",
                    Price = 400,
                }
                    );

                context.Part.AddRange(
                    new Part
                {
                    Name  = "พนัสนิคม",
                    Price = 100,
                }
                    );

                context.SaveChanges();
            }
        }
Exemplo n.º 8
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                // Look for any movies.

                if (context.Department.Any())
                {
                    return;   // DB has been seeded
                }

                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Information Technology",
                    Image          = "Emp1.jpg",
                    Status         = "open"
                }
                    );
                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Production Department",
                    Image          = "Emp1.jpg",
                    Status         = "open"
                }
                    );
                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Sales Department",
                    Image          = "Emp1.jpg",
                    Status         = "open"
                }
                    );
                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Accounting Department",
                    Image          = "Emp1.jpg",
                    Status         = "open"
                }
                    );
                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Human Resource",
                    Image          = "Emp1.jpg",
                    Status         = "open"
                }
                    );

                context.SaveChanges();
                /*---------------------------------*/
            }
        }
Exemplo n.º 9
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                // Look for any movies.

                if (context.Position.Any())
                {
                    return;   // DB has been seeded
                }



                context.Position.AddRange(
                    new Position
                {
                    PositionName = "admin"
                }
                    );

                context.Position.AddRange(
                    new Position
                {
                    PositionName = "Manager"
                }
                    );
                context.Position.AddRange(
                    new Position
                {
                    PositionName = "Employee"
                }
                    );
                context.Position.AddRange(
                    new Position
                {
                    PositionName = "CEO"
                }
                    );

                context.SaveChanges();
                /*---------------------------------*/
            }
        }
Exemplo n.º 10
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                if (context.Point.Any())
                {
                    return;   // DB has been seeded
                }

                var paty   = context.Part.ToList();
                var partNo = paty.FirstOrDefault(e => e.Name.Equals("No"));
                context.Point.AddRange(
                    new Point
                {
                    NamePoint    = "No",
                    Point_PartID = partNo.PartID
                }
                    );

                paty = paty.Where(e => !e.Name.Equals("No")).ToList();

                foreach (var item in paty)
                {
                    context.Point.AddRange(
                        new Point
                    {
                        NamePoint    = "aa" + item.PartID,
                        Point_PartID = item.PartID
                    }
                        );
                }



                context.SaveChanges();
            }
        }
Exemplo n.º 11
0
 public HomeModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 12
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                // Look for any movies.

                if (context.Employee.Any())
                {
                    return;   // DB has been seeded
                }

                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,
                    FirstName    = "admin",



                    LastName = "admin",

                    Gender = "male",



                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 1,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 1,

                    Position_PositionID = 1
                }
                    );



                /*222222222222222222222222222222222222222222222222222222222*/



                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,

                    FirstName = "Athena",

                    LastName = "Collins",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 5,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 1,

                    Position_PositionID = 4
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,
                    FirstName    = "Arista",

                    LastName = "Carter",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 5,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 1,

                    Position_PositionID = 4
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,
                    FirstName    = "Aria",

                    LastName = "Campbell",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 5,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 1,

                    Position_PositionID = 4
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,

                    FirstName = "Ammie",

                    LastName = "Bennett",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 4,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 1,

                    Position_PositionID = 4
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,

                    FirstName = "Alyssa",

                    LastName = "Beckham",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 4,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 1,

                    Position_PositionID = 4
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,
                    FirstName    = "Angela",

                    LastName = "Baker",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 3,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 2,

                    Position_PositionID = 3
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,

                    FirstName = "Abigail",

                    LastName = "Anderson",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 3,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 2,

                    Position_PositionID = 3
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,
                    FirstName    = "Amber",

                    LastName = "Alexander",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 2,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 1,

                    Position_PositionID = 2
                }
                    );


                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,

                    FirstName = "Amelia",

                    LastName = "Adams",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 2,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 1,

                    Position_PositionID = 2
                }
                    );

                //11
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,

                    FirstName = "brooke",

                    LastName = "edward",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0859872658",

                    Line = "brooke152",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1992-10-12"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 2,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 1,

                    Position_PositionID = 2
                }
                    );
                //12
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,
                    FirstName    = "alice",

                    LastName = "anissa",

                    Gender = "female",

                    Email = "*****@*****.**",

                    Call = "0847563259",

                    Line = "aliceWTF",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1990-7-2"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 5,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 1,

                    Position_PositionID = 3
                }
                    );
                //13
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,

                    FirstName = "ava",

                    LastName = "holly",

                    Gender = "female",

                    Email = "*****@*****.**",

                    Call = "0698745284",

                    Line = "avaava",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1994-10-22"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 4,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 1,

                    Position_PositionID = 4
                }
                    );
                //14
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,
                    FirstName    = "opal",

                    LastName = "sophie",

                    Gender = "female",

                    Email = "*****@*****.**",

                    Call = "0897854632",

                    Line = "opal6322",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1988-12-20"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 4,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 1,

                    Position_PositionID = 3
                }
                    );
                //15
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,

                    FirstName = "max",

                    LastName = "william",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0998871275",

                    Line = "mimimax",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1988-5-10"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 3,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 1,

                    Position_PositionID = 3
                }
                    );
                //16
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,

                    FirstName = "layla",

                    LastName = "melyssa",

                    Gender = "female",

                    Email = "*****@*****.**",

                    Call = "0875942368",

                    Line = "laylala",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-8-28"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 2,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 2,

                    Position_PositionID = 2
                }
                    );
                //17
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,

                    FirstName = "morgen",

                    LastName = "rohan",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0985314752",

                    Line = "morgenrohan",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1995-11-28"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 3,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 2,

                    Position_PositionID = 4
                }
                    );
                //18
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,
                    FirstName    = "oscar",

                    LastName = "serafim",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0986523798",

                    Line = "oscarcar",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1985-9-9"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 1,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 2,

                    Position_PositionID = 2
                }
                    );
                //19
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,

                    FirstName = "evan",

                    LastName = "jacob",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0988896571",

                    Line = "evanTH",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1995-10-9"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 2,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 2,

                    Position_PositionID = 3
                }
                    );
                //20
                context.Employee.AddRange(
                    new Employee
                {
                    Employee_Num = "1",
                    Salary       = 20.4,

                    FirstName = "harry",

                    LastName = "joshua",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0988896571",

                    Line = "harry",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1988-5-19"),

                    Status = "working",

                    Company_CompanyID = 1,

                    Department_DepartmentID = 5,

                    Location_LocationID = 1,

                    EmployeeType_EmployeeTypeID = 1,

                    Position_PositionID = 4
                }
                    );


                context.SaveChanges();
                /*---------------------------------*/
            }
        }
Exemplo n.º 13
0
 public CreateModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 14
0
 public PointModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 15
0
 public addOTModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 16
0
 public listOTModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 17
0
 public LineTokenModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 18
0
 public ManageListModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 19
0
 public DetailsModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 20
0
 public ConfirmShuttleModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 21
0
 public OTcarModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 22
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                // Look for any movies.

                if (context.EmployeeType.Any())
                {
                    return;   // DB has been seeded
                }

                context.Canteen.AddRange(
                    new Canteen
                {
                    Name   = "nabuy",
                    Email  = "*****@*****.**",
                    Line   = "tee29909",
                    Call   = "0805694931",
                    Status = "Open"
                }
                    );

                context.CompanyCar.AddRange(
                    new CompanyCar
                {
                    NameCompanyCar = "transport",
                    Seat           = "*****@*****.**",
                    Line           = "tee29909",
                    Call           = "0805694931",
                    Status         = "Open",
                }
                    );

                context.Part.AddRange(
                    new Part
                {
                    Name  = "No",
                    Price = "0",
                }
                    );


                context.Part.AddRange(
                    new Part
                {
                    Name  = "บางแสน",
                    Price = "200",
                }
                    );

                context.Part.AddRange(
                    new Part
                {
                    Name  = "พัทยา",
                    Price = "500",
                }
                    );

                context.Part.AddRange(
                    new Part
                {
                    Name  = "บ่านบึง",
                    Price = "400",
                }
                    );

                context.Part.AddRange(
                    new Part
                {
                    Name  = "พนัสนิคม",
                    Price = "100",
                }
                    );



                context.Position.AddRange(
                    new Position
                {
                    PositionName = "admin"
                }
                    );

                context.Position.AddRange(
                    new Position
                {
                    PositionName = "Manager"
                }
                    );
                context.Position.AddRange(
                    new Position
                {
                    PositionName = "Employee"
                }
                    );
                context.Position.AddRange(
                    new Position
                {
                    PositionName = "CEO"
                }
                    );



                /* ---------------------------------*/



                context.EmployeeType.AddRange(
                    new EmployeeType
                {
                    EmployeeTypeName = "Full Time"
                }
                    );
                context.EmployeeType.AddRange(
                    new EmployeeType
                {
                    EmployeeTypeName = "Part Time"
                }
                    );

                /*---------------------------------*/

                context.Location.AddRange(
                    new Location
                {
                    LocationName = "2t30",
                    Note         = "note"
                }
                    );

                /*---------------------------------*/

                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Information Technology",
                    Image          = "Emp1.jpg",
                    Status         = "open"
                }
                    );
                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Production Department",
                    Image          = "Emp1.jpg",
                    Status         = "open"
                }
                    );
                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Sales Department",
                    Image          = "Emp1.jpg",
                    Status         = "open"
                }
                    );
                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Accounting Department",
                    Image          = "Emp1.jpg",
                    Status         = "open"
                }
                    );
                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Human Resource",
                    Image          = "Emp1.jpg",
                    Status         = "open"
                }
                    );

                /*---------------------------------*/

                context.Company.AddRange(
                    new Company
                {
                    CompanyName = "Tbkk",
                    Image       = "Emp1.jpg",
                    Status      = "open"
                }
                    );

                context.SaveChanges();
                /*---------------------------------*/
            }



            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                // Look for any movies.

                if (context.Login.Any())
                {
                    return;   // DB has been seeded
                }


                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "admin",

                    LastName = "admin",

                    Gender = "male",

                    Birthday = DateTime.Parse("1989-2-12"),

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 1,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 1,

                    Employee_PositionID = 1
                }
                    );



                /*222222222222222222222222222222222222222222222222222222222*/



                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Athena",

                    LastName = "Collins",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 5,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 1,

                    Employee_PositionID = 4
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Arista",

                    LastName = "Carter",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 5,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 1,

                    Employee_PositionID = 4
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Aria",

                    LastName = "Campbell",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 5,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 1,

                    Employee_PositionID = 4
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Ammie",

                    LastName = "Bennett",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 4,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 1,

                    Employee_PositionID = 4
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Alyssa",

                    LastName = "Beckham",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 4,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 1,

                    Employee_PositionID = 4
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Angela",

                    LastName = "Baker",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 3,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 2,

                    Employee_PositionID = 3
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Abigail",

                    LastName = "Anderson",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 3,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 2,

                    Employee_PositionID = 3
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Amber",

                    LastName = "Alexander",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 2,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 1,

                    Employee_PositionID = 2
                }
                    );


                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Amelia",

                    LastName = "Adams",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0805694932",

                    Line = "tee29909",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-2-12"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 2,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 1,

                    Employee_PositionID = 2
                }
                    );

                //11
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "brooke",

                    LastName = "edward",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0859872658",

                    Line = "brooke152",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1992-10-12"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 2,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 1,

                    Employee_PositionID = 2
                }
                    );
                //12
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "alice",

                    LastName = "anissa",

                    Gender = "female",

                    Email = "*****@*****.**",

                    Call = "0847563259",

                    Line = "aliceWTF",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1990-7-2"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 5,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 1,

                    Employee_PositionID = 3
                }
                    );
                //13
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "ava",

                    LastName = "holly",

                    Gender = "female",

                    Email = "*****@*****.**",

                    Call = "0698745284",

                    Line = "avaava",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1994-10-22"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 4,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 1,

                    Employee_PositionID = 4
                }
                    );
                //14
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "opal",

                    LastName = "sophie",

                    Gender = "female",

                    Email = "*****@*****.**",

                    Call = "0897854632",

                    Line = "opal6322",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1988-12-20"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 4,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 1,

                    Employee_PositionID = 3
                }
                    );
                //15
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "max",

                    LastName = "william",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0998871275",

                    Line = "mimimax",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1988-5-10"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 3,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 1,

                    Employee_PositionID = 3
                }
                    );
                //16
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "layla",

                    LastName = "melyssa",

                    Gender = "female",

                    Email = "*****@*****.**",

                    Call = "0875942368",

                    Line = "laylala",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1989-8-28"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 2,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 2,

                    Employee_PositionID = 2
                }
                    );
                //17
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "morgen",

                    LastName = "rohan",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0985314752",

                    Line = "morgenrohan",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1995-11-28"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 3,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 2,

                    Employee_PositionID = 4
                }
                    );
                //18
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "oscar",

                    LastName = "serafim",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0986523798",

                    Line = "oscarcar",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1985-9-9"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 1,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 2,

                    Employee_PositionID = 2
                }
                    );
                //19
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "evan",

                    LastName = "jacob",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0988896571",

                    Line = "evanTH",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1995-10-9"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 2,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 2,

                    Employee_PositionID = 3
                }
                    );
                //20
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "harry",

                    LastName = "joshua",

                    Gender = "male",

                    Email = "*****@*****.**",

                    Call = "0988896571",

                    Line = "harry",

                    Image = "Emp1.jpg",

                    Addr = "tbkk",

                    Date = DateTime.Parse("1988-5-19"),

                    Status = "working",

                    Employee_CompanyID = 1,

                    Employee_DepartmentID = 5,

                    Employee_LocationID = 1,

                    Employee_EmployeeTypeID = 1,

                    Employee_PositionID = 4
                }
                    );

                /*222222222222222222222222222222222222222222222222222222222*/



                /*---------------------------------*/


                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 20
                }
                    );

                /*+++++++++++++++++++++++++++++++++++++++++++*/
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 2
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 3
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 4
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 5
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 6
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 7
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 8
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 9
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 10
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 11
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 12
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 13
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 14
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 15
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 16
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 17
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 18
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 19
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 1
                }
                    );

                /*+++++++++++++++++++++++++++++++++++++++++++*/



                context.CarType.AddRange(
                    new CarType
                {
                    NameCar      = "ว่าง",
                    Seat         = 0,
                    CompanyCarID = 1
                }
                    );

                context.CarType.AddRange(
                    new CarType
                {
                    NameCar      = "สองแถวสองประตู",
                    Seat         = 8,
                    CompanyCarID = 1
                }
                    );


                context.CarType.AddRange(
                    new CarType
                {
                    NameCar      = "สองแถวสี่ประตู",
                    Seat         = 6,
                    CompanyCarID = 1
                }
                    );
                context.FoodSet.AddRange(
                    new FoodSet
                {
                    FoodSetcoManul    = "ว่าง",
                    NameSet           = "ไม่เลือก",
                    Canteen_CanteenID = 1
                }
                    );

                context.FoodSet.AddRange(
                    new FoodSet
                {
                    FoodSetcoManul    = "อาหาร",
                    NameSet           = "A",
                    Canteen_CanteenID = 1
                }
                    );

                context.FoodSet.AddRange(
                    new FoodSet
                {
                    FoodSetcoManul    = "อาหาร",
                    NameSet           = "B",
                    Canteen_CanteenID = 1
                }
                    );

                context.SaveChanges();
            }
        }
Exemplo n.º 23
0
 public CompanyCarModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 24
0
 public CarTypeModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 25
0
 public manageCarModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 26
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkdbContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkdbContext> >()))
            {
                // Look for any movies.

                if (context.Login.Any())
                {
                    return;   // DB has been seeded
                }


                /*---------------------------------*/


                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 1
                }
                    );

                /*+++++++++++++++++++++++++++++++++++++++++++*/
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 2
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 3
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 4
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 5
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 6
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 7
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 8
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 9
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 10
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 11
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 12
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 13
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 14
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 15
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 16
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 17
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 18
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 19
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username = "******",

                    Password = "******",

                    Login_EmployeeID = 20
                }
                    );

                /*+++++++++++++++++++++++++++++++++++++++++++*/

                context.CarType.AddRange(
                    new CarType
                {
                    NameCar = "สองแถวสองประตู",
                    Seat    = 8,
                    CarType_CompanyCarID = 1,
                    Status = "Open"
                }
                    );


                context.CarType.AddRange(
                    new CarType
                {
                    NameCar = "สองแถวสี่ประตู",
                    Seat    = 6,
                    CarType_CompanyCarID = 1,
                    Status = "Open"
                }
                    );
                context.FoodSet.AddRange(
                    new FoodSet
                {
                    FoodSetcoManul    = "No",
                    NameSet           = "No",
                    Price             = 0,
                    Canteen_CanteenID = 1,
                    Status            = "Open"
                }
                    );

                context.FoodSet.AddRange(
                    new FoodSet
                {
                    FoodSetcoManul    = "อาหาร",
                    NameSet           = "A",
                    Price             = 50,
                    Canteen_CanteenID = 1,
                    Status            = "Open"
                }
                    );

                context.FoodSet.AddRange(
                    new FoodSet
                {
                    FoodSetcoManul    = "อาหาร",
                    NameSet           = "B",
                    Price             = 50,
                    Canteen_CanteenID = 1,
                    Status            = "Open"
                }
                    );

                context.SaveChanges();
            }
        }
Exemplo n.º 27
0
 public IndexModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 28
0
 public DeleteModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 29
0
 public EditModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }
Exemplo n.º 30
0
 public manageEmpListModel(tbkk.Models.tbkkdbContext context)
 {
     _context = context;
 }