private void Button_Click_1(object sender, RoutedEventArgs e) { tmpOrderProduct = new OrderProduct(); tmpOrderProduct.Product_id = 6; tmpOrderProduct.Order_id = 1; /// Correct id get in MainWindow OrderProductDetails orderProductDetails = new OrderProductDetails(dataBaseAC, tmpOrderProduct); if (orderProductDetails.ShowDialog() == true) { //MessageBox.Show(orderProductDetails.productCounts[6].ToString()); tmpOrderProductsMLesa = orderProductDetails.OrderProducts; mLesaCountLbl.Content = tmpOrderProductsMLesa[0].Count; int prodId; prodId = tmpOrderProductsMLesa[1].Product_id; mLesaSubNameLbl1.Content = dataBaseAC.Products.Find(prodId).Name; mLesaSubCountLbl1.Content = tmpOrderProductsMLesa[1].Count; prodId = tmpOrderProductsMLesa[2].Product_id; mLesaSubNameLbl2.Content = dataBaseAC.Products.Find(prodId).Name; mLesaSubCountLbl2.Content = tmpOrderProductsMLesa[2].Count; prodId = tmpOrderProductsMLesa[3].Product_id; mLesaSubNameLbl3.Content = dataBaseAC.Products.Find(prodId).Name; mLesaSubCountLbl3.Content = tmpOrderProductsMLesa[3].Count; AcceptBtn.IsEnabled = true; } }
private void Button_Click_3(object sender, RoutedEventArgs e) { tmpOrderProduct = new OrderProduct(); tmpOrderProduct.Product_id = 4; tmpOrderProduct.Order_id = 1; OrderProductDetails orderProductDetails = new OrderProductDetails(dataBaseAC, tmpOrderProduct); if (orderProductDetails.ShowDialog() == true) { //MessageBox.Show(orderProductDetails.productCounts[4].ToString()); tmpOrderProductsKoles = orderProductDetails.OrderProducts; kolesikCountLbl.Content = tmpOrderProductsKoles[0].Count; AcceptBtn.IsEnabled = true; } }
private void Button_Click_2(object sender, RoutedEventArgs e) { OtherProductListItem otherProductListItem = new OtherProductListItem(); ProductList productList = new ProductList(dataBaseAC, true); if (productList.ShowDialog() == true) { tmpOrderProduct = new OrderProduct(); tmpOrderProduct.Product_id = productList.SelectedProduct.Id; tmpOrderProduct.Order_id = 1; /// Correct id get in MainWindow OrderProductDetails orderProductDetails = new OrderProductDetails(dataBaseAC, tmpOrderProduct); if (orderProductDetails.ShowDialog() == true) { otherProductListItem.Name = dataBaseAC.Products.Find(orderProductDetails.OrderProducts[0].Product_id).Name; otherProductListItem.Count = orderProductDetails.OrderProducts[0].Count; otherProductListItem.Price = orderProductDetails.OrderProducts[0].Count * orderProductDetails.OrderProducts[0].Price; otherProductListItems.Add(otherProductListItem); tmpOrderProductsOther.Add(orderProductDetails.OrderProducts[0]); otherProductListBox.ItemsSource = otherProductListItems; otherProductListBox.Items.Refresh(); AcceptBtn.IsEnabled = true; } } }