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;
                }
            }
        }
Example #2
0
        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);
        }
Example #3
0
 public DBValueMeasurement(Type typevalue, string field, string description, TypeMeasurement type, int unit, Multiplier multiplier)
     : base(typevalue, description, type, (int)unit, multiplier)
 {
     this.field = field;
 }
Example #4
0
 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);
 }
Example #5
0
 //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;
 }
Example #6
0
 public DBUnitMeasurement(string field, string description, TypeMeasurement type, int unit, Multiplier multiplier)
     : base(description, type, unit, multiplier)
 {
     this.field = field;
 }
Example #7
0
 public UnitMeasurement(string description, TypeMeasurement type, int unit, Multiplier multiplier)
 {
     this.type = type; this.unit = unit; this.multiplier = multiplier; this.description = description;
 }
Example #8
0
 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);
 }