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 List <string> get_data_Source(string queue) { List <string> lst = new List <string>(); SQL_Class cl = new SQL_Class(); cl.ReadValues(queue); while (cl.SQL_DataReader.Read()) { lst.Add(cl.get_string(0)); } return(lst); }
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); }
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++; } }
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(); }
public static ComboBox PrepareComboBox(ComboBox inp, Element el, string MainTable) { List <string> ds = new List <string>(); SQL_Class cl = new SQL_Class(); string zap = "select " + el.name + " from "; if (el.cmbox) { zap += el.addtable; } else { zap += MainTable; } cl.ReadValues(zap); while (cl.SQL_DataReader.Read()) { ds.Add(cl.get_string(0)); } cl.Manualy_Close_Connection2(); inp.DataSource = ds; return(inp); }