Ejemplo n.º 1
0
        private void imgAddProduct_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                var window = new W_AddProductForOrder()
                {
                    Title         = "Siparise Urun Ekle",
                    ShowInTaskbar = false,
                    Topmost       = true,
                    ResizeMode    = ResizeMode.CanMinimize,
                    Owner         = Application.Current.MainWindow,
                };
                if (window.ShowDialog() == false)
                {
                    BLL.Product AddedProduct = window.AddedProduct;
                    if (AddedProduct != null)
                    {
                        if (IfExistsSameProductOrNot(AddedProduct))
                        {
                            MessageBox.Show("Seçmiş olduğunuz yay zaten siparişte mevcut!!");
                        }
                        else
                        {
                            this.oNewAddedProductList.Add(AddedProduct);
                            this.oProductList.Add(AddedProduct);
                            dgOrderProduct.Items.Add(AddedProduct);
                            CalculateTotalProductionTimeForNewProduct(AddedProduct);

                            dgOrderProduct.Items.Refresh();
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void btnExamineProduct(object sender, RoutedEventArgs e)
        {
            var window = new W_AddProductForOrder(dgOrderProduct.SelectedValue as BLL.Product)
            {
                Title         = "Siparise Yay Ekle",
                ShowInTaskbar = false,
                Topmost       = true,
                ResizeMode    = ResizeMode.CanMinimize,
                Owner         = Application.Current.MainWindow,
            };

            if (window.ShowDialog() == false)
            {
                SelectedProduct = window.AddedProduct;
                if (SelectedProduct != null)
                {
                    dgOrderProduct.Items.Remove(dgOrderProduct.SelectedItem);
                    dgOrderProduct.Items.Add(SelectedProduct);
                    CalculateTotalProductionTime(SelectedProduct);
                }
            }
        }