public uc_biosum_id(string strBiosumId) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); this.m_biosumid = new Biosum_Id(); this.m_biosumid.strInvId = strBiosumId.ToString().Substring(0, 1); this.m_biosumid.strSecInvId = strBiosumId.ToString().Substring(1, 4); this.m_biosumid.strStateCd = strBiosumId.ToString().Substring(5, 2); this.m_biosumid.strNimsCycle = strBiosumId.ToString().Substring(7, 2); this.m_biosumid.strNimsSubCycle = strBiosumId.ToString().Substring(9, 2); this.m_biosumid.strCountyCd = strBiosumId.ToString().Substring(11, 3); this.m_biosumid.strPlot = strBiosumId.ToString().Substring(14, 7); this.m_biosumid.strPnwIdbForestOrBlmDistrict = strBiosumId.ToString().Substring(21, 3); if (strBiosumId.Trim().Length == BIOSUM_COND_ID_LENGTH) { this.m_biosumid.strCondId = strBiosumId.ToString().Substring(24, 1); this.lblCondId.Text = this.m_biosumid.strCondId; } else { this.m_biosumid.strCondId = "NA"; this.lblCondId.Text = "NA"; } switch (this.m_biosumid.strInvId) { case "1": this.lblInvSource.Text = "FIADB"; this.lblCycle.Text = this.m_biosumid.strNimsCycle; this.lblSubcycle.Text = this.m_biosumid.strNimsSubCycle; this.lblPNWOrBLM.Text = "NA"; break; case "2": this.lblInvSource.Text = "PNW IDB"; this.lblCycle.Text = "NA"; this.lblSubcycle.Text = "NA"; this.lblPNWOrBLM.Text = this.m_biosumid.strPnwIdbForestOrBlmDistrict; break; case "3": this.lblInvSource.Text = "NIMS"; this.lblCycle.Text = this.m_biosumid.strNimsCycle; this.lblSubcycle.Text = this.m_biosumid.strNimsSubCycle; this.lblPNWOrBLM.Text = "NA"; break; default: this.lblInvSource.Text = "Unknown"; this.lblCycle.Text = "NA"; this.lblSubcycle.Text = "NA"; this.lblPNWOrBLM.Text = "NA"; break; } env p_oEnv = new env(); ado_data_access p_ado = new ado_data_access(); string strFile = p_oEnv.strAppDir + "\\db\\ref_master.mdb"; string strConn = ""; strConn = p_ado.getMDBConnString(strFile, "admin", ""); string strSQL = "select inv_id_def from inventories where trim(ucase(inv_id)) = '" + this.m_biosumid.strSecInvId.Trim().ToUpper() + "';"; p_ado.SqlQueryReader(strConn, strSQL); if (p_ado.m_intError == 0) { if (p_ado.m_OleDbDataReader.HasRows == true) { p_ado.m_OleDbDataReader.Read(); this.lblYearMeasured.Text = p_ado.m_OleDbDataReader["inv_id_def"].ToString().Trim(); } else { this.lblYearMeasured.Text = this.m_biosumid.strSecInvId.Trim(); } p_ado.m_OleDbDataReader.Close(); p_ado.m_OleDbConnection.Close(); } p_ado.m_OleDbDataReader = null; p_ado.m_OleDbConnection = null; p_ado = null; this.lblState.Text = this.ConvertStateCd(this.m_biosumid.strStateCd); this.lblCounty.Text = this.m_biosumid.strCountyCd; this.lblPlot.Text = this.m_biosumid.strPlot; // TODO: Add any initialization after the InitializeComponent call }
public frmSettings() { // // Required for Windows Form Designer support // InitializeComponent(); // //GRIDVIEW // this.lblGridBackgroundColor.BackColor = frmMain.g_oGridViewBackgroundColor; this.lblGridAlternateRowBackgroundColor.BackColor = frmMain.g_oGridViewAlternateRowBackgroundColor; this.lblGridRowBackgroundColor.BackColor = frmMain.g_oGridViewRowBackgroundColor; this.lblGridRowForegroundColor.BackColor = frmMain.g_oGridViewRowForegroundColor; this.lblGridSelectedRowBackgroundColor.BackColor = frmMain.g_oGridViewSelectedRowBackgroundColor; if (frmMain.g_oGridViewFont != null) { this.lblGridFont.Font = frmMain.g_oGridViewFont; this.lblGridFontName.Text = frmMain.g_oGridViewFont.Name; this.lblGridFontSize.Text = frmMain.g_oGridViewFont.Size.ToString().Trim(); this.lblGridFontStyle.Text = frmMain.g_oGridViewFont.Style.ToString().Trim(); } // //DEBUG // if (frmMain.g_bDebug) { this.chkDebug.Checked = true; } else { this.chkDebug.Checked = false; } cmbDebug.SelectedIndex = frmMain.g_intDebugLevel - 1; // //SUPPRESS TABLE RECORD COUNTS // chkFVSInputForm.Checked = frmMain.g_bSuppressFVSInputTableRowCount; chkFVSOutputForm.Checked = frmMain.g_bSuppressFVSOutputTableRowCount; chkScenarioProcessorForm.Checked = frmMain.g_bSuppressProcessorScenarioTableRowCount; // //OPCOST SETTINGS // if (frmMain.g_strOPCOSTDirectory.Trim().Length == 0) { txtOpcost.Text = frmSettings.GetDefaultOpcostPath(); } else { if (System.IO.File.Exists(frmMain.g_strOPCOSTDirectory) == true) { txtOpcost.Text = frmMain.g_strOPCOSTDirectory; } } if (frmMain.g_strRDirectory.Trim().Length > 0 && System.IO.File.Exists(frmMain.g_strRDirectory) == true) { txtRdir.Text = frmMain.g_strRDirectory; } // // AppData path // txtAppData.Text = frmMain.g_oEnv.strApplicationDataDirectory.Trim() + "\\FIABiosum"; this.m_oEnv = new env(); // // TODO: Add any constructor code after InitializeComponent call // }