示例#1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

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



                context.Detail_Eva.AddRange(
                    new Detail_Eva
                {
                    Evaluator_ID         = 1,
                    Comment              = "Good",
                    DeEva_EmployeeID     = 1,
                    DeEva_EvaluationID   = 1,
                    DeEva_GradeHistoryID = 1
                }
                    );



                context.SaveChanges();
            }
        }
示例#2
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                if (context.EmployeeType.Any())
                {
                    return;
                }



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



                context.SaveChanges();
            }
        }
示例#3
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

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



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



                context.SaveChanges();
            }
        }
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

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


                context.Type_Survey.AddRange(
                    new Type_Survey
                {
                    TypeSurvey = "Open"
                }
                    );

                context.Type_Survey.AddRange(
                    new Type_Survey
                {
                    TypeSurvey = "Close"
                }
                    );
                context.SaveChanges();
            }
        }
示例#5
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

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



                context.Evaluation.AddRange(
                    new Evaluation
                {
                    EvaName = "Competency",
                }
                    );

                context.Evaluation.AddRange(
                    new Evaluation
                {
                    EvaName = "KPI",
                }
                    );



                context.SaveChanges();
            }
        }
示例#6
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

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


                context.SurveyOperators.AddRange(
                    new SurveyOperators
                {
                    Type_SurveyID = 1,
                    Date          = DateTime.Parse("2020-9-19"),
                    SurveyCount   = 5,
                    SurveyID      = 1
                }
                    );

                context.SurveyOperators.AddRange(
                    new SurveyOperators
                {
                    Type_SurveyID = 2,
                    Date          = DateTime.Parse("2020-10-19"),
                    SurveyCount   = 5,
                    SurveyID      = 2
                }
                    );
                context.SurveyOperators.AddRange(
                    new SurveyOperators
                {
                    Type_SurveyID = 1,
                    Date          = DateTime.Parse("2020-11-19"),
                    SurveyCount   = 6,
                    SurveyID      = 3
                }
                    );

                context.SurveyOperators.AddRange(
                    new SurveyOperators
                {
                    Type_SurveyID = 2,
                    Date          = DateTime.Parse("2020-12-19"),
                    SurveyCount   = 4,
                    SurveyID      = 4
                }
                    );
                context.SaveChanges();
            }
        }
示例#7
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

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


                context.Claim.AddRange(
                    new Claim
                {
                    DateClaim  = DateTime.Parse("2020-9-19"),
                    Status     = "InComplete",
                    ComplainID = 6
                }
                    );

                context.Claim.AddRange(
                    new Claim
                {
                    DateClaim  = DateTime.Parse("2020-10-19"),
                    Status     = "InComplete",
                    ComplainID = 16
                }
                    );
                context.Claim.AddRange(
                    new Claim
                {
                    DateClaim  = DateTime.Parse("2020-11-19"),
                    Status     = "InComplete",
                    ComplainID = 30
                }
                    );

                context.Claim.AddRange(
                    new Claim
                {
                    DateClaim  = DateTime.Parse("2020-12-19"),
                    Status     = "InComplete",
                    ComplainID = 9
                }
                    );

                context.SaveChanges();
            }
        }
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

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


                context.type_productLooss.AddRange(
                    new type_productLooss
                {
                    Name = "pd1 Overall"
                }
                    );

                context.type_productLooss.AddRange(
                    new type_productLooss
                {
                    Name = "A26"
                }
                    );
                context.type_productLooss.AddRange(
                    new type_productLooss
                {
                    Name = "A25"
                }
                    );
                context.type_productLooss.AddRange(
                    new type_productLooss
                {
                    Name = "A17"
                }
                    );
                context.type_productLooss.AddRange(
                    new type_productLooss
                {
                    Name = "A19"
                }
                    );
                context.SaveChanges();
            }
        }
示例#9
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // 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();
            }
        }
示例#10
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

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


                context.Delivery_performance.AddRange(
                    new Delivery_performance
                {
                    Complains_Delivery = 4,
                    Claim_Delivery     = 6,
                    DateDelivery       = DateTime.Parse("2020-9-19"),
                    EmployeeID         = 1
                }
                    );
                context.Delivery_performance.AddRange(
                    new Delivery_performance
                {
                    Complains_Delivery = 4,
                    Claim_Delivery     = 6,
                    DateDelivery       = DateTime.Parse("2020-10-19"),
                    EmployeeID         = 2
                }
                    );
                context.Delivery_performance.AddRange(
                    new Delivery_performance
                {
                    Complains_Delivery = 4,
                    Claim_Delivery     = 6,
                    DateDelivery       = DateTime.Parse("2020-11-19"),
                    EmployeeID         = 3
                }
                    );

                context.SaveChanges();
            }
        }
示例#11
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // 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.SaveChanges();
            }
        }
示例#12
0
 public CreateModel(tbkkData.Models.tbkkDataContext context)
 {
     _context = context;
 }
示例#13
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

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


                context.Manufacture.AddRange(
                    new Manufacture
                {
                    Quantity   = 7,
                    Date       = DateTime.Parse("2020-8-19"),
                    ProductID  = 3,
                    EmployeeID = 3,
                    //CompanyID = 1
                }
                    );
                context.Manufacture.AddRange(
                    new Manufacture
                {
                    Quantity   = 5,
                    Date       = DateTime.Parse("2020-9-19"),
                    ProductID  = 5,
                    EmployeeID = 2,
                    // CompanyID = 2
                }
                    );
                context.Manufacture.AddRange(
                    new Manufacture
                {
                    Quantity   = 6,
                    Date       = DateTime.Parse("2020-9-19"),
                    ProductID  = 4,
                    EmployeeID = 5,
                    // CompanyID = 1
                }
                    );
                context.Manufacture.AddRange(
                    new Manufacture
                {
                    Quantity   = 6,
                    Date       = DateTime.Parse("2020-10-19"),
                    ProductID  = 3,
                    EmployeeID = 8,
                    //CompanyID = 2
                }
                    );
                context.Manufacture.AddRange(
                    new Manufacture
                {
                    Quantity   = 5,
                    Date       = DateTime.Parse("2020-11-19"),
                    ProductID  = 2,
                    EmployeeID = 15,
                    //CompanyID = 1
                }
                    );
                context.Manufacture.AddRange(
                    new Manufacture
                {
                    Quantity   = 4,
                    Date       = DateTime.Parse("2020-12-19"),
                    ProductID  = 1,
                    EmployeeID = 20,
                    //CompanyID = 1
                }
                    );
                context.SaveChanges();
            }
        }
示例#14
0
 public DetailsModel(tbkkData.Models.tbkkDataContext context)
 {
     _context = context;
 }
示例#15
0
 public UpdateRivalModel(tbkkData.Models.tbkkDataContext context)
 {
     _context = context;
 }
示例#16
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

                if (context.EmployeeType.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.EmployeeType.AddRange(
                    new EmployeeType
                {
                    EmployeeTypeName = "Full Time"
                }
                    );
                context.EmployeeType.AddRange(
                    new EmployeeType
                {
                    EmployeeTypeName = "Part Time"
                }
                    );

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



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

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

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

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

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



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

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


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

                context.Employee.AddRange(
                    new Employee
                {
                    FirstName               = "Charlotte",
                    LastName                = "Daisy",
                    Address                 = "London",
                    Telephone               = "0632158475",
                    Salary                  = 16000,
                    Email                   = "*****@*****.**",
                    Age                     = 23,
                    Birthday                = DateTime.Parse("2539-3-2"),
                    Status                  = "Working",
                    Date_of_employment      = DateTime.Parse("2562-3-2"),
                    Gender                  = "male",
                    Employee_CompanyID      = 1,
                    Employee_DepartmentID   = 1,
                    Employee_EmployeeTypeID = 1,
                    Employee_PositionID     = 1
                }
                    );

                context.Employee.AddRange(
                    new Employee
                {
                    FirstName               = "Chloe",
                    LastName                = "Ella",
                    Address                 = "Gloucester",
                    Telephone               = "0621453339",
                    Salary                  = 15000,
                    Email                   = "*****@*****.**",
                    Age                     = 31,
                    Birthday                = DateTime.Parse("2531-3-21"),
                    Status                  = "Working",
                    Date_of_employment      = DateTime.Parse("2561-3-2"),
                    Gender                  = "female",
                    Employee_CompanyID      = 1,
                    Employee_DepartmentID   = 2,
                    Employee_EmployeeTypeID = 2,
                    Employee_PositionID     = 2
                }
                    );



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


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

                    Password = "******",

                    Login_EmployeeID = 1
                }
                    );

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

                    Password = "******",

                    Login_EmployeeID = 2
                }
                    );


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



                context.SaveChanges();
            }

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

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

                context.GradeHistory.AddRange(
                    new GradeHistory
                {
                    GrahAllPoint = 4,
                    Count        = 1,
                    GrahRound1   = 4,
                    GrahRound2   = 4,
                    GrahRound3   = 4,
                    GrahYear     = "2562",
                    GrahBonusUp  = 10000,
                    GrahSalaryUp = 25000,
                }
                    );
                context.GradeHistory.AddRange(
                    new GradeHistory
                {
                    GrahAllPoint = 3,
                    Count        = 2,
                    GrahRound1   = 3,
                    GrahRound2   = 3,
                    GrahRound3   = 3,
                    GrahYear     = "2562",
                    GrahBonusUp  = 5000,
                    GrahSalaryUp = 2000,
                }
                    );
                context.GradeHistory.AddRange(
                    new GradeHistory
                {
                    GrahAllPoint = 5,
                    Count        = 2,
                    GrahRound1   = 4,
                    GrahRound2   = 4,
                    GrahRound3   = 4,
                    GrahYear     = "2562",
                    GrahBonusUp  = 10000,
                    GrahSalaryUp = 25000,
                }
                    );
                context.GradeHistory.AddRange(
                    new GradeHistory
                {
                    GrahAllPoint = 4,
                    Count        = 1,
                    GrahRound1   = 4,
                    GrahRound2   = 4,
                    GrahRound3   = 4,
                    GrahYear     = "2562",
                    GrahBonusUp  = 10000,
                    GrahSalaryUp = 25000,
                }
                    );
                context.GradeHistory.AddRange(
                    new GradeHistory
                {
                    GrahAllPoint = 3,
                    Count        = 1,
                    GrahRound1   = 3,
                    GrahRound2   = 3,
                    GrahRound3   = 3,
                    GrahYear     = "2562",
                    GrahBonusUp  = 10000,
                    GrahSalaryUp = 25000,
                }
                    );
                context.Evaluation.AddRange(
                    new Evaluation
                {
                    EvaDetail          = "NULL",
                    EvaSumPoint        = 4,
                    EvaDate            = DateTime.Parse("2562-2-12"),
                    EvaStatus          = 2,
                    Evatype            = "1",
                    Eva_GradeHistoryID = 1
                }
                    );
                context.Evaluation.AddRange(
                    new Evaluation
                {
                    EvaDetail          = "NULL",
                    EvaSumPoint        = 4,
                    EvaDate            = DateTime.Parse("2562-2-12"),
                    EvaStatus          = 2,
                    Evatype            = "1",
                    Eva_GradeHistoryID = 2,
                    EvaluatorID        = 1
                }
                    );
                context.Evaluation.AddRange(
                    new Evaluation
                {
                    EvaDetail          = "NULL",
                    EvaSumPoint        = 4,
                    EvaDate            = DateTime.Parse("2562-2-12"),
                    EvaStatus          = 2,
                    Evatype            = "1",
                    Eva_GradeHistoryID = 3,
                    EvaluatorID        = 1
                }
                    );
                context.Evaluation.AddRange(
                    new Evaluation
                {
                    EvaDetail          = "NULL",
                    EvaSumPoint        = 4,
                    EvaDate            = DateTime.Parse("2562-2-12"),
                    EvaStatus          = 2,
                    Evatype            = "1",
                    Eva_GradeHistoryID = 4,
                    EvaluatorID        = 1
                }
                    );
                context.Evaluation.AddRange(
                    new Evaluation
                {
                    EvaDetail          = "NULL",
                    EvaSumPoint        = 4,
                    EvaDate            = DateTime.Parse("2562-2-12"),
                    EvaStatus          = 2,
                    Evatype            = "1",
                    Eva_GradeHistoryID = 5,
                    EvaluatorID        = 1
                }
                    );

                context.SaveChanges();
            }
        }
示例#17
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                if (context.Project_Product.Any())
                {
                    return;       // DB has been seeded
                }


                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 10,
                    ProductID = 1,
                    ProjectID = 1
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 15,
                    ProductID = 2,
                    ProjectID = 1
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 20,
                    ProductID = 3,
                    ProjectID = 1
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 5,
                    ProductID = 4,
                    ProjectID = 1
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 15,
                    ProductID = 5,
                    ProjectID = 2
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 10,
                    ProductID = 1,
                    ProjectID = 2
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 15,
                    ProductID = 2,
                    ProjectID = 2
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 5,
                    ProductID = 3,
                    ProjectID = 2
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 20,
                    ProductID = 4,
                    ProjectID = 3
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 10,
                    ProductID = 5,
                    ProjectID = 3
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 20,
                    ProductID = 1,
                    ProjectID = 3
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 10,
                    ProductID = 2,
                    ProjectID = 3
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 20,
                    ProductID = 3,
                    ProjectID = 3
                }
                    );


                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 5,
                    ProductID = 4,
                    ProjectID = 4
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 15,
                    ProductID = 5,
                    ProjectID = 4
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 5,
                    ProductID = 1,
                    ProjectID = 4
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 15,
                    ProductID = 2,
                    ProjectID = 4
                }
                    );


                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 10,
                    ProductID = 3,
                    ProjectID = 5
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 10,
                    ProductID = 4,
                    ProjectID = 5
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 10,
                    ProductID = 5,
                    ProjectID = 5
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 10,
                    ProductID = 1,
                    ProjectID = 5
                }
                    );


                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 15,
                    ProductID = 2,
                    ProjectID = 6
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 10,
                    ProductID = 3,
                    ProjectID = 6
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 15,
                    ProductID = 4,
                    ProjectID = 6
                }
                    );

                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 10,
                    ProductID = 5,
                    ProjectID = 7
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 20,
                    ProductID = 1,
                    ProjectID = 7
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 10,
                    ProductID = 2,
                    ProjectID = 7
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 20,
                    ProductID = 3,
                    ProjectID = 7
                }
                    );


                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 5,
                    ProductID = 4,
                    ProjectID = 8
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 5,
                    ProductID = 5,
                    ProjectID = 8
                }
                    );
                context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 5,
                    ProductID = 1,
                    ProjectID = 8
                }
                    ); context.Project_Product.AddRange(
                    new Project_Product
                {
                    Qty       = 15,
                    ProductID = 2,
                    ProjectID = 8
                }
                    );



                context.SaveChanges();
            }
        }
示例#18
0
 public SafetysModel(tbkkData.Models.tbkkDataContext context)
 {
     _context = context;
 }
示例#19
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                if (context.GradeHistory.Any())
                {
                    return;
                }


                context.GradeHistory.AddRange(
                    new GradeHistory
                {
                    GrahAllPoint = 0,
                    Count        = 1,
                    GrahRound1   = 0,
                    GrahRound2   = 0,
                    GrahRound3   = 0,
                    GrahYear     = "2562",
                    GrahBonusUp  = 10000,
                    GrahSalaryUp = 25000,
                }
                    );
                context.GradeHistory.AddRange(
                    new GradeHistory
                {
                    GrahAllPoint = 3,
                    Count        = 2,
                    GrahRound1   = 3,
                    GrahRound2   = 3,
                    GrahRound3   = 3,
                    GrahYear     = "2562",
                    GrahBonusUp  = 5000,
                    GrahSalaryUp = 2000,
                }
                    );
                context.GradeHistory.AddRange(
                    new GradeHistory
                {
                    GrahAllPoint = 5,
                    Count        = 2,
                    GrahRound1   = 4,
                    GrahRound2   = 4,
                    GrahRound3   = 4,
                    GrahYear     = "2562",
                    GrahBonusUp  = 10000,
                    GrahSalaryUp = 25000,
                }
                    );
                context.GradeHistory.AddRange(
                    new GradeHistory
                {
                    GrahAllPoint = 4,
                    Count        = 1,
                    GrahRound1   = 4,
                    GrahRound2   = 4,
                    GrahRound3   = 4,
                    GrahYear     = "2562",
                    GrahBonusUp  = 10000,
                    GrahSalaryUp = 25000,
                }
                    );
                context.GradeHistory.AddRange(
                    new GradeHistory
                {
                    GrahAllPoint = 3,
                    Count        = 1,
                    GrahRound1   = 3,
                    GrahRound2   = 3,
                    GrahRound3   = 3,
                    GrahYear     = "2562",
                    GrahBonusUp  = 10000,
                    GrahSalaryUp = 25000,
                }
                    );



                context.SaveChanges();
            }
        }
示例#20
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

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

                context.Company.AddRange(
                    new Company
                {
                    CompanyName = "TBKK",
                    Category    = "P.8"
                }
                    );

                context.Company.AddRange(
                    new Company
                {
                    CompanyName = "TBKK",
                    Category    = "P.10"
                }
                    );
                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Information Technology",
                    Status         = "open"
                }
                    );
                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Production Department",
                    Status         = "open"
                }
                    );
                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Sales Department",
                    Status         = "open"
                }
                    );
                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Accounting Department",
                    Status         = "open"
                }
                    );
                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "Human Resource",
                    Status         = "open"
                }
                    );
                context.Department.AddRange(
                    new Department
                {
                    DepartmentName = "CEO",
                    Status         = "open"
                }
                    );

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



                context.Customer.AddRange(
                    new Customer
                {
                    FirsName  = "Barron",
                    LastName  = "Caspar",
                    Address   = "West Lloydminster ",
                    Email     = "*****@*****.**",
                    Telephone = "0988294410"
                }
                    );
                context.Customer.AddRange(
                    new Customer
                {
                    FirsName  = "Calvyn",
                    LastName  = "Dylan",
                    Address   = "London ",
                    Email     = "*****@*****.**",
                    Telephone = "063156338"
                }
                    );
                context.Customer.AddRange(
                    new Customer
                {
                    FirsName  = "Samuel",
                    LastName  = "William",
                    Address   = "Cheltenham",
                    Email     = "*****@*****.**",
                    Telephone = "0871502842"
                }
                    );
                context.Customer.AddRange(
                    new Customer
                {
                    FirsName  = "Charlie",
                    LastName  = "Damian",
                    Address   = "Newcastle upon Tyne",
                    Email     = "*****@*****.**",
                    Telephone = "0909688292"
                }
                    );
                context.Customer.AddRange(
                    new Customer
                {
                    FirsName  = "Christopher",
                    LastName  = "Dante",
                    Address   = "Bolton",
                    Email     = "*****@*****.**",
                    Telephone = "0810025909"
                }
                    );
                context.Customer.AddRange(
                    new Customer
                {
                    FirsName  = "Edward",
                    LastName  = "Harper",
                    Address   = "Birkenhead",
                    Email     = "*****@*****.**",
                    Telephone = "0665231498"
                }
                    );
                context.Customer.AddRange(
                    new Customer
                {
                    FirsName  = "Ivan",
                    LastName  = "Jacob",
                    Address   = "Middlesbrough",
                    Email     = "*****@*****.**",
                    Telephone = "0633214569"
                }
                    );
                context.Customer.AddRange(
                    new Customer
                {
                    FirsName  = "Jordan",
                    LastName  = "Kevin",
                    Address   = "Loughborough",
                    Email     = "*****@*****.**",
                    Telephone = "0879465321"
                }
                    );
                context.Customer.AddRange(
                    new Customer
                {
                    FirsName  = "Lincoln",
                    LastName  = "Maglorix",
                    Address   = "Westminster City",
                    Email     = "*****@*****.**",
                    Telephone = "0633214528"
                }
                    );
                context.Customer.AddRange(
                    new Customer
                {
                    FirsName  = "Matthew",
                    LastName  = "Nicholas",
                    Address   = "Exeter",
                    Email     = "*****@*****.**",
                    Telephone = "0632144567"
                }
                    );
                context.Customer.AddRange(
                    new Customer
                {
                    FirsName  = "Oscar",
                    LastName  = "Rohan",
                    Address   = "Oxford",
                    Email     = "*****@*****.**",
                    Telephone = "0874125896"
                }
                    );
                context.Customer.AddRange(
                    new Customer
                {
                    FirsName  = "Richard",
                    LastName  = "Serafim",
                    Address   = "High Wycombe",
                    Email     = "*****@*****.**",
                    Telephone = "0987412351"
                }
                    );



                context.Rival.AddRange(
                    new Rival
                {
                    Name      = "Robert Bosch",
                    Address   = "London ",
                    Email     = "*****@*****.**",
                    Telephone = "0988294410"
                }
                    );

                context.Rival.AddRange(
                    new Rival
                {
                    Name      = "Johnson Controls",
                    Address   = "Blackburn",
                    Email     = "*****@*****.**",
                    Telephone = "0811572158"
                }
                    );

                context.Rival.AddRange(
                    new Rival
                {
                    Name      = "Magna International",
                    Address   = "Winchester",
                    Email     = "*****@*****.**",
                    Telephone = "0631135758"
                }
                    );
                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();
            }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

                if (context.Login.Any())
                {
                    return;       // DB has been seeded
                }
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Charlotte",
                    LastName  = "Daisy",
                    Address   = "London",
                    Telephone = "0632158475",
                    Salary    = 16000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2539-3-2"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Male",
                    CompanyID          = 1,
                    DepartmentID       = 1,
                    EmployeeTypeID     = 1,
                    PositionID         = 1
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Chloe",
                    LastName  = "Ella",
                    Address   = "Gloucester",
                    Telephone = "0621453339",
                    Salary    = 15000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2531-3-21"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Male",
                    CompanyID          = 1,
                    DepartmentID       = 1,
                    EmployeeTypeID     = 2,
                    PositionID         = 1
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Camilla",
                    LastName  = "Emma",
                    Address   = "Sheffield",
                    Telephone = "0817829346",
                    Salary    = 15000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2521-12-12"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Female",
                    CompanyID          = 2,
                    DepartmentID       = 2,
                    EmployeeTypeID     = 2,
                    PositionID         = 1
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Eva",
                    LastName  = "Freya",
                    Address   = "Doncaster",
                    Telephone = "0985742566",
                    Salary    = 20000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2519-9-19"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Male",
                    CompanyID          = 2,
                    DepartmentID       = 6,
                    EmployeeTypeID     = 1,
                    PositionID         = 3
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Ella",
                    LastName  = "Grace",
                    Address   = "Nottingham",
                    Telephone = "0623145287",
                    Salary    = 19000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2530-8-30"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Male",
                    CompanyID          = 1,
                    DepartmentID       = 3,
                    EmployeeTypeID     = 1,
                    PositionID         = 1
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Gracie",
                    LastName  = "Hannah",
                    Address   = "Bournemouth",
                    Telephone = "0874125960",
                    Salary    = 25000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2538-8-13"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Female",
                    CompanyID          = 2,
                    DepartmentID       = 4,
                    EmployeeTypeID     = 2,
                    PositionID         = 1
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Holly",
                    LastName  = "Isabella",
                    Address   = "Reims",
                    Telephone = "0985214763",
                    Salary    = 24000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2537-7-3"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Female",
                    CompanyID          = 1,
                    DepartmentID       = 4,
                    EmployeeTypeID     = 2,
                    PositionID         = 1
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Jennifer",
                    LastName  = "Katie",
                    Address   = "Plymouth",
                    Telephone = "0985742314",
                    Salary    = 23000,
                    Status    = "Working",
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2529-3-29"),
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Female",
                    CompanyID          = 1,
                    DepartmentID       = 3,
                    EmployeeTypeID     = 2,
                    PositionID         = 1
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Jasmine",
                    LastName  = "Katie",
                    Address   = "Middlesbrough",
                    Telephone = "0632145887",
                    Salary    = 22000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2517-7-17"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Male",
                    CompanyID          = 1,
                    DepartmentID       = 2,
                    EmployeeTypeID     = 1,
                    PositionID         = 1
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Jessica",
                    LastName  = "Leah",
                    Address   = "Winchester",
                    Telephone = "0874529863",
                    Salary    = 21000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2515-5-15"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Female",
                    CompanyID          = 2,
                    DepartmentID       = 1,
                    EmployeeTypeID     = 1,
                    PositionID         = 1
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Lilly",
                    LastName  = "Maisie",
                    Address   = "Stourbridge",
                    Telephone = "087452139",
                    Salary    = 20000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2527-7-27"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Male",
                    CompanyID          = 1,
                    DepartmentID       = 1,
                    EmployeeTypeID     = 1,
                    PositionID         = 3
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName          = "Arthur",
                    LastName           = "Brooke",
                    Address            = "Ancient Britain ",
                    Telephone          = "0632154789",
                    Salary             = 17000,
                    Email              = "*****@*****.**",
                    Birthday           = DateTime.Parse("2535-3-5"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Male",
                    CompanyID          = 1,
                    DepartmentID       = 2,
                    EmployeeTypeID     = 1,
                    PositionID         = 1
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Lucy",
                    LastName  = "Megan",
                    Address   = "Manchester ",
                    Telephone = "0874562103",
                    Salary    = 18000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2526-6-26"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Female",
                    CompanyID          = 1,
                    DepartmentID       = 3,
                    EmployeeTypeID     = 2,
                    PositionID         = 3
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Millie",
                    LastName  = "Olivia",
                    Address   = "Cheltenham",
                    Telephone = "0986521453",
                    Salary    = 19000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2513-3-31"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Male",
                    CompanyID          = 2,
                    DepartmentID       = 4,
                    EmployeeTypeID     = 1,
                    PositionID         = 1
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Melyssa",
                    LastName  = "Opal",
                    Address   = "Birkenhead",
                    Telephone = "0933659987",
                    Salary    = 20000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2511-3-12"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Male",
                    CompanyID          = 1,
                    DepartmentID       = 5,
                    EmployeeTypeID     = 1,
                    PositionID         = 4
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Phoebe",
                    LastName  = "Ruby",
                    Address   = "Manchester",
                    Telephone = "0879652140",
                    Salary    = 15000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2525-5-2"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Female",
                    CompanyID          = 2,
                    DepartmentID       = 5,
                    EmployeeTypeID     = 2,
                    PositionID         = 1
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Poppy",
                    LastName  = "Sophia",
                    Address   = "Loughborough",
                    Telephone = "0632897452",
                    Salary    = 16000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2534-4-3"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Male",
                    CompanyID          = 1,
                    DepartmentID       = 4,
                    EmployeeTypeID     = 1,
                    PositionID         = 1
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Addison",
                    LastName  = "Benjamin",
                    Address   = "Liverpool",
                    Telephone = "0632145687",
                    Salary    = 17000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2533-3-3"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Female",
                    CompanyID          = 1,
                    DepartmentID       = 3,
                    EmployeeTypeID     = 1,
                    PositionID         = 2
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Alvis",
                    LastName  = "Brayden",
                    Address   = "Wolverhampton",
                    Telephone = "0874125896",
                    Salary    = 18000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2525-1-11"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Male",
                    CompanyID          = 1,
                    DepartmentID       = 2,
                    EmployeeTypeID     = 2,
                    PositionID         = 1
                }
                    );
                context.Employee.AddRange(
                    new Employee
                {
                    FirstName = "Andrew",
                    LastName  = "Brighton",
                    Address   = "Oxford",
                    Telephone = "0987456321",
                    Salary    = 19000,
                    Email     = "*****@*****.**",

                    Birthday           = DateTime.Parse("2509-9-2"),
                    Status             = "Working",
                    Date_of_employment = DateTime.Parse("2020-3-2"),
                    Gender             = "Male",
                    CompanyID          = 2,
                    DepartmentID       = 1,
                    EmployeeTypeID     = 1,
                    PositionID         = 2
                }
                    );

                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 1
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 2
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 3
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 4
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 5
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 6
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 7
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 8
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 9
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 10
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 11
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 12
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 13
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 14
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 15
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 16
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 17
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 18
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 19
                }
                    );
                context.Login.AddRange(
                    new Login
                {
                    Username   = "******",
                    Password   = "******",
                    EmployeeID = 20
                }
                    );


                context.Project.AddRange(
                    new Project
                {
                    Name       = "Disc brakes",
                    Cost       = 95000,
                    StartDate  = DateTime.Parse("2020-1-2"),
                    EndDate    = DateTime.Parse("2020-2-2"),
                    CostGoal   = 133000,
                    Status     = "Completed",
                    EmployeeID = 3
                }
                    );
                context.Project.AddRange(
                    new Project
                {
                    Name       = "Caliper",
                    Cost       = 55000,
                    StartDate  = DateTime.Parse("2020-2-2"),
                    EndDate    = DateTime.Parse("2020-3-2"),
                    CostGoal   = 77000,
                    Status     = "Completed",
                    EmployeeID = 5
                }
                    );
                context.Project.AddRange(
                    new Project
                {
                    Name       = "Brake caliper",
                    Cost       = 50000,
                    StartDate  = DateTime.Parse("2020-3-2"),
                    EndDate    = DateTime.Parse("2020-4-2"),
                    CostGoal   = 70000,
                    Status     = "Completed",
                    EmployeeID = 8
                }
                    );
                context.Project.AddRange(
                    new Project
                {
                    Name       = "Hydraulic cylinder",
                    Cost       = 77500,
                    StartDate  = DateTime.Parse("2020-4-2"),
                    EndDate    = DateTime.Parse("2020-5-2"),
                    CostGoal   = 108500,
                    Status     = "In progress",
                    EmployeeID = 9
                }
                    );
                context.Project.AddRange(
                    new Project
                {
                    Name       = "Brake cylinder",
                    Cost       = 75000,
                    StartDate  = DateTime.Parse("2020-5-2"),
                    EndDate    = DateTime.Parse("2020-6-2"),
                    CostGoal   = 105000,
                    Status     = "completed",
                    EmployeeID = 12
                }
                    );
                context.Project.AddRange(
                    new Project
                {
                    Name       = "Clutch Master Cylinder",
                    Cost       = 87500,
                    StartDate  = DateTime.Parse("2020-6-2"),
                    EndDate    = DateTime.Parse("2020-7-2"),
                    CostGoal   = 122500,
                    Status     = "Completed",
                    EmployeeID = 13
                }
                    );
                context.Project.AddRange(
                    new Project
                {
                    Name       = "Shock absorber",
                    Cost       = 57500,
                    StartDate  = DateTime.Parse("2020-7-2"),
                    EndDate    = DateTime.Parse("2020-8-2"),
                    CostGoal   = 80500,
                    Status     = "Completed",
                    EmployeeID = 18
                }
                    );
                context.Project.AddRange(
                    new Project
                {
                    Name       = "Brake Booster",
                    Cost       = 150000,
                    StartDate  = DateTime.Parse("2020-8-2"),
                    EndDate    = DateTime.Parse("2020-9-2"),
                    CostGoal   = 180000,
                    Status     = "In progress",
                    EmployeeID = 19
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-9-12"),
                    ShippedDate = DateTime.Parse("2020-10-2"),
                    Invoice     = "INV-0001",
                    Total       = 37500,
                    Status      = "Complete",
                    CustomerID  = 1,
                    EmployeeID  = 5
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-10-12"),
                    ShippedDate = DateTime.Parse("2020-11-2"),
                    Invoice     = "INV-0002",
                    Total       = 90000,
                    Status      = "Complete",
                    CustomerID  = 2,
                    EmployeeID  = 8
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-11-12"),
                    ShippedDate = DateTime.Parse("2020-12-2"),
                    Invoice     = "INV-0003",
                    Total       = 67500,
                    Status      = "Complete",
                    CustomerID  = 3,
                    EmployeeID  = 13
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-12-12"),
                    ShippedDate = DateTime.Parse("2020-1-2"),
                    Invoice     = "INV-0004",
                    Total       = 55000,
                    Status      = "Complete",
                    CustomerID  = 4,
                    EmployeeID  = 18
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-6-12"),
                    ShippedDate = DateTime.Parse("2020-7-2"),
                    Invoice     = "INV-0005",
                    Total       = 75000,
                    Status      = "Complete",
                    CustomerID  = 5,
                    EmployeeID  = 5
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-7-12"),
                    ShippedDate = DateTime.Parse("2020-8-2"),
                    Invoice     = "INV-0006",
                    Total       = 110000,
                    Status      = "Complete",
                    CustomerID  = 6,
                    EmployeeID  = 8
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-8-12"),
                    ShippedDate = DateTime.Parse("2020-9-2"),
                    Invoice     = "INV-0007",
                    Total       = 27500,
                    Status      = "Complete",
                    CustomerID  = 7,
                    EmployeeID  = 13
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-9-12"),
                    ShippedDate = DateTime.Parse("2020-10-2"),
                    Invoice     = "INV-0008",
                    Total       = 55000,
                    Status      = "Complete",
                    CustomerID  = 8,
                    EmployeeID  = 5
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-11-12"),
                    ShippedDate = DateTime.Parse("2020-12-2"),
                    Invoice     = "INV-0009",
                    Total       = 90000,
                    Status      = "Complete",
                    CustomerID  = 9,
                    EmployeeID  = 8
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-12-12"),
                    ShippedDate = DateTime.Parse("2020-1-2"),
                    Invoice     = "INV-0010",
                    Total       = 75000,
                    Status      = "Complete",
                    CustomerID  = 10,
                    EmployeeID  = 5
                }
                    );
                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-2-12"),
                    ShippedDate = DateTime.Parse("2020-3-2"),
                    Invoice     = "INV-0011",
                    Total       = 45000,
                    Status      = "Complete",
                    CustomerID  = 1,
                    EmployeeID  = 5
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-3-12"),
                    ShippedDate = DateTime.Parse("2020-4-2"),
                    Invoice     = "INV-0012",
                    Total       = 70000,
                    Status      = "Complete",
                    CustomerID  = 2,
                    EmployeeID  = 8
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-4-12"),
                    ShippedDate = DateTime.Parse("2020-5-2"),
                    Invoice     = "INV-0013",
                    Total       = 100000,
                    Status      = "Complete",
                    CustomerID  = 3,
                    EmployeeID  = 13
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-5-12"),
                    ShippedDate = DateTime.Parse("2020-6-2"),
                    Invoice     = "INV-0014",
                    Total       = 25000,
                    Status      = "Complete",
                    CustomerID  = 4,
                    EmployeeID  = 18
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-6-12"),
                    ShippedDate = DateTime.Parse("2020-7-2"),
                    Invoice     = "INV-0015",
                    Total       = 23000,
                    Status      = "Complete",
                    CustomerID  = 5,
                    EmployeeID  = 5
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-7-12"),
                    ShippedDate = DateTime.Parse("2020-8-2"),
                    Invoice     = "INV-0016",
                    Total       = 20000,
                    Status      = "Complete",
                    CustomerID  = 6,
                    EmployeeID  = 8
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-8-12"),
                    ShippedDate = DateTime.Parse("2020-9-2"),
                    Invoice     = "INV-0017",
                    Total       = 45000,
                    Status      = "Complete",
                    CustomerID  = 7,
                    EmployeeID  = 13
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-9-12"),
                    ShippedDate = DateTime.Parse("2020-10-2"),
                    Invoice     = "INV-0018",
                    Total       = 24000,
                    Status      = "Complete",
                    CustomerID  = 8,
                    EmployeeID  = 5
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-10-12"),
                    ShippedDate = DateTime.Parse("2020-11-2"),
                    Invoice     = "INV-0019",
                    Total       = 72000,
                    Status      = "Complete",
                    CustomerID  = 9,
                    EmployeeID  = 8
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-11-12"),
                    ShippedDate = DateTime.Parse("2020-12-2"),
                    Invoice     = "INV-0020",
                    Total       = 58500,
                    Status      = "Complete",
                    CustomerID  = 10,
                    EmployeeID  = 5
                }
                    );
                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-12-12"),
                    ShippedDate = DateTime.Parse("2020-1-2"),
                    Invoice     = "INV-0021",
                    Total       = 50000,
                    Status      = "Complete",
                    CustomerID  = 1,
                    EmployeeID  = 5
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-1-12"),
                    ShippedDate = DateTime.Parse("2020-2-2"),
                    Invoice     = "INV-0022",
                    Total       = 35000,
                    Status      = "Complete",
                    CustomerID  = 2,
                    EmployeeID  = 8
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-2-12"),
                    ShippedDate = DateTime.Parse("2020-3-2"),
                    Invoice     = "INV-0023",
                    Total       = 24500,
                    Status      = "Complete",
                    CustomerID  = 3,
                    EmployeeID  = 13
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-3-12"),
                    ShippedDate = DateTime.Parse("2020-4-2"),
                    Invoice     = "INV-0024",
                    Total       = 54000,
                    Status      = "Complete",
                    CustomerID  = 4,
                    EmployeeID  = 18
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-4-12"),
                    ShippedDate = DateTime.Parse("2020-5-2"),
                    Invoice     = "INV-0025",
                    Total       = 38000,
                    Status      = "Complete",
                    CustomerID  = 5,
                    EmployeeID  = 5
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-5-12"),
                    ShippedDate = DateTime.Parse("2020-6-2"),
                    Invoice     = "INV-0026",
                    Total       = 26000,
                    Status      = "Complete",
                    CustomerID  = 6,
                    EmployeeID  = 8
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-6-12"),
                    ShippedDate = DateTime.Parse("2020-7-2"),
                    Invoice     = "INV-0027",
                    Total       = 52500,
                    Status      = "Complete",
                    CustomerID  = 7,
                    EmployeeID  = 13
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-7-12"),
                    ShippedDate = DateTime.Parse("2020-8-2"),
                    Invoice     = "INV-0028",
                    Total       = 193500,
                    Status      = "Complete",
                    CustomerID  = 8,
                    EmployeeID  = 5
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-8-12"),
                    ShippedDate = DateTime.Parse("2020-9-2"),
                    Invoice     = "INV-0029",
                    Total       = 50000,
                    Status      = "Complete",
                    CustomerID  = 9,
                    EmployeeID  = 8
                }
                    );

                context.Order.AddRange(
                    new Order
                {
                    OrDate      = DateTime.Parse("2020-9-12"),
                    ShippedDate = DateTime.Parse("2020-10-2"),
                    Invoice     = "INV-0030",
                    Total       = 44000,
                    Status      = "Complete",
                    CustomerID  = 10,
                    EmployeeID  = 5
                }
                    );

                context.SaveChanges();
            }
        }
示例#21
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

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


                context.Safety.AddRange(
                    new Safety
                {
                    DateIncident   = DateTime.Parse("2020-1-1"),
                    incident       = 4,
                    Total_Incident = 5
                }
                    );

                context.Safety.AddRange(
                    new Safety
                {
                    DateIncident   = DateTime.Parse("2020-2-1"),
                    incident       = 2,
                    Total_Incident = 7
                }
                    );

                context.Safety.AddRange(
                    new Safety
                {
                    DateIncident   = DateTime.Parse("2020-3-1"),
                    incident       = 2,
                    Total_Incident = 1
                }
                    );

                context.Safety.AddRange(
                    new Safety
                {
                    DateIncident   = DateTime.Parse("2020-4-1"),
                    incident       = 0,
                    Total_Incident = 1
                }
                    );

                context.Safety.AddRange(
                    new Safety
                {
                    DateIncident   = DateTime.Parse("2020-5-1"),
                    incident       = 2,
                    Total_Incident = 2
                }
                    );

                context.Safety.AddRange(
                    new Safety
                {
                    DateIncident   = DateTime.Parse("2020-6-1"),
                    incident       = 1,
                    Total_Incident = 6
                }
                    );

                context.Safety.AddRange(
                    new Safety
                {
                    DateIncident   = DateTime.Parse("2020-7-1"),
                    incident       = 3,
                    Total_Incident = 4
                }
                    );

                context.Safety.AddRange(
                    new Safety
                {
                    DateIncident   = DateTime.Parse("2020-8-1"),
                    incident       = 2,
                    Total_Incident = 5
                }
                    );

                context.Safety.AddRange(
                    new Safety
                {
                    DateIncident   = DateTime.Parse("2020-9-1"),
                    incident       = 5,
                    Total_Incident = 2
                }
                    );

                context.Safety.AddRange(
                    new Safety
                {
                    DateIncident   = DateTime.Parse("2020-10-1"),
                    incident       = 4,
                    Total_Incident = 3
                }
                    );

                context.Safety.AddRange(
                    new Safety
                {
                    DateIncident   = DateTime.Parse("2020-11-1"),
                    incident       = 3,
                    Total_Incident = 4
                }
                    );

                context.Safety.AddRange(
                    new Safety
                {
                    DateIncident   = DateTime.Parse("2020-12-1"),
                    incident       = 1,
                    Total_Incident = 5
                }
                    );
                context.SaveChanges();
            }
        }
示例#22
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

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


                context.Product.AddRange(
                    new Product
                {
                    Name = "Hydraulic cylinder",
                    //Stock = 100,
                    CostPrice    = 1500,
                    SellingPrice = 2000,
                    Status       = "Manufacture",
                    PartnersID   = 1,
                }
                    );
                context.Product.AddRange(
                    new Product
                {
                    Name = "Shock absorber",
                    //Stock = 100,
                    CostPrice    = 2500,
                    SellingPrice = 3000,
                    Status       = "Manufacture",
                    PartnersID   = 2,
                }
                    );
                context.Product.AddRange(
                    new Product
                {
                    Name = "Brake cylinder",
                    //Stock = 100,
                    CostPrice    = 1000,
                    SellingPrice = 1500,
                    Status       = "Manufacture",
                    PartnersID   = 3,
                }
                    );
                context.Product.AddRange(
                    new Product
                {
                    Name = "Caliper",
                    //Stock = 100,
                    CostPrice    = 500,
                    SellingPrice = 1000,
                    Status       = "Manufacture",
                    PartnersID   = 4,
                }
                    );
                context.Product.AddRange(
                    new Product
                {
                    Name = "Disc brakes",
                    //Stock = 100,
                    CostPrice    = 2000,
                    SellingPrice = 2500,
                    Status       = "Manufacture",
                    PartnersID   = 5,
                }
                    );



                context.SaveChanges();
            }
        }
示例#23
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

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


                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 10,
                    // Price = 1990,
                    ProductID = 1,
                    OrderID   = 1
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 15,
                    // Price = 1200,
                    ProductID = 1,
                    OrderID   = 2
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 20,
                    // Price = 2000,
                    ProductID = 2,
                    OrderID   = 3
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 5,
                    // Price = 2100,
                    ProductID = 2,
                    OrderID   = 4
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 10,
                    // Price = 2200,
                    ProductID = 3,
                    OrderID   = 5
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 15,
                    //Price = 3700,
                    ProductID = 3,
                    OrderID   = 6
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 20,
                    // Price = 4000,
                    ProductID = 4,
                    OrderID   = 7
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 15,
                    //Price = 3200,
                    ProductID = 4,
                    OrderID   = 8
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 10,
                    //Price = 3100,
                    ProductID = 5,
                    OrderID   = 9
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 5,
                    // Price = 2500,
                    ProductID = 5,
                    OrderID   = 10
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 10,
                    // Price = 1990,
                    ProductID = 1,
                    OrderID   = 11
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 15,
                    //Price = 1200,
                    ProductID = 2,
                    OrderID   = 12
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 20,
                    //Price = 2000,
                    ProductID = 3,
                    OrderID   = 13
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 5,
                    //Price = 2100,
                    ProductID = 4,
                    OrderID   = 14
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 10,
                    //Price = 2200,
                    ProductID = 5,
                    OrderID   = 15
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 15,
                    //Price = 3700,
                    ProductID = 1,
                    OrderID   = 16
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 20,
                    //Price = 4000,
                    ProductID = 1,
                    OrderID   = 17
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 15,
                    //Price = 3200,
                    ProductID = 1,
                    OrderID   = 18
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 10,
                    //Price = 3100,
                    ProductID = 2,
                    OrderID   = 19
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 5,
                    // Price = 2500,
                    ProductID = 2,
                    OrderID   = 20
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 10,
                    //Price = 1990,
                    ProductID = 2,
                    OrderID   = 21
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 15,
                    //Price = 1200,
                    ProductID = 3,
                    OrderID   = 22
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 20,
                    //Price = 2000,
                    ProductID = 3,
                    OrderID   = 23
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 5,
                    //Price = 2100,
                    ProductID = 3,
                    OrderID   = 24
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 10,
                    // Price = 2200,
                    ProductID = 4,
                    OrderID   = 25
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 15,
                    //Price = 3700,
                    ProductID = 4,
                    OrderID   = 26
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 20,
                    //Price = 4000,
                    ProductID = 4,
                    OrderID   = 27
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 15,
                    //Price = 3200,
                    ProductID = 5,
                    OrderID   = 28
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 10,
                    //Price = 3100,
                    ProductID = 5,
                    OrderID   = 29
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 5,
                    // Price = 2500,
                    ProductID = 5,
                    OrderID   = 30
                }
                    );


                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 10,
                    //Price = 1990,
                    ProductID = 1,
                    OrderID   = 1
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 15,
                    //Price = 1200,
                    ProductID = 1,
                    OrderID   = 2
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 20,
                    //Price = 2000,
                    ProductID = 2,
                    OrderID   = 3
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 5,
                    //Price = 2100,
                    ProductID = 2,
                    OrderID   = 4
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 4,
                    //Price = 2200,
                    ProductID = 3,
                    OrderID   = 5
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 11,
                    // Price = 3700,
                    ProductID = 3,
                    OrderID   = 6
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 16,
                    //Price = 4000,
                    ProductID = 4,
                    OrderID   = 7
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 12,
                    //Price = 3200,
                    ProductID = 4,
                    OrderID   = 8
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 10,
                    //Price = 3100,
                    ProductID = 5,
                    OrderID   = 9
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 9,
                    //Price = 2500,
                    ProductID = 5,
                    OrderID   = 10
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 13,
                    //Price = 1990,
                    ProductID = 1,
                    OrderID   = 11
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 13,
                    //Price = 1200,
                    ProductID = 2,
                    OrderID   = 12
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 18,
                    //Price = 2000,
                    ProductID = 3,
                    OrderID   = 13
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 8,
                    // Price = 2100,
                    ProductID = 4,
                    OrderID   = 14
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 11,
                    //Price = 2200,
                    ProductID = 5,
                    OrderID   = 15
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 114,
                    // Price = 3700,
                    ProductID = 1,
                    OrderID   = 16
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 19,
                    //  Price = 4000,
                    ProductID = 1,
                    OrderID   = 17
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 15,
                    //Price = 3200,
                    ProductID = 1,
                    OrderID   = 18
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 11,
                    //Price = 3100,
                    ProductID = 2,
                    OrderID   = 19
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 6,
                    //Price = 2500,
                    ProductID = 2,
                    OrderID   = 20
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 10,
                    // Price = 1990,
                    ProductID = 2,
                    OrderID   = 21
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 15,
                    // Price = 1200,
                    ProductID = 3,
                    OrderID   = 22
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 20,
                    //Price = 2000,
                    ProductID = 3,
                    OrderID   = 23
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 5,
                    // Price = 2100,
                    ProductID = 3,
                    OrderID   = 24
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 12,
                    // Price = 2200,
                    ProductID = 4,
                    OrderID   = 25
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 12,
                    //Price = 3700,
                    ProductID = 4,
                    OrderID   = 26
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 6,
                    // Price = 4000,
                    ProductID = 4,
                    OrderID   = 27
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 12,
                    //Price = 3200,
                    ProductID = 5,
                    OrderID   = 28
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 12,
                    //Price = 3100,
                    ProductID = 5,
                    OrderID   = 29
                }
                    );
                context.Order_Product.AddRange(
                    new Order_Product
                {
                    Qty = 3,
                    //Price = 2500,
                    ProductID = 5,
                    OrderID   = 30
                }
                    );



                context.SaveChanges();
            }
        }
示例#24
0
 public EditReductionModel(tbkkData.Models.tbkkDataContext context)
 {
     _context = context;
 }
示例#25
0
 public DeleteModel(tbkkData.Models.tbkkDataContext context)
 {
     _context = context;
 }
示例#26
0
 public EditModel(tbkkData.Models.tbkkDataContext context)
 {
     _context = context;
 }
 public AddProductRivalModel(tbkkData.Models.tbkkDataContext context)
 {
     _context = context;
 }
示例#28
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new tbkkDataContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <tbkkDataContext> >()))
            {
                // Look for any movies.

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



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

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



                context.SaveChanges();
            }
        }
示例#29
0
 public IndexModel(tbkkData.Models.tbkkDataContext context)
 {
     _context = context;
 }
 public DeleteReductionModel(tbkkData.Models.tbkkDataContext context)
 {
     _context = context;
 }