private void BtnSave_Click(object sender, RoutedEventArgs e) { try { ProductDto productDto = new ProductDto(); productDto.Count = int.Parse(tbCount.Text); productDto.Importer = tbImporter.Text; productDto.MRC = double.Parse(tbMrc.Text); productDto.Price = double.Parse(tbPrice.Text); productDto.Reserve = int.Parse(tbReserve.Text); productDto.Title = tbTitle.Text; IProductProcess productProcess = ProcessFactory.GetProductProcess(); if (_id == 0) { productProcess.Add(productDto); } else { productDto.ID = _id; productProcess.Update(productDto); } this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
public HandlerClick(IProductProcess productProcess, ICheckLast checkLast, IProductAdapter productAdapter, IProducerService producerService, WSS.Service.Report.ProductOnClick.Error.Model.ISettingRepository settingRepository, ICheckLinkValid checkLinkValid) { _productProcess = productProcess; _checkLast = checkLast; _productAdapter = productAdapter; _producerService = producerService; _checkLinkValid = checkLinkValid; _producer = new ProducerBasic(RabbitMQManager.GetRabbitMQServer(settingRepository.RabbitMq), "Product.ErrorRequest"); }
private void BtnSave_Click(object sender, RoutedEventArgs e) { try { IProductProcess productProcess = ProcessFactory.GetProductProcess(); productProcess.AddCount(int.Parse(tbCount.Text), productProcess.GetID(cbTitle.SelectedItem.ToString()).ID); } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка.", MessageBoxButton.OK, MessageBoxImage.Error); } Close(); }