private void ODMDatabaseListLoad() { odmList.Items.Clear(); List <string> odmDBList = new List <string>(); TimeSeriesResources tmObj = new TimeSeriesResources(); odmDBList = tmObj.GetODMList(); foreach (string s in odmDBList) { odmList.Items.Add(s); } if (odmList.Items.Count > 0) { odmList.SelectedValue = odmList.Items[odmList.Items.Count - 1].ToString(); } siteCodeDropDownList.Items.Clear(); variableCodeDropDownList.Items.Clear(); ODM odmInfo = new ODM(); DataTable dt = new DataTable(); if (odmList.Items.Count > 0) { dt = odmInfo.GetODMInfo(odmList.Items[odmList.Items.Count - 1].ToString()); } foreach (DataRow row in dt.Rows) { Title.Text = row["title"].ToString(); serverName.Text = row["serveraddress"].ToString(); Topic.Text = row["topiccategory"].ToString(); abstractODM.Text = row["abstract"].ToString(); citation.Text = row["citation"].ToString(); } TimeSeriesResources tmResObj = new TimeSeriesResources(); if (odmList.Items.Count > 0) { timeSeriesTable = tmResObj.GetTimeSeriesResources(odmList.Items[odmList.Items.Count - 1].ToString()); } odmInfoGridView.DataSource = timeSeriesTable; odmInfoGridView.DataBind(); ViewState["mydata"] = timeSeriesTable; //recordCount.Text = timeSeriesTable.Rows.Count.ToString() + " records"; List <string> siteCodeListObj = new List <string>(); List <string> variableCodeListObj = new List <string>(); foreach (DataRow row in timeSeriesTable.Rows) { siteCodeListObj.Add(row["sitecode"].ToString()); variableCodeListObj.Add(row["variablecode"].ToString()); } siteCodeDropDownList.DataSource = siteCodeListObj.Distinct().ToList(); siteCodeDropDownList.DataBind(); variableCodeDropDownList.DataSource = variableCodeListObj.Distinct().ToList(); variableCodeDropDownList.DataBind(); }
private void DbList_Load() { TimeSeriesResources dbObj = new TimeSeriesResources(); List <string> dbList = new List <string>(); dbList = dbObj.GetODMList(); foreach (string s in dbList) { DbListBox.Items.Add(s); } }
protected void deleteODM_Click(object sender, EventArgs e) { TimeSeriesResources tmResObj = new TimeSeriesResources(); tmResObj.DeleteTimeSeriesResources(odmList.SelectedValue.ToString()); List <string> DBList = new List <string>(); DBList = tmResObj.GetODMList(); odmList.Items.Clear(); foreach (string s in DBList) { odmList.Items.Add(s); } ODMDatabaseListLoad(); }
private void loadODMList() { odmList.Items.Clear(); TimeSeriesResources tmRes = new TimeSeriesResources(); List <string> loadedODMList = tmRes.GetODMList(); ODM odmObj = new ODM(); List <string> loadList = odmObj.GetODMList(); foreach (string s in loadedODMList) { loadList.Remove(s); } foreach (string s in loadList) { odmList.Items.Add(s); } }