Пример #1
0
        private void buttonAddWareHouse_Click(object sender, EventArgs e)
        {
            int idProduct = (comboBoxProductWareHouse.SelectedItem as ProductDTO).Id;
            int amount    = Convert.ToInt32(numericUpDownAmountWareHouse.Value);

            WareHouseDTO wareHouseDTO = new WareHouseDTO();

            wareHouseDTO.IdProduct = idProduct;
            wareHouseDTO.Amount    = amount;
            service.addWareHouse(wareHouseDTO);
            loadWareHouse();
        }
Пример #2
0
        private void textBoxIdWareHouse_TextChanged(object sender, EventArgs e)
        {
            if (!textBoxIdWareHouse.Text.Equals("0") && !textBoxIdWareHouse.Text.Equals(""))
            {
                int          idWareHouse  = Convert.ToInt32(textBoxIdWareHouse.Text);
                WareHouseDTO wareHouseDTO = service.getWareHouseById(idWareHouse);

                int index = -1;
                int i     = 0;
                foreach (ProductDTO item in comboBoxProductWareHouse.Items)
                {
                    if (item.Id == wareHouseDTO.IdProduct)
                    {
                        index = i;
                        break;
                    }
                    i++;
                }
                comboBoxProductWareHouse.SelectedIndex = index;
            }
        }
Пример #3
0
 public void create(WareHouseDTO wareHouse)
 {
     wareHouseRepository.create(mapper.Map <WareHouseDTO, Warehouse>(wareHouse));
 }
Пример #4
0
 public void addWareHouse(WareHouseDTO wareHouse)
 {
     wareHoureService.create(wareHouse);
 }