Пример #1
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);
        }
        public static Compare_Element get_Element(int id)
        {
            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, itemtable.Owner,itemtable.Status2 from itemtable where itemtable.ID=" + id;
            SQL_Class cl = new SQL_Class();

            cl.ReadValues(zap);

            Compare_Element el = null;

            while (cl.SQL_DataReader.Read())
            {
                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.SQL_DataReader.GetDateTime(16);
                el.Status2id = cl.get_int(18);
                el.OwnerID   = cl.get_int(17);
                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();
            }
            cl.Manualy_Close_Connection2();
            return(el);
        }