Example #1
0
        private void Window_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter && Keyboard.Modifiers == ModifierKeys.Control)
            {
                zakrit_ok = true;
                Closinger();
            }

            if (e.Key == Key.F1)
            {
                if (lb_vibr_tex.SelectedIndex != -1)
                {
                    dial_for_acctex dial_for_acctex1 = new dial_for_acctex((lb_vibr_tex.SelectedItem as texnika));
                    dial_for_acctex1.ShowDialog();

                    lb_vibr_tex.SelectedItem = dial_for_acctex1.otvet;
                    lb_vibr_tex.ItemsSource  = null;
                    lb_vibr_tex.ItemsSource  = array_vibr_tex;
                }
                else
                {
                    MessageBox.Show("Сначала выберите элемент, который необходимо редактировать, затем нажмите эту кнопку снова");
                }
            }
        }
Example #2
0
        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            if (lb_vibr_tex.SelectedIndex != -1)
            {
                dial_for_acctex dial_for_acctex1 = new dial_for_acctex((lb_vibr_tex.SelectedItem as texnika));
                dial_for_acctex1.ShowDialog();

                lb_vibr_tex.SelectedItem = dial_for_acctex1.otvet;
                lb_vibr_tex.ItemsSource  = null;
                lb_vibr_tex.ItemsSource  = array_vibr_tex;
            }
            else
            {
                MessageBox.Show("Сначала выбирите элемент, который необходимо редактировать, затем нажмите эту кнопку снова");
            }
        }
Example #3
0
        void Grid_select(texnika poluch1)
        {
            if (poluch1.GRAFIKA != "0")
            {
                MessageBox.Show(poluch1.Article + " " + poluch1.TName + " можно добавить только в графическом исполнении (искать в дереве объектов)");

                return;
            }

            List <texnika> kotor_v_gr3 = array_vibr_tex.FindAll(FindComputer);


            texnika poluch = new texnika();

            poluch.Article          = poluch1.Article;
            poluch.baseprice        = poluch1.baseprice;
            poluch.Group            = poluch1.Group;
            poluch.GroupName        = poluch1.GroupName;
            poluch.GROUP_dlyaspicif = poluch1.GROUP_dlyaspicif;
            poluch.ID         = poluch1.ID;
            poluch.kolvo      = poluch1.kolvo;
            poluch.nom_pp     = poluch1.nom_pp;
            poluch.OTD        = poluch1.OTD;
            poluch.priceredak = poluch1.priceredak;
            poluch.Prim       = poluch1.Prim;
            poluch.sort       = poluch1.sort;
            poluch.TName      = poluch1.TName;
            poluch.type       = poluch1.type;
            poluch.UnitsId    = poluch1.UnitsId;
            poluch.UnitsName  = poluch1.UnitsName;
            poluch.vived      = poluch1.vived;
            poluch.colortext  = poluch1.colortext;



            lb_vibr_tex.SelectedItem = index_for_poisl;
            if (kotor_v_gr3.Count <= 0)
            {//если такой нет
                //добавить новую строку
                nom_PP++;
                poluch.nom_pp = nom_PP;
                array_vibr_tex.Add(poluch);
                lb_vibr_tex.ItemsSource = null;
                lb_vibr_tex.ItemsSource = array_vibr_tex;

                //   g3.Style = DataGridViewTriState.True;
            }
            else
            {//если такая уже есть
                dial_for_acctex_danet dial_for_acctex_danet = new dial_for_acctex_danet(this);
                dial_for_acctex_danet.ShowDialog();
                if (redakilidob == 1)
                {
                    //добавить новую строку
                    nom_PP++;
                    poluch.nom_pp = nom_PP;
                    array_vibr_tex.Add(poluch);
                    lb_vibr_tex.ItemsSource = null;
                    lb_vibr_tex.ItemsSource = array_vibr_tex;
                }
                if (redakilidob == 2)
                {
                    dial_for_acctex dial_for_acctex1 = new dial_for_acctex((lb_vibr_tex.SelectedItem as texnika));
                    dial_for_acctex1.ShowDialog();



                    //   kotor_v_gr3.Last().kolvo++;//увеличиваем на 1
                    lb_vibr_tex.ItemsSource = null;
                    lb_vibr_tex.ItemsSource = array_vibr_tex;
                }
            }
        }