public AllProductForm(OrderCreateVO orderCreate) { InitializeComponent(); Loaded += AllProductForm_Loaded; vo = orderCreate; }
public Order InsertData(OrderCreateVO data) { var order = new Order() { Code = data.Code, CreatedAt = data.CreatedAt, UpdatedAt = data.UpdatedAt, TotalAmount = data.TotalAmount, Address = data.Address, }; var orderInsert = _orderDAO.insert(order); var checkClient = _clientDAO.findByPhoneNumber(data.client.PhoneNumber); if (checkClient != null) { order.ClientID = checkClient.ID; } else { var client = _clientBus.insertData(data.client); order.ClientID = client.ID; } var checkOrderStatus = _orderStatusDAO.getByValue(data.Status); if (checkOrderStatus != null) { order.StatusID = checkOrderStatus.ID; } for (int i = 0; i < data.orderProductVOs.Count(); i++) { var orderProduct = new OrderProduct() { Amount = data.orderProductVOs[i].Amount, ProductID = data.orderProductVOs[i].ProductID, Name = data.orderProductVOs[i].Name, TotalAmount = data.orderProductVOs[i].TotalAmount, CreatedAt = data.orderProductVOs[i].CreatedAt, UpdatedAt = data.orderProductVOs[i].UpdatedAt, Quantity = data.orderProductVOs[i].Quantity, OrderID = orderInsert.ID }; _productDAO.updateQuantityById(orderProduct.ProductID, orderProduct.Quantity); orderInsert.OrderProducts.Add(orderProduct); } var orderUpdate = _orderDAO.update(orderInsert); return(orderUpdate); }
private void ActionStatusOrder() { if (OrderState.Action == 1) { this.Mode.Text = "Xem đơn hàng"; EnableForm(0); } else if (OrderState.Action == 2) { if (isAction == true) { var reuslt = MessageBox.Show("Bạn đang thực hiện một hành động khác, bạn muốn hủy bỏ ngay?", "Thông báo", MessageBoxButton.YesNo); if (reuslt == MessageBoxResult.No) { return; } } if (OrderHistoryLV.SelectedIndex == -1) { MessageBox.Show("Chọn sản phẩm để chỉnh sửa!"); return; } var order = OrderHistoryLV.SelectedItem as Order; this.Mode.Text = "Cập nhật đơn hàng"; EnableForm(1); orderAction.PassValue(order); } else { if (isAction == true) { var reuslt = MessageBox.Show("Bạn đang thực hiện một hành động khác, bạn muốn hủy bỏ ngay?", "Thông báo", MessageBoxButton.YesNo); if (reuslt == MessageBoxResult.No) { return; } } this.Mode.Text = "Tạo đơn hàng"; if (isAction == true) { MessageBox.Show("Bạn đang tạo đơn hàng rồi!"); return; } EnableForm(1); OrderCreateVO orderSelected = new OrderCreateVO(); orderAction.PassValue(orderSelected); } }
public UCAllProduct(OrderCreateVO orderCreateVo) { InitializeComponent(); Loaded += UCAllProduct_Loaded; btnNext.Click += BtnNext_Click; btnPrevius.Click += BtnPrevius_Click; ProductLV.SelectionChanged += ProductLV_SelectionChanged; ProductLV.PreviewMouseDown += ProductLV_PreviewMouseDown; this.btnDone.Click += BtnDone_Click; this.btnCancel.Click += BtnCancel_Click; this.tbQuantity.TextChanged += TbQuantity_TextChanged; this.tbQuantity.PreviewTextInput += TbQuantity_PreviewTextInput; tbFindProduct.TextChanged += TbFindProduct_TextChanged; quantity = 0; productSelected = null; vo = orderCreateVo; }
public Order InsertData(OrderCreateVO data, List <OrderProductCreateVO> products) { throw new NotImplementedException(); }
public Order update(OrderCreateVO data) { throw new NotImplementedException(); }