示例#1
0
        private void GenericModel_Load(object sender, EventArgs e)
        {
            MainDataSetTableAdapters.VARIABLESTableAdapter adptVariables = new Plig.TimeSeries.Client.MainDataSetTableAdapters.VARIABLESTableAdapter();
            MainDataSet.VARIABLESDataTable tblVariables = adptVariables.GetDataBy(Program.CurrentProjectID);

            foreach (MainDataSet.VARIABLESRow var_row in tblVariables)
            {
                string name = var_row.NAME;
                int id = var_row.ID;
                string description = string.Empty;
                // Може да няма текст на описание, затова е нужно да обезопасим блока
                if (!var_row.IsDESCRIPTIONNull()) description = var_row.DESCRIPTION;
                ListViewItem lvi = new ListViewItem(new string[] {name, description, id.ToString()});
                lvVariables.Items.Add(lvi);
            }

            OnLoad();
        }