private void UpdateLumberTypeDatabaseValue(string _lumbercode, LumberFields _field, string _newValue) { string sql = ""; switch (_field) { case LumberFields.LumberCode: case LumberFields.Grade: case LumberFields.Species: case LumberFields.HeightNominal: case LumberFields.WidthNominal: case LumberFields.HeightActual: case LumberFields.WidthActual: case LumberFields.Length: case LumberFields.AdditionalSpecifications: case LumberFields.UseAsStud: case LumberFields.Treated: case LumberFields.Stocked: sql = "update lumbertype set " + _field + " = '" + _newValue + "'"; break; case LumberFields.Freight: case LumberFields.BfPerPiece: sql = "update lumbertype set " + _field + " = " + _newValue; break; default: break; } sql = sql + " where lumbercode = '" + _lumbercode + "'"; SqlDatabase.UpdateDB(sql); }
private List <String> FilterList(LumberFields field) { DataSet myDataset = new DataSet(); string sql; List <string> fieldList = new List <string>(); sql = "Select distinct " + field + " from lumbertype"; myDataset = SqlDatabase.SelectFromDB(sql); if ((myDataset != null)) { foreach (DataTable table in myDataset.Tables) { foreach (DataRow dr in table.Rows) { fieldList.Add(dr[field.ToString()].ToString()); } } } return(fieldList); }