public FrmMeasurements() { InitializeComponent(); PnlDisplay.Visible = false; PnlEntry.Visible = false; LblErrorDate.Visible = false; LblMeasurementError.Visible = false; this.AutoValidate = AutoValidate.Disable; DataUtilityClass.ConnectToDB(); }
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); } }
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)); } }