예제 #1
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            HorarioBusiness horarioBusiness = new HorarioBusiness();
            HorariosLab     horariosLab     = new HorariosLab();

            if (string.IsNullOrEmpty(txtDenominacion.Text) || string.IsNullOrEmpty(txtHorario.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            horariosLab.Tipo        = txtDenominacion.Text;
            horariosLab.Descripcion = txtHorario.Text;
            horarioBusiness.agregar(horariosLab);
            MessageBox.Show("Horario agregado correctamente");
            txtHorario.Clear();
            txtDenominacion.Clear();
        }
예제 #2
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            horario.Desde = new DateTime(1990, 01, 01, DateTime.Parse(cboDesdeHora.SelectedItem.ToString()).Hour, 0, 0);
            horario.Hasta = new DateTime(1990, 01, 01, DateTime.Parse(cboHastaHora.SelectedItem.ToString()).Hour, 0, 0);

            if (validar(horario.Desde))
            {
                horarioBusiness.agregar(horario);
            }
            else
            {
                MessageBox.Show("Este Horario ya existe!");
            }

            lbHorario.DataSource    = horarioBusiness.listar();
            lbHorario.SelectedIndex = -1;
        }