private void button4_Click(object sender, EventArgs e) { string fechaAcancelar = dateTimePicker2.Value.ToShortDateString(); horaInicio = new DateTime(1800, 1, 1, Convert.ToInt16(comboBox1.Text), Convert.ToInt16(comboBox2.Text), 0); horaFin = new DateTime(1800, 1, 1, Convert.ToInt16(comboBox3.Text), Convert.ToInt16(comboBox4.Text), 0); if (string.IsNullOrWhiteSpace(comboBox1.Text) || string.IsNullOrWhiteSpace(comboBox2.Text) || string.IsNullOrWhiteSpace(comboBox4.Text) || string.IsNullOrWhiteSpace(comboBox3.Text)) { MessageBox.Show("Complete rango de horario de cancelación"); } else { if ((Convert.ToInt16(comboBox1.Text) > Convert.ToInt16(comboBox3.Text)) || (Convert.ToInt16(comboBox1.Text) == Convert.ToInt16(comboBox3.Text) && Convert.ToInt16(comboBox2.Text) > Convert.ToInt16(comboBox4.Text)) || (Convert.ToInt16(comboBox1.Text) == Convert.ToInt16(comboBox3.Text) && Convert.ToInt16(comboBox2.Text) == Convert.ToInt16(comboBox4.Text))) { MessageBox.Show("El horario desde no puede ser mayor o igual que el hasta"); } else { Pantalla_Motivo_Cancelacion_Profesional pmcp = new Pantalla_Motivo_Cancelacion_Profesional(fechaAcancelar, idUser, horaInicio, horaFin); pmcp.guardarDatos(this); pmcp.ShowDialog(); } } }
private void button2_Click(object sender, EventArgs e) { string fechaIngresada = dateTimePicker1.Value.ToShortDateString(); if (fechaIngresada == fechaHoy) { MessageBox.Show("No puedes cancelar turnos un mismo día"); } else { Pantalla_Motivo_Cancelacion_Profesional pmcp = new Pantalla_Motivo_Cancelacion_Profesional(fechaIngresada, idUser, null, null); pmcp.guardarDatos(this); pmcp.ShowDialog(); } }