Exemplo n.º 1
0
        public void ReadAttributeTable(DataTable dt1)
        {
            int f = xyz.DictionaryAttributes();
            int r = xyz.DictionaryClasses();

            dt1.Columns.Add("Признак");
            dt1.Columns.Add("Значение");

            for (int i = 0; i < f; i++)
            {
                dt1.Rows.Add(xyz.GetNumber(i));
            }
            datagridview1.DataSource          = dt1;
            datagridview1.AllowUserToAddRows  = false;
            datagridview1.Columns[0].ReadOnly = true;
        }
Exemplo n.º 2
0
        public void ReadClassifierTable()
        {
            for (int i = com.DictionaryAttributes() + com.DictionaryClasses(); i < com.DictionaryElements(); i++)
            {
                classifier.Add(com.GetNumber(i));
            }

            List <DSClassifierWrapper> classifiers = hierarchy_.getClassifiers();

            foreach (string cl in classifier)
            {
                DataTable  dt22 = new DataTable();
                DataColumn column;
                DataRow    row;

                DSClassifierWrapper classifier_ = classifiers[classifier.IndexOf(cl)];

                dt22.TableName = "dat" + classifier.IndexOf(cl);

                column            = new DataColumn();
                column.ColumnName = "Класс";
                dt22.Columns.Add(column);


                column            = new DataColumn();
                column.ColumnName = "Степень принадлежности";
                dt22.Columns.Add(column);

                tabpage1 = new TabPage();
                tabpage1.SuspendLayout();
                tabpage1.Name = cl;
                tabControl1.TabPages.Add(tabpage1);
                tabControl1.SelectedTab = tabpage1;
                tabpage1.Text           = cl.ToString();

                DGV                    = new DataGridView();
                DGV.Name               = "DataGridV" + classifier.IndexOf(cl);
                DGV.BackgroundColor    = Color.White;
                DGV.Parent             = tabpage1;
                DGV.Location           = new Point(7, 7);
                DGV.Size               = new Size(299, 162);
                DGV.BorderStyle        = BorderStyle.FixedSingle;
                DGV.Visible            = true;
                DGV.AllowUserToAddRows = false;
                DGV.ReadOnly           = true;



                foreach (DSClassWrapper cls in classifier_.getClasses())
                {
                    foreach (DataRow dr in dtClasses.Rows)
                    {
                        if ((cls.getID() + " " + cls.getName()) == dr["Класс"].ToString())
                        {
                            row          = dt22.NewRow();
                            row["Класс"] = dr["Класс"];
                            dt22.Rows.Add(row);
                        }
                    }
                }

                DGV.DataSource = dt22;
                datatable.Add(dt22);
                tabControl1.TabPages[cl].Controls.Add(DGV);

                tabpage1.ResumeLayout();
                tabpage1.Refresh();
            }
        }