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(); }
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; } }
public void create(WareHouseDTO wareHouse) { wareHouseRepository.create(mapper.Map <WareHouseDTO, Warehouse>(wareHouse)); }
public void addWareHouse(WareHouseDTO wareHouse) { wareHoureService.create(wareHouse); }