private void button1_Click(object sender, EventArgs e)
        {
            request_mas_of_base_elements();
            int        start     = Convert.ToInt32(start_Tbox.Text);
            int        stop      = Convert.ToInt32(stop_Tbox.Text);
            List <int> del_index = new List <int>();

            for (int i = start; i < stop; i++)
            {
                Compare_Element el      = Compare_Element.get_el_as_xls_el_for_cmp(mcl, i).CloneElement();
                string          serial2 = el.Serial2;
                int             index   = mas.Serial2_base.IndexOf(serial2);
                if (index != -1)
                {
                    Compare_Pare pr = mas.pre_mas[index].CloneComparePare();
                    pr.xls_el = el.CloneElement();
                    pr.check_equalence(Serial1_cm.Checked, Serial2_cm.Checked, Place_cm.Checked, Mark_cm.Checked, Date_cm.Checked, Prise_cm.Checked);
                    mas.dual_mas.Add(pr.CloneComparePare());



                    del_index.Add(index);
                }
                else
                {
                    Compare_Pare pr = new Compare_Pare();
                    pr.xls_el = el.CloneElement();
                    pr.check_equalence(Serial1_cm.Checked, Serial2_cm.Checked, Place_cm.Checked, Mark_cm.Checked, Date_cm.Checked, Prise_cm.Checked);
                    mas.xls_only_mas.Add(pr.CloneComparePare());
                }
            }
            for (int i = 0; i < mas.pre_mas.Count; i++)
            {
                if (!del_index.Contains(i))
                {
                    mas.pre_mas[i].check_equalence(Serial1_cm.Checked, Serial2_cm.Checked, Place_cm.Checked, Mark_cm.Checked, Date_cm.Checked, Prise_cm.Checked);
                    mas.base_only_mas.Add(mas.pre_mas[i]);
                }
            }

            mas.all_mas = new List <Compare_Pare>();
            mas.all_mas.AddRange(mas.dual_mas);
            mas.all_mas.AddRange(mas.xls_only_mas);
            mas.all_mas.AddRange(mas.base_only_mas);


            base_and_xls_dgv.Rows.Clear();
            base_only_dgv.Rows.Clear();
            xls_only_dgv.Rows.Clear();

            fill_dgv_with_list(mas.dual_mas, false, base_and_xls_dgv);
            fill_dgv_with_list(mas.xls_only_mas, true, xls_only_dgv);
            fill_dgv_with_list(mas.base_only_mas, false, base_only_dgv);


            all_lab.Text  += " " + (mas.base_only_mas.Count + mas.dual_mas.Count + mas.xls_only_mas.Count);
            full_lab.Text += " " + mas.dual_mas.Count;
            base_lab.Text += " " + mas.base_only_mas.Count;
            xls_lab.Text  += " " + mas.xls_only_mas.Count;
        }
        private void base_and_xls_dgv_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                Compare_Pare pr = mas.dual_mas[e.RowIndex];

                new ElementWorkForm(pr).Show();
            }
        }
Пример #3
0
 public ElementWorkForm()
 {
     InitializeComponent();
     prepare_CmBox();
     pr              = new Compare_Pare();
     pr.base_el      = null;
     pr.xls_el       = null;
     pr.full_pair    = false;
     Add_But.Visible = true;
 }
Пример #4
0
 public ElementWorkForm(Compare_Pare Pr)
 {
     InitializeComponent();
     prepare_CmBox();
     this.pr            = Pr;
     changed            = false;
     left_panel.Visible = false;
     up_panel.Visible   = false;
     load_data_from_pair();
 }
