Interaction logic for WindowHowMuch.xaml
Inheritance: System.Windows.Window
        private void ButtonAddRemove_Click(object sender, RoutedEventArgs e)
        {
            if (ButtonAddRemove.Content.ToString() == "Добавить")
            {
                WindowHowMuch windowHowMuch = new WindowHowMuch();
                windowHowMuch.ShowDialog();

                if (windowHowMuch.DialogResult.HasValue && windowHowMuch.DialogResult.Value)
                {
                    if (listViewCompany.SelectedItem != null)
                    {
                        foreach (CompanyProduct cp in (listViewCompany.SelectedItem as Company).CompanyProducts)
                        {
                            Tuple<int, string, int> item = new Tuple<int, string, int>(cp.Product, cp.Product1.Name, windowHowMuch.Result * cp.ProuctsNumber);
                            listViewProductsLists.Items.Add(item);
                        }
                        
                    }
                }
            }
            else
            {
                listViewProductsLists.Items.Remove(listViewProductsLists.SelectedItem);
            }
        }
        private void ButtonAddRemove_Click(object sender, RoutedEventArgs e)
        {
            if (ButtonAddRemove.Content.ToString() == "Добавить")
            {
                WindowHowMuch windowHowMuch = new WindowHowMuch();
                windowHowMuch.ShowDialog();

                if (windowHowMuch.DialogResult.HasValue && windowHowMuch.DialogResult.Value)
                {
                    if (listViewItems.SelectedItem != null)
                    {
                        Tuple <int, string, int> item = new Tuple <int, string, int>((listViewItems.SelectedItem as Item).ID, (listViewItems.SelectedItem as Item).Name, windowHowMuch.Result);
                        listViewStructure.Items.Add(item);
                    }
                }
            }
            else
            {
                listViewStructure.Items.Remove(listViewStructure.SelectedItem);
            }
        }
        private void ButtonAddRemove_Click(object sender, RoutedEventArgs e)
        {
            if (ButtonAddRemove.Content.ToString() == "Добавить")
            {
                WindowHowMuch windowHowMuch = new WindowHowMuch();
                windowHowMuch.ShowDialog();

                if (windowHowMuch.DialogResult.HasValue && windowHowMuch.DialogResult.Value)
                {
                    if (listViewItems.SelectedItem != null)
                    {
                        Tuple<int, string, int> item = new Tuple<int, string, int>((listViewItems.SelectedItem as Item).ID, (listViewItems.SelectedItem as Item).Name, windowHowMuch.Result);
                        listViewStructure.Items.Add(item);
                    }
                }
            }
            else
            {
                listViewStructure.Items.Remove(listViewStructure.SelectedItem);
            }
        }
Beispiel #4
0
        private void ButtonAddRemove_Click(object sender, RoutedEventArgs e)
        {
            if (ButtonAddRemove.Content.ToString() == "Добавить")
            {
                WindowHowMuch windowHowMuch = new WindowHowMuch();
                windowHowMuch.ShowDialog();

                if (windowHowMuch.DialogResult.HasValue && windowHowMuch.DialogResult.Value)
                {
                    if (listViewCompany.SelectedItem != null)
                    {
                        foreach (CompanyProduct cp in (listViewCompany.SelectedItem as Company).CompanyProducts)
                        {
                            Tuple <int, string, int> item = new Tuple <int, string, int>(cp.Product, cp.Product1.Name, windowHowMuch.Result * cp.ProuctsNumber);
                            listViewProductsLists.Items.Add(item);
                        }
                    }
                }
            }
            else
            {
                listViewProductsLists.Items.Remove(listViewProductsLists.SelectedItem);
            }
        }