Пример #1
0
        public BaseShow()
        {
            InitializeComponent();


            Type_CmBox.DataSource   = CMB.get_ordered_datasource("Type", "typetable");     //SQL_Class.get_data_Source("select Type from typetable"));
            Place_CmBox.DataSource  = CMB.get_ordered_datasource("Place", "placetable");   //SQL_Class.get_data_Source("select Place from placetable");
            Place2_CmBox.DataSource = CMB.get_ordered_datasource("Place2", "place2table"); //SQL_Class.get_data_Source("select Place2 from place2table");
            OS_CmBox.DataSource     = CMB.get_ordered_datasource("OS", "ostable");         //SQL_Class.get_data_Source("select OS from ostable");
            Owner_CmBox.DataSource  = CMB.get_ordered_datasource("Owner", "ownertable");   // SQL_Class.get_data_Source("select Owner from ownertable");


            Filter_Clear();



            List <Element> lst = new List <Element>();

            lst.Add(new Element("itemtable", "ID", false, false, ""));
            lst.Add(new Element("itemtable", "Serial", true, false, ""));                         //
            lst.Add(new Element("itemtable", "Serial2", true, false, ""));                        //

            lst.Add(new Element("itemtable", "Mark", false, true, "marktable"));
            lst.Add(new Element("itemtable", "Type", false, true, "typetable"));
            lst.Add(new Element("itemtable", "Place", false, true, "placetable"));
            lst.Add(new Element("itemtable", "Place2", false, true, "place2table"));
            lst.Add(new Element("itemtable", "Status", false, true, "statustable"));
            lst.Add(new Element("itemtable", "Status2", false, true, "status2table"));
            lst.Add(new Element("itemtable", "OS", false, true, "ostable"));

            lst.Add(new Element("itemtable", "Text", true, false, ""));  //
            lst.Add(new Element("itemtable", "Text2", true, false, "")); //
            lst.Add(new Element("itemtable", "Text3", true, false, "")); //
            lst.Add(new Element("itemtable", "Text4", true, false, "")); //
            lst.Add(new Element("itemtable", "Text5", true, false, "")); //
            lst.Add(new Element("itemtable", "Text6", true, false, "")); //

            lst.Add(new Element("itemtable", "Prise", true, false, "")); //
            lst.Add(new Element("itemtable", "Date", true, false, ""));  //

            lst.Add(new Element("itemtable", "Owner", false, true, "ownertable"));

            tbl = new Table(lst, dgv, "itemtable");
            Load_Data_With_Filters();
            paint_dgv();


            st1.BackColor = Settings.Default.st1;
            st2.BackColor = Settings.Default.st2;
            st3.BackColor = Settings.Default.st3;
            st4.BackColor = Settings.Default.st4;
            st5.BackColor = Settings.Default.st5;
            st6.BackColor = Settings.Default.st6;

            st2_1.BackColor = Settings.Default.st_2_1;
            st2_2.BackColor = Settings.Default.st_2_2;
            st2_3.BackColor = Settings.Default.st_2_3;
            st2_4.BackColor = Settings.Default.st_2_4;
            st2_5.BackColor = Settings.Default.st_2_5;
        }
Пример #2
0
 public GroupChangeForm(Element inp)
 {
     InitializeComponent();
     el             = inp;
     cmb.DataSource = CMB.get_ordered_datasource(el.name, el.addtable);//SQL_Class.get_data_Source("select " + el.name + " from " + el.addtable));
     lb.Text        = el.name;
 }
        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);
            }
        }