private void PopulateMeasures(string ingredient, string selectValue) { var ing = GetIngDetail(ingredient, true); if (ing != null) { if (ing.type != null) { TypeMeasurement measure = new TypeMeasurement(ing.type); if (selectValue == "") { Cbx_measure.Visibility = Visibility.Visible; Cbx_measure.ItemsSource = measure.measures; Cbx_measure.SelectedIndex = 0; } else { Cbx_measureEdit.ItemsSource = measure.measures; Cbx_measureEdit.SelectedValue = selectValue; Cbx_measureEdit.Visibility = Visibility.Visible; } } else { Cbx_measure.Visibility = Visibility.Collapsed; Cbx_measureEdit.Visibility = Visibility.Collapsed; } } }
public ValueMeasurement(DateTime?value, string description, TypeMeasurement type, int unit, Multiplier multiplier) : base(description, type, unit, multiplier) { this.value = value != null?value.ToString() : null; this.typevalue = typeof(DateTime); }
public DBValueMeasurement(Type typevalue, string field, string description, TypeMeasurement type, int unit, Multiplier multiplier) : base(typevalue, description, type, (int)unit, multiplier) { this.field = field; }
public ValueMeasurement(string value, string description, TypeMeasurement type, int unit, Multiplier multiplier) : base(description, type, unit, multiplier) { this.value = value.ToString(); this.typevalue = typeof(string); }
//TODO: Обработка ошибок? //public ValueMeasurement(ValueError error, string description, TypeMeasurement type, int unit, Multiplier multiplier) // : base(description, type, unit, multiplier) //{ // this.value = "error"; // this.typevalue = typeof(ValueError); //} public ValueMeasurement(Type typevalue, string description, TypeMeasurement type, int unit, Multiplier multiplier) : base(description, type, unit, multiplier) { this.value = null; this.typevalue = typevalue; }
public DBUnitMeasurement(string field, string description, TypeMeasurement type, int unit, Multiplier multiplier) : base(description, type, unit, multiplier) { this.field = field; }
public UnitMeasurement(string description, TypeMeasurement type, int unit, Multiplier multiplier) { this.type = type; this.unit = unit; this.multiplier = multiplier; this.description = description; }
private void setParameters(string typeMeasure, string frequencyWeight, string timeWeightingIn) { type = (TypeMeasurement)Int32.Parse(typeMeasure, CultureInfo.InvariantCulture); freqWeight = (FrequencyWeighting)Int32.Parse(frequencyWeight, CultureInfo.InvariantCulture); timeWeight = (TimeWeighting)Int32.Parse(timeWeightingIn, CultureInfo.InvariantCulture); }