Exemplo n.º 1
0
        public bool UpdateData(RawWeighterInfo data)
        {
            try
            {
                var result = new RawWeighterInfo
                {
                    WeigherNumber    = weigherNumberTextBox.UpdateData(),
                    VerificationDate = new RecognizedValue(
                        verificationDatePicker.Value.ToShortDateString()),
                    CertificateNumber = certificateNumberTextBox.UpdateData(),
                    ViolationNature   = violatioNatureTextBox.UpdateData()
                };
                if (violationKoapComboBox.Items.Count > 0 &&
                    violationKoapComboBox.SelectedIndex != -1)
                {
                    result.ViolationKoap = new RecognizedValue(
                        violationKoapComboBox.SelectedValue.ToString());
                }

                return(true);
            }
            catch (Exception e)
            {
                _console.AddException(e);
                return(false);
            }
        }
Exemplo n.º 2
0
 public bool LoadData(RawWeighterInfo data)
 {
     try
     {
         weigherNumberTextBox.Text    = data.WeigherNumber.Value;
         verificationDatePicker.Value =
             DateTime.Parse(data.VerificationDate.Value);
         certificateNumberTextBox.Text = data.CertificateNumber.Value;
         violatioNatureTextBox.Text    = data.ViolationNature.Value;
         // TODO: violationKoapComboBox
         return(true);
     }
     catch (Exception e)
     {
         _console.AddException(e);
         return(false);
     }
 }