Ejemplo n.º 1
0
        private void g1_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            texnika poluch = new texnika();

            poluch = Lb_spis_tex.SelectedItem as texnika;
            Grid_select(poluch);
        }
Ejemplo n.º 2
0
        string str_sobr(List <texnika> array_vibr_tex)
        {
            string t = "";

            for (int i = 0; i < array_vibr_tex.Count; i++)
            {
                texnika otvet_massiv = (array_vibr_tex[i]);

                string name = "";

                if (otvet_massiv.Article == "***" || otvet_massiv.Article == "15R***" || otvet_massiv.Article == "SAD***" || otvet_massiv.Article == "*")
                {
                    name = otvet_massiv.TName.Replace(',', '@').Replace(';', '$');
                }



                t += otvet_massiv.type.Replace(',', '@').Replace(';', '$') + "~" +
                     otvet_massiv.Article.Replace(',', '@').Replace(';', '$') + "~" +
                     otvet_massiv.kolvo.ToString().Replace(',', '.').Replace(';', '$') + "~" +
                     otvet_massiv.OTD.Replace(',', '@').Replace(';', '$') + "~" +
                     otvet_massiv.Prim.Replace(',', '@').Replace(';', '$') + "~" +
                     otvet_massiv.GROUP_dlyaspicif.Replace(',', '@').Replace(';', '$') + "~" +
                     otvet_massiv.nom_pp.ToString().Replace(',', '@').Replace(';', '$') + "~" +
                     name + "~" +
                     otvet_massiv.UnitsName.Replace(',', '@').Replace(';', '$') + "~" +
                     otvet_massiv.priceredak.ToString().Replace(',', '.').Replace(';', '$') + ";";
                //      MessageBox.Show(text_otvet);
            }
            return(t);
        }
Ejemplo n.º 3
0
 private void g1_KeyUp(object sender, KeyEventArgs e)
 {
     if (g1_KeyUp_bool)
     {
         if (e.Key == Key.Enter)
         {
             texnika poluch = new texnika();
             poluch = Lb_spis_tex.SelectedItem as texnika;
             Grid_select(poluch);
         }
         g1_KeyUp_bool = false;
     }
 }
Ejemplo n.º 4
0
        private bool FindComputer(texnika bk)
        {
            if (bk.Article == (Lb_spis_tex.SelectedItem as texnika).Article && bk.OTD == "" && bk.Prim == "")
            {//если у сущ поз артикул совп с артик и (прим или отделка есть)
                index_for_poisl = bk;

                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 5
0
        private void Button_Click_5(object sender, RoutedEventArgs e)
        {
            string t = "";

            for (int i = 0; i < array_vibr_tex.Count; i++)
            {
                texnika otvet_massiv = ((texnika)array_vibr_tex[i]);

                string name = "";

                if (otvet_massiv.Article == "***" || otvet_massiv.Article == "15R***" || otvet_massiv.Article == "SAD***" || otvet_massiv.Article == "*")
                {
                    name = otvet_massiv.TName.Replace(',', '@').Replace(';', '$');
                }



                t += otvet_massiv.type.Replace(',', '@').Replace(';', '$') + "~" +
                     otvet_massiv.Article.Replace(',', '@').Replace(';', '$') + "~" +
                     otvet_massiv.kolvo.ToString().Replace(',', '.').Replace(';', '$') + "~" +
                     otvet_massiv.OTD.Replace(',', '@').Replace(';', '$') + "~" +
                     otvet_massiv.Prim.Replace(',', '@').Replace(';', '$') + "~" +
                     otvet_massiv.GROUP_dlyaspicif.Replace(',', '@').Replace(';', '$') + "~" +
                     otvet_massiv.nom_pp.ToString().Replace(',', '@').Replace(';', '$') + "~" +
                     name + "~" +
                     otvet_massiv.UnitsName.Replace(',', '@').Replace(';', '$') + "~" +
                     otvet_massiv.priceredak.ToString().Replace(',', '.').Replace(';', '$') + ";";
                //      MessageBox.Show(text_otvet);
            }



            Clipboard.SetText(t);



            MessageBox.Show("Теперь зайдите в кубик в другом проекте и нажмите кнопку \"2.Вставить\"");
            Closinger();
        }
Ejemplo n.º 6
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;
                }
            }
        }
