Esempio n. 1
0
        private void FillWarehouseComboBox()
        {
            List <Warehouse> warehouseList = new List <Warehouse>();

            warehouseList = warehouseRepositoryBus.GetAllWarehouses();
            foreach (var warehouse in warehouseList)
            {
                comboBoxWarehause.Items.Add(warehouse.Name);
            }
        }
Esempio n. 2
0
        public void InsertWarehouseInDatabase()
        {
            using (TransactionScope scope = new TransactionScope()) //auto roll back
            {
                int       brojac    = 0;
                Warehouse warehouse = new Warehouse();

                warehouse.Name       = "Random name";
                warehouse.LocationId = 1024;

                warehouseRepositoryBus.InsertWarehouse(warehouse);

                foreach (Warehouse categ in warehouseRepositoryBus.GetAllWarehouses())
                {
                    if (categ.Name == warehouse.Name && categ.LocationId == warehouse.LocationId)
                    {
                        brojac++;
                    }
                }
                Assert.AreEqual(1, brojac);
            }
        }
Esempio n. 3
0
        private void InsertDataIntoTable()
        {
            ClearDataFromTable();
            List <Warehouse> warehouseList = new List <Warehouse>();

            warehouseList = warehouseRepository.GetAllWarehouses();
            foreach (var warehouse in warehouseList)
            {
                DataGridViewRow row = new DataGridViewRow();
                row.CreateCells(warehouseTable);
                row.Cells[0].Value = warehouse.Id;
                row.Cells[1].Value = warehouse.Name;
                row.Cells[2].Value = locationRepository.GetLocationNameById(warehouse.LocationId);
                warehouseTable.Rows.Add(row);
            }
        }