Пример #5
0
        public static Compare_Pare_Mas get_base_elements(int ownerID)//--
        {
            Compare_Pare_Mas rett = new Compare_Pare_Mas();
            string           zap  = "Select itemtable.ID,itemtable.Serial,itemtable.Serial2," +
                                    "itemtable.Mark,itemtable.Type,itemtable.Status,itemtable.Place," +
                                    "itemtable.Text,itemtable.Text2,itemtable.Text3,itemtable.Text4,itemtable.Text5,itemtable.Text6 " +
                                    ",itemtable.Place2, itemtable.Prise, itemtable.OS, itemtable.Date from itemtable where itemtable.Owner=" + ownerID;
            SQL_Class cl = new SQL_Class();

            cl.ReadValues(zap);


            while (cl.SQL_DataReader.Read())
            {
                Compare_Element el = new Compare_Element();

                el.ID = cl.get_int(0);

                el.Serial  = cl.get_string(1);
                el.Serial2 = cl.get_string(2);

                el.Markid   = cl.get_int(3);
                el.Typeid   = cl.get_int(4);
                el.Statusid = cl.get_int(5);
                el.Placeid  = cl.get_int(6);

                el.Place2id = cl.get_int(13);
                el.Prise    = cl.get_string(14);
                el.OSID     = cl.get_int(15);
                el.date     = cl.get_string(16);

                el.Text  = cl.get_string(7);
                el.Text2 = cl.get_string(8);
                el.Text3 = cl.get_string(9);
                el.Text4 = cl.get_string(10);
                el.Text5 = cl.get_string(11);
                el.Text6 = cl.get_string(12);


                el.read_other_names_base();
                Compare_Pare pare = new Compare_Pare();
                pare.base_el = el;
                rett.pre_mas.Add(pare);
                rett.Serial2_base.Add(el.Serial2);
            }
            cl.Manualy_Close_Connection2();


            for (int i = 0; i < rett.pre_mas.Count; i++)
            {
                rett.pre_mas[i].base_el.read_other_names_base();
            }

            return(rett);
        }
Пример #6
0
 public ElementWorkForm(Compare_Element el)
 {
     //edit
     InitializeComponent();
     prepare_CmBox();
     pr               = new Compare_Pare();
     pr.base_el       = el;
     pr.xls_el        = null;
     pr.full_pair     = false;
     up_panel.Visible = false;
     load_data_from_pair();
 }
Пример #7
0
        public ComparePareForm(Compare_Pare pr)
        {
            InitializeComponent();


            if (pr.base_el != null && pr.xls_el != null)
            {
                fill(t1, t11, pr.base_el.Serial, pr.xls_el.Serial, true);
                fill(t2, t22, pr.base_el.Serial2, pr.xls_el.Serial2, true);

                fill(t3, t33, pr.base_el.Markid, pr.xls_el.Markid, pr.base_el.Mark, pr.xls_el.Mark, true);
                fill(t4, t44, pr.base_el.Typeid, pr.xls_el.Typeid, pr.base_el.Type, pr.xls_el.Type, false);
                fill(t5, t55, pr.base_el.Placeid, pr.xls_el.Placeid, pr.base_el.Place, pr.xls_el.Place, true);
                fill(t6, t66, pr.base_el.Statusid, pr.xls_el.Statusid, pr.base_el.Status, pr.xls_el.Status, false);

                fill(t13, t113, pr.base_el.Place2id, pr.xls_el.Place2id, pr.base_el.Place2, pr.xls_el.Place2, false);

                if (pr.base_el.date != pr.xls_el.date)
                {
                    fill(t14, t114, 0, 1, pr.base_el.date.ToString(), pr.xls_el.date.ToString(), true);
                }
                else
                {
                    fill(t14, t114, 0, 0, pr.base_el.date.ToString(), pr.xls_el.date.ToString(), true);
                }

                if (pr.base_el.Prise != pr.xls_el.Prise)
                {
                    fill(t15, t115, 0, 1, pr.base_el.Prise.ToString(), pr.xls_el.Prise.ToString(), true);
                }
                else
                {
                    fill(t15, t115, 0, 0, pr.base_el.Prise.ToString(), pr.xls_el.Prise.ToString(), true);
                }


                fill(t7, pr.base_el.Text);
                fill(t8, pr.base_el.Text2);
                fill(t9, pr.base_el.Text3);
                fill(t10, pr.base_el.Text4);
                fill(t111, pr.base_el.Text5);
            }
            else
            {
                if (pr.base_el != null)
                {
                    fill(t1, pr.base_el.Serial);
                    fill(t2, pr.base_el.Serial2);

                    fill(t3, pr.base_el.Mark);
                    fill(t4, pr.base_el.Type);
                    fill(t5, pr.base_el.Place);
                    fill(t6, pr.base_el.Text);

                    fill(t13, pr.base_el.Place2);
                    fill(t14, pr.base_el.date.ToString());
                    fill(t15, pr.base_el.Prise.ToString());


                    fill(t7, pr.base_el.Text);
                    fill(t8, pr.base_el.Text2);
                    fill(t9, pr.base_el.Text3);
                    fill(t10, pr.base_el.Text4);
                    fill(t111, pr.base_el.Text5);
                }
                else
                {
                    fill(1, t11, pr.xls_el.Serial);
                    fill(1, t22, pr.xls_el.Serial2);

                    fill(1, t33, pr.xls_el.Mark);
                    fill(1, t44, pr.xls_el.Type);
                    fill(1, t55, pr.xls_el.Place);
                }
            }
        }