private void workingHours_Txt_Leave(object sender, EventArgs e) { double d; if (!double.TryParse(workingHours_Txt.Text, out d)) { MessageBox.Show("Working hours should be numeric value. Please try again!"); workingHours_Txt.Text = "0"; workingHours_Txt.Focus(); return; } else if (Convert.ToDouble(workingHours_Txt.Text) < 0) { MessageBox.Show("Invalid working hours. Should be numeric value over 0. Please try again!"); workingHours_Txt.Text = "0"; workingHours_Txt.Focus(); return; } DatabaseControl.setBookingDates(dateTimePicker1.Value, Convert.ToDouble(workingHours_Txt.Text), note_Txt.Text); showBookings(); }
private void note_Txt_Leave(object sender, EventArgs e) { DatabaseControl.setBookingDates(dateTimePicker1.Value, Convert.ToDouble(workingHours_Txt.Text), note_Txt.Text); showBookings(); }