} // end onSpeciesSelectIndexChanged private void fillSpeciesList() { // combination of species, product and live/dead comes from tree table bslyr.fileName = fileName; List <TreeDefaultValueDO> tdvList = bslyr.GetUniqueSpeciesProductLiveDead(); StringBuilder sb = new StringBuilder(); foreach (TreeDefaultValueDO tdv in tdvList) { sb.Remove(0, sb.Length); sb.Append(tdv.Species.PadRight(6, ' ')); sb.Append(" -- "); sb.Append(tdv.PrimaryProduct); sb.Append(" -- "); if (tdv.LiveDead == "L") { sb.Append("Live"); } else { sb.Append("Dead"); } speciesList.Items.Add(sb.ToString()); } // end foreach loop } // end fillSpeciesList
public int setupDialog() { // if there are value equations, show in grid // if not, just initialize the grid valList = bslyr.getValueEquations(); valueEquationDOBindingSource.DataSource = valList; valueEquationList.DataSource = valueEquationDOBindingSource; // need unique species and product List <TreeDefaultValueDO> tdvList = bslyr.GetUniqueSpeciesProductLiveDead(); if (valList.Count == 0) { foreach (TreeDefaultValueDO tdv in tdvList) { ValueEquationDO ved = new ValueEquationDO(); ved.Species = tdv.Species; ved.PrimaryProduct = tdv.PrimaryProduct; valList.Add(ved); } // end foreach loop valueEquationDOBindingSource.ResetBindings(false); } // endif list is empty // Fill lists at bottom with unique species and primary products ArrayList justSpecies = bslyr.GetJustSpecies("Tree"); for (int n = 0; n < justSpecies.Count; n++) { speciesList.Items.Add(justSpecies[n].ToString()); } // If there are no species/products in tree default values, it's wrong // tell user to check the file design in CSM -- June 2013 if (justSpecies.Count == 0) { MessageBox.Show("No species/product combinations found in Tree records.\nPlease enter tree records before continuing.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); return(-1); } // endif ArrayList justProducts = bslyr.GetJustPrimaryProduct(); for (int n = 0; n < justProducts.Count; n++) { primaryProdList.Items.Add(justProducts[n].ToString()); } regionNum.Enabled = false; equationNumber.Enabled = false; speciesList.Enabled = false; primaryProdList.Enabled = false; return(1); } // end setupDialog
public void setupDialog() { // if there are weight equations, show in grid // if not, just initialize the grid CPbusinessLayer bslyr = new CPbusinessLayer(); bslyr.fileName = fileName; wgtList = bslyr.getWeightEquations(); weightEquationDOBindingSource.DataSource = wgtList; weightEquationList.DataSource = weightEquationDOBindingSource; // need unique species, livedead and primary product from trees List <TreeDefaultValueDO> tList = bslyr.GetUniqueSpeciesProductLiveDead(); if (wgtList.Count == 0) { // Fill species, livedead and primary product with unique items from trees foreach (TreeDefaultValueDO tdo in tList) { WeightEquationDO wedo = new WeightEquationDO(); wedo.Species = tdo.Species; wedo.LiveDead = tdo.LiveDead; wedo.PrimaryProduct = tdo.PrimaryProduct; wgtList.Add(wedo); } // end foreach loop weightEquationDOBindingSource.ResetBindings(false); } // endif wgtList is empty // Fill lists at bottom with unique species and primary products ArrayList justSpecies = bslyr.GetJustSpecies(); for (int n = 0; n < justSpecies.Count; n++) { speciesList.Items.Add(justSpecies[n].ToString()); } ArrayList justProduct = bslyr.GetJustPrimaryProduct(); for (int n = 0; n < justProduct.Count; n++) { primaryProdList.Items.Add(justProduct[n].ToString()); } speciesList.Enabled = true; liveDeadList.Enabled = true; primaryProdList.Enabled = true; return; } // end setupDialog