Ejemplo n.º 7
0
        void pars(string vh_str)
        {
            array_vibr_tex = new List <texnika>();
            string[] elems = vh_str.Split(';');

            log.Add("запуск цикла парсим");
            log.Add("входная строка " + vh_str);
            for (int i = 0; i < elems.Count(); i++)
            {
                if (elems[i] != "")
                {
                    log.Add("строка " + elems[i]);
                    string[] znach = elems[i].Split('~');

                    string name;

                    if (Convert.ToInt32(znach[6]) > nom_PP)
                    {
                        nom_PP = Convert.ToInt32(znach[6]);
                    }

                    texnika poluch = new texnika();
                    try
                    {
                        string article = znach[1].Replace('@', ',').Replace('$', ';');
                        if (article == "***" || article == "*" || article == "15R***" || article == "SAD***")
                        {
                            name = znach[7].Replace('@', ',').Replace('$', ';');
                        }
                        else
                        {
                            name = (array_spis_tex.Find(x => x.Article.Equals(znach[1].Replace('@', ',').Replace('$', ';')))).TName;
                        }
                        //t-техника a-аксесуар



                        texnika poluch1 = new texnika();
                        poluch1 = (array_spis_tex.Find(x => x.Article.Equals(article.Replace('@', ',').Replace('$', ';'))));



                        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.TName     = name;
                        // poluch.Prim = znach[4].Replace('@', ',').Replace('$', ';');//примечание
                        poluch.colortext = "x:Null";
                    }
                    catch
                    {
                        poluch.TName   = znach[7].Replace('@', ',').Replace('$', ';');
                        poluch.Article = znach[1].Replace('@', ',').Replace('$', ';');
                        // poluch.Prim = "!Артикула нет в базе!".Replace('@', ',').Replace('$', ';');//примечание
                        //  poluch.Prim = znach[4].Replace('@', ',').Replace('$', ';');//примечание
                        poluch.colortext        = "#FFDE0606";
                        poluch.GROUP_dlyaspicif = "";
                        poluch.UnitsName        = "";
                    }
                    if (znach.Length > 4)
                    {
                        poluch.Prim = znach[4].Replace('@', ',').Replace('$', ';');//примечание
                    }
                    else
                    {
                        poluch.Prim = "";
                    }
                    poluch.OTD        = znach[3].Replace('@', ',').Replace('$', ';');                                     //отделка
                    poluch.type       = znach[0].Replace('@', ',').Replace('$', ';');                                     //типп аксес или техн
                    poluch.kolvo      = Convert.ToSingle(znach[2].Replace('@', ',').Replace('.', ',').Replace('$', ';')); //Колво
                    poluch.priceredak = Convert.ToSingle(znach[9].Replace('@', ',').Replace('.', ',').Replace('$', ';')); //цена ред


                    // poluch.GROUP_dlyaspicif = znach[5].Replace('@', ',');//группа специфик
                    if (array_vibr_tex.Find(x => x.nom_pp.Equals(Convert.ToInt32(znach[6].Replace('@', ',').Replace('$', ';')))) == null)
                    {
                        poluch.nom_pp = Convert.ToInt32(znach[6].Replace('@', ',').Replace('$', ';'));//ид позиция
                    }
                    else
                    {
                        nom_PP++;
                        poluch.nom_pp = nom_PP;
                    }

                    array_vibr_tex.Add(poluch);
                }
            }
            log.Add("закончили парсить установим в гр3");
            lb_vibr_tex.ItemsSource = null;
            lb_vibr_tex.ItemsSource = array_vibr_tex;
        }
Ejemplo n.º 8
0
        public dial_for_acctex(texnika item)
        {
            InitializeComponent();


            otvet = item;

            //   MessageBox.Show(otvet.OTD);

            viewSource1         = new CollectionViewSource();
            viewSource1.Source  = TAccessories.otdelka_array;
            viewSource1.Filter += viewSource_Filter1;
            viewSource1.SortDescriptions.Add(new SortDescription("nameotd", ListSortDirection.Ascending));

            combo1.ItemsSource = viewSource1.View;



            //  combo1.ItemsSource = TAccessories.otdelka_array;
            combo2.ItemsSource = TAccessories.izmer;

            timer.Tick    += new EventHandler(timerTick);
            timer.Interval = new TimeSpan(0, 0, 0, 0, 500);



            rsktblo1_Copy.Text = otvet.Article;
            rsktb1.Text        = otvet.nom_pp.ToString();
            rsktb2.Text        = otvet.TName;
            rsktb3.Text        = otvet.kolvo.ToString();


            INIManager client_man = new INIManager(Environment.CurrentDirectory + @"\ecadpro.ini");
            string     admin      = client_man.GetPrivateString("giulianovars", "3dsadmin");//версия клиента

            //  MessageBox.Show("путь к ини" + sdsd + @"\ecadpro.ini");
            lb_TKOEFGROUP_ID.Visibility = Visibility.Hidden;
            if (admin == "1")
            {
                lb_TKOEFGROUP_ID.Visibility = Visibility.Visible;
                lb_TKOEFGROUP_ID.Text       = otvet.GROUP_dlyaspicif.ToString();
            }


            rsktb4.Text = otvet.Prim;

            rsktb3_Copy.Text  = otvet.baseprice.ToString();
            rsktb3_Copy1.Text = otvet.priceredak.ToString();

            combo1.SelectedIndex = (TAccessories.otdelka_array.FindIndex(x => x.ID.Equals(otvet.OTD)));
            combo2.SelectedIndex = (TAccessories.izmer.FindIndex(x => x.ID.Equals(otvet.UnitsName)));



            if (otvet.Article == "***" || otvet.Article == "*" || otvet.Article == "15R***" || otvet.Article == "SAD***")
            {//если
            }
            else
            {
                rsktb2.IsReadOnly      = true;
                rsktb2.Foreground      = Brushes.Gray;
                rsktb3_Copy.IsReadOnly = true;
                rsktb3_Copy.Foreground = Brushes.Gray;
                combo2.IsEnabled       = false;
            }
        }