예제 #1
0
        public static Compare_Pare_Mas get_base_elements(int ownerID, int OSiD)//--
        {
            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,itemtable.Status2 from itemtable where (itemtable.Owner=" + ownerID + " and itemtable.OS=" + OSiD + ")";
            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.SQL_DataReader.GetDateTime(16);
                el.Status2id = 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();
                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);
        }
예제 #3
0
        void load_data()
        {
            string zap = "select ID, ItemID, Log, Date, Who from logs where ItemID=" + ID;

            log_dgv.DataSource = FuncClass.get_dataTable(zap);
            doc_dgv.RowCount   = SQL_Class.ReadValueInt32("select count(*) from Documents where ItemID=" + ID);
            SQL_Class cl = new SQL_Class();

            cl.ReadValues("select ID, Name from documents where ItemID=" + ID);

            int i = 0;

            while (cl.SQL_DataReader.Read())
            {
                doc_dgv.Rows[i].Cells[0].Value = cl.get_int(0);
                doc_dgv.Rows[i].Cells[1].Value = cl.get_string(1);
                i++;
            }
        }
예제 #4
0
        public void load_info()
        {
            int count = SQL_Class.ReadValueInt32("Select Count(*) from " + TableName);

            dgv.RowCount = count + 1;
            string    zap = "Select ID," + FName + " from " + TableName;
            SQL_Class cl  = new SQL_Class();

            cl.ReadValues(zap);

            int i = 0;

            while (cl.SQL_DataReader.Read())
            {
                dgv.Rows[i].Cells[0].Value = cl.get_int(0);
                dgv.Rows[i].Cells[1].Value = cl.SQL_DataReader.GetValue(1);
                i++;
            }
            cl.Manualy_Close_Connection2();
        }
예제 #5
0
        public void Load_Element(int id)
        {
            string    zap = tbl.make_Read_Queue_For_Edit_Form(tbl.Table_Name + ".ID=" + id);
            SQL_Class cl  = new SQL_Class();

            cl.ReadValues(zap);
            cl.SQL_DataReader.Read();
            for (int i = 0; i < tbl.el_list.Count; i++)
            {
                if (tbl.el_list[i].cmbox)
                {
                    int index = cl.get_int(i);
                    ((ComboBox)fill_elements[i]).SelectedIndex = index;
                }
                else
                {
                    ((TextBox)fill_elements[i]).Text = cl.get_string(i);
                }
            }
            cl.Manualy_Close_Connection2();
        }