public static Compare_Element get_el_as_xls_el_for_cmp(XLS_Class mcl, int i) //++11 { Compare_Element el = new Compare_Element(); el.Mark = mcl.read_val(i, Properties.Settings.Default.xls_Mark).ToString(); el.Type = mcl.read_val(i, Properties.Settings.Default.xls_Type).ToString(); el.Status = mcl.read_val(i, Properties.Settings.Default.xls_Status).ToString(); el.Status2 = ""; el.Place = mcl.read_val(i, Properties.Settings.Default.xls_Place).ToString(); el.Owner = mcl.read_val(i, Properties.Settings.Default.xls_Owner).ToString(); el.Serial = mcl.read_val(i, Properties.Settings.Default.xls_Serial).ToString(); el.Serial2 = mcl.read_val(i, Properties.Settings.Default.xls_Serial2).ToString(); el.Prise = (mcl.read_val(i, Properties.Settings.Default.xls_Prise)).ToString(); el.date = FuncClass.get_Date(mcl.read_val(i, Properties.Settings.Default.xls_Date).ToString()); el.OS = mcl.read_val(i, Properties.Settings.Default.xls_OS).ToString(); el.Place2 = mcl.read_val(i, Properties.Settings.Default.xls_Place2).ToString(); el.Status2id = RandomFull.get_rand_int(); el.read_other_xls(); return(el); }
public bool Check_and_Fill_DGV(XLS_Class xls, int start, int stop, int col, string table, string name) { disable_all_update(); List <string> lst = FuncClass.check(xls, start, stop, col, table, name, XLS_Rbut.Checked); Buffer.buffer = lst; DataGridViewComboBoxCell tmp = new DataGridViewComboBoxCell(); List <string> tmp2 = new List <string>(); tmp2.Add("----"); tmp2.AddRange(CMB.get_ordered_datasource(name, table)); tmp.DataSource = tmp2; dgv.Columns[1].CellTemplate = tmp; dgv.Rows.Clear(); dgv.RowCount = lst.Count; for (int i = 0; i < lst.Count; i++) { dgv.Rows[i].Cells[0].Value = lst[i]; } if (lst.Count != 0) { lab_but.Text = "Working with table :" + table; return(false); } else { lab_but.Text = ""; return(true); } }
public static Compare_Element get_el_as_base_el(XLS_Class mcl, int i)//++ { Compare_Element el = new Compare_Element(); el.Mark = mcl.read_val(i, Properties.Settings.Default.xls_Mark).ToString(); el.Type = mcl.read_val(i, Properties.Settings.Default.xls_Type).ToString(); el.Status = mcl.read_val(i, Properties.Settings.Default.xls_Status).ToString(); el.Place = mcl.read_val(i, Properties.Settings.Default.xls_Place).ToString(); el.Status2 = mcl.read_val(i, Properties.Settings.Default.xls_Status2).ToString(); el.Text = mcl.read_val(i, Properties.Settings.Default.xls_Text).ToString(); el.Text2 = mcl.read_val(i, Properties.Settings.Default.xls_Text2).ToString(); el.Text3 = mcl.read_val(i, Properties.Settings.Default.xls_Text3).ToString(); el.Text4 = mcl.read_val(i, Properties.Settings.Default.xls_Text4).ToString(); el.Text5 = mcl.read_val(i, Properties.Settings.Default.xls_Text5).ToString(); el.Serial = mcl.read_val(i, Properties.Settings.Default.xls_Serial).ToString(); el.Serial2 = mcl.read_val(i, Properties.Settings.Default.xls_Serial2).ToString(); el.Owner = mcl.read_val(i, Properties.Settings.Default.xls_Owner).ToString(); el.Prise = (mcl.read_val(i, Properties.Settings.Default.xls_Prise)).ToString(); el.date = FuncClass.get_Date(mcl.read_val(i, Properties.Settings.Default.xls_Date).ToString()); el.OS = mcl.read_val(i, Properties.Settings.Default.xls_OS).ToString(); el.Place2 = mcl.read_val(i, Properties.Settings.Default.xls_Place2).ToString(); el.read_other_ids_base(); return(el); }
private void st2_5_Click(object sender, EventArgs e) { Color cl = FuncClass.get_color_from_table(st2_5.BackColor); st2_5.BackColor = cl; Settings.Default.st_2_5 = cl; Settings.Default.Save(); Refresh(); }
} // for string public void reload_base_el() { changed = true; int id = pr.base_el.ID; Compare_Element el = FuncClass.get_Element(id); if (el != null) { pr.base_el = el; load_data_from_pair(); } }
private void dgv_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1) { if (dgv.Rows[e.RowIndex].Cells[0].Value != null) { //FormBuilder.Prepare_Form_To_Edit(tbl,new Point(50,50), Convert.ToInt32(dgv.Rows[e.RowIndex].Cells[0].Value)); ElementWorkForm frm = new ElementWorkForm(FuncClass.get_Element(Convert.ToInt32(dgv.Rows[e.RowIndex].Cells[0].Value))); frm.ShowDialog(); } } }
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 FormBuilder(Table inp, Point pnt, int id) { int q = 0, w = 0; tbl = inp; frm = new RedForm(id, this); fill_elements = new List <object>(tbl.el_list.Count); label_elements = new List <object>(tbl.el_list.Count); for (int i = 0; i < tbl.el_list.Count; i++) { label_elements.Add(new TextBox()); ((TextBox)label_elements[i]).Parent = frm; ((TextBox)label_elements[i]).Width = label_width; ((TextBox)label_elements[i]).Text = tbl.el_list[i].name; ((TextBox)label_elements[i]).Location = new Point(pnt.X, pnt.Y + w); if (!tbl.el_list[i].cmbox) { fill_elements.Add(new TextBox()); ((TextBox)fill_elements[i]).Parent = frm; ((TextBox)fill_elements[i]).Width = fill_width; ((TextBox)fill_elements[i]).Text = ""; ((TextBox)fill_elements[i]).Location = new Point(pnt.X + ((TextBox)label_elements[i]).Width + 5, pnt.Y + w); } else { fill_elements.Add(new ComboBox()); ((ComboBox)fill_elements[i]).Parent = frm; ((ComboBox)fill_elements[i]).Width = fill_width; ((ComboBox)fill_elements[i]).Text = ""; ((ComboBox)fill_elements[i]).Location = new Point(pnt.X + ((TextBox)label_elements[i]).Width + 5, pnt.Y + w); fill_elements[i] = FuncClass.PrepareComboBox(((ComboBox)fill_elements[i]), tbl.el_list[i], tbl.Table_Name); } w += ((TextBox)label_elements[i]).Height + 3; } frm.Height = pnt.Y + w + 100; }
private void Add_But_Click(object sender, EventArgs e) { Compare_Element el = new Compare_Element(); el.Serial = ser1.Text; el.Serial2 = ser21.Text; el.Text = t1.Text; el.Text2 = t2.Text; el.Text3 = t3.Text; el.Text4 = t4.Text; el.Text5 = t5.Text; el.Text6 = t6.Text; el.Prise = prise1.Text; el.date = date1.Value; el.Status2id = SQL_Class.ReadValueInt32("select ID from status2table where Status2 ='" + status21.SelectedItem + "'"); el.Typeid = SQL_Class.ReadValueInt32("select ID from typetable where Type ='" + type1.SelectedItem + "'"); el.Markid = SQL_Class.ReadValueInt32("select ID from marktable where Mark ='" + mark1.SelectedItem + "'"); el.Statusid = SQL_Class.ReadValueInt32("select ID from statustable where Status ='" + status1.SelectedItem + "'"); el.Placeid = SQL_Class.ReadValueInt32("select ID from placetable where Place ='" + place1.SelectedItem + "'"); el.Place2id = SQL_Class.ReadValueInt32("select ID from place2table where PLace2 ='" + place21.SelectedItem + "'"); el.OSID = SQL_Class.ReadValueInt32("select ID from ostable where OS ='" + os1.SelectedItem + "'"); el.OwnerID = SQL_Class.ReadValueInt32("select ID from ownertable where Owner ='" + owner1.SelectedItem + "'"); if (FuncClass.add_Element(el)) { Close(); } else { MessageBox.Show("Элемент не добавлен"); } }
private void ExcelBut_Click(object sender, EventArgs e) { FuncClass.check_excel(ExcelBut); }
private void AutoCheck_But_Click(object sender, EventArgs e) { bool ok = true; if (FuncClass.Check_Both(mcl, Convert.ToInt32(start_Tbox.Text), Convert.ToInt32(stop_Tbox.Text), Properties.Settings.Default.xls_Mark, "marktable", "Mark")) { } else { ok = false; } if (FuncClass.Check_Both(mcl, Convert.ToInt32(start_Tbox.Text), Convert.ToInt32(stop_Tbox.Text), Properties.Settings.Default.xls_Status, "statustable", "Status")) { } else { ok = false; } if (FuncClass.Check_Both(mcl, Convert.ToInt32(start_Tbox.Text), Convert.ToInt32(stop_Tbox.Text), Properties.Settings.Default.xls_Place, "placetable", "Place")) { } else { ok = false; } if (FuncClass.Check_Both(mcl, Convert.ToInt32(start_Tbox.Text), Convert.ToInt32(stop_Tbox.Text), Properties.Settings.Default.xls_Type, "typetable", "Type")) { } else { ok = false; } if (FuncClass.Check_Both(mcl, Convert.ToInt32(start_Tbox.Text), Convert.ToInt32(stop_Tbox.Text), DocumentAssistant.Properties.Settings.Default.xls_OS, "ostable", "OS")) { } else { ok = false; } if (FuncClass.Check_Both(mcl, Convert.ToInt32(start_Tbox.Text), Convert.ToInt32(stop_Tbox.Text), Properties.Settings.Default.xls_Owner, "ownertable", "Owner")) { } else { ok = false; } if (FuncClass.Check_Both(mcl, Convert.ToInt32(start_Tbox.Text), Convert.ToInt32(stop_Tbox.Text), Properties.Settings.Default.xls_Place2, "place2table", "Place2")) { } else { ok = false; } if (!ok) { start_CheckForm(); } }
private void AutoCheck_But_Click(object sender, EventArgs e) { bool ok = true; if (FuncClass.Check_Both(mcl, Convert.ToInt32(start_Tbox.Text), Convert.ToInt32(stop_Tbox.Text), Properties.Settings.Default.xls_Mark, "marktable", "Mark")) { Check_Mark_But.BackColor = Color.Green; } else { Check_Mark_But.BackColor = Color.Red; } if (FuncClass.Check_Both(mcl, Convert.ToInt32(start_Tbox.Text), Convert.ToInt32(stop_Tbox.Text), Properties.Settings.Default.xls_Status, "statustable", "Status")) { Check_Status_But.BackColor = Color.Green; } else { Check_Status_But.BackColor = Color.Red; } if (FuncClass.Check_Both(mcl, Convert.ToInt32(start_Tbox.Text), Convert.ToInt32(stop_Tbox.Text), Properties.Settings.Default.xls_Place, "placetable", "Place")) { Check_Place_But.BackColor = Color.Green; } else { Check_Place_But.BackColor = Color.Red; } if (FuncClass.Check_Both(mcl, Convert.ToInt32(start_Tbox.Text), Convert.ToInt32(stop_Tbox.Text), Properties.Settings.Default.xls_Type, "typetable", "Type")) { Check_Type_But.BackColor = Color.Green; } else { Check_Type_But.BackColor = Color.Red; } if (FuncClass.Check_Both(mcl, Convert.ToInt32(start_Tbox.Text), Convert.ToInt32(stop_Tbox.Text), DocumentAssistant.Properties.Settings.Default.xls_OS, "ostable", "OS")) { check_OS.BackColor = Color.Green; } else { check_OS.BackColor = Color.Red; } if (FuncClass.Check_Both(mcl, Convert.ToInt32(start_Tbox.Text), Convert.ToInt32(stop_Tbox.Text), Properties.Settings.Default.xls_Owner, "ownertable", "Owner")) { Check_Owner.BackColor = Color.Green; } else { Check_Owner.BackColor = Color.Red; } if (FuncClass.Check_Both(mcl, Convert.ToInt32(start_Tbox.Text), Convert.ToInt32(stop_Tbox.Text), Properties.Settings.Default.xls_Place2, "place2table", "Place2")) { Place2_Check.BackColor = Color.Green; } else { Place2_Check.BackColor = Color.Red; } }