コード例 #1
0
 public void initRests(RestaurantRepository rr)
 {
     Tuple <int, string, bool>[] rests =
     {
         new Tuple <int, string, bool> (1, "West Manhattan Mcdonald's", true),                 // 1
         new Tuple <int, string, bool> (1, "East Manhattan Mcdonald's", true),                 // 2
         new Tuple <int, string, bool> (2, "Lansing Dairy Queen", true),                       // 3
         new Tuple <int, string, bool> (2, "Manhattan Dairy Queen", true),                     // 4
         new Tuple <int, string, bool> (3, "Manhattan Chili's", true),                         // 5
         new Tuple <int, string, bool> (4, "Manhattan Applebee's", true),                      // 6
         new Tuple <int, string, bool> (5, "Manhattan Buffalo Wild Wings", true),              // 7
         new Tuple <int, string, bool> (5, "Legends Outlet Buffalo Wild Wings", true),         // 8
         new Tuple <int, string, bool> (6, "Manhattan Taco Bell", true),                       // 9
         new Tuple <int, string, bool> (6, "Kansas City Taco Bell", true),                     // 10
         new Tuple <int, string, bool> (7, "Manhattan Tasty China House", true),               // 11
         new Tuple <int, string, bool> (8, "Manhattan Dominos", true),                         // 12
         new Tuple <int, string, bool> (8, "Lawrence Dominos", true),                          // 13
     };
     foreach (Tuple <int, string, bool> rest in rests)
     {
         rr.CreateRestaurant(rest.Item1, rest.Item2, rest.Item3);
     }
 }
コード例 #2
0
        public cDataBaseForm()
        {
            _org       = new OrganizationRepo();
            _rest      = new RestaurantRepository();
            _food      = new FoodRepo();
            _jobs      = new JobsRepo();
            _stock     = new StockItemsRepo();
            _emp       = new EmployeeRepo();
            _suppliers = new SuppliersRepo();
            Init_Tables init = new Init_Tables();

            InitializeComponent();

            cRestOrgComboBox.Items.Clear();

            init.initOrgs(_org);
            init.initRests(_rest);
            init.initJobs(_jobs);
            init.initSupps(_suppliers);
            init.initFoods(_food);
            init.initStockItems(_stock);

            IReadOnlyList <Organization> orgs  = _org.RetrieveOrganizations();
            IReadOnlyList <Restaurant>   rests = _rest.RetrieveRestaurants();
            IReadOnlyList <Jobs>         jobs  = _jobs.RetrieveJobs();

            init.initEmp(_emp, rests, jobs);
            IReadOnlyList <Employee>  emps       = _emp.RetrieveEmployee();
            IReadOnlyList <Supplier>  supps      = _suppliers.RetrieveSuppliers();
            IReadOnlyList <Food>      foods      = _food.RetrieveFood();
            IReadOnlyList <StockItem> stockItems = _stock.RetrieveStockItems();

            foreach (var org in orgs)
            {
                cRestOrgComboBox.Items.Add(org.OrganizationName);
                orgListBox.Items.Add(org.OrganizationName);
                cSelectOrgExpendComboBox.Items.Add(org.OrganizationName);
            }
            foreach (var rest in rests)
            {
                cEmployRestComboBox.Items.Add(rest.RestaurantName);
                restListBox.Items.Add(rest.RestaurantName);
                cInventoryRestComboBox.Items.Add(rest.RestaurantName);
                cSelectRestExpendComboBox.Items.Add(rest.RestaurantName);
                cSelectRestEmpInfoComboBox.Items.Add(rest.RestaurantName);
            }
            foreach (var emp in emps)
            {
                empListBox.Items.Add(emp.EmployeeName);
            }
            foreach (var job in jobs)
            {
                jobsListBox.Items.Add(job.JobName);
                cEmployJobTitleComboBox.Items.Add(job.JobName);
            }
            foreach (var supp in supps)
            {
                suppListBox.Items.Add(supp.SuppliersName);
                cFoodSupplierComboBox.Items.Add(supp.SuppliersName);
                cSelectSupplierSalesComboBox.Items.Add(supp.SuppliersName);
            }
            foreach (var food in foods)
            {
                foodListBox.Items.Add(food.FoodName);
                cInventoryFoodComboBox.Items.Add(food.FoodName);
            }
            foreach (var si in stockItems)
            {
                invListBox.Items.Add(_rest.GetRestaurantByID(si.RestaurantID).RestaurantName + ": " + _food.GetFoodByID(si.FoodID).FoodName);
            }
        }