예제 #1
0
 public FrmMeasurements()
 {
     InitializeComponent();
     PnlDisplay.Visible          = false;
     PnlEntry.Visible            = false;
     LblErrorDate.Visible        = false;
     LblMeasurementError.Visible = false;
     this.AutoValidate           = AutoValidate.Disable;
     DataUtilityClass.ConnectToDB();
 }
예제 #2
0
 private void BtnViewAll_Click(object sender, EventArgs e)
 {
     PnlEntry.Visible   = false;
     PnlDisplay.Visible = true;
     DGViewPrecip.Rows.Clear();
     measurements = DataUtilityClass.GetMeasurements();
     foreach (var classMeasurement in measurements)
     {
         DGViewPrecip.Rows.Add(classMeasurement.PrecipDate.ToShortDateString(), classMeasurement.PrecipAmount);
     }
 }
예제 #3
0
 private void BtnSaveEntry_Click(object sender, EventArgs e)
 {
     if (this.ValidateChildren())
     {
         MessageBox.Show("Successfully added New record");
         TBMeasurement.Clear();
         DPPrecip.Value   = DateTime.Today;
         PnlEntry.Visible = false;
         DataUtilityClass.AddMeasurement(new ClassMeasurement(_time, _precip));
     }
 }