예제 #1
0
    protected void btnBuscarTurno_Click(object sender, EventArgs e)
    {
        try
        {
            COD = (int)(gdvEspecialista.SelectedDataKey.Value);
            EmpleadoEntidad    emp             = EmpleadoDao.ObtenerPorID(COD);
            DateTime           horaInicio      = emp.HoraIngreso;
            DateTime           horario         = DateTime.Parse((emp.HoraEgreso - emp.HoraIngreso).ToString());
            int                horas           = int.Parse(horario.Hour.ToString());
            List <HoraEntidad> HorarioCompleto = GenerarHorarios(horas, horaInicio);

            List <TurnoEntidad> TurnosOcupados = TurnoDao.TurnosPorFechaPorEspecialista((DateTime.Parse(txtFecha.Text)), ((int)gdvEspecialista.SelectedDataKey.Value));
            if (TurnosOcupados != null)
            {
                if (TurnosOcupados.Count != 0)
                {
                    HorarioCompleto = RestarTurnosOcupados(HorarioCompleto, TurnosOcupados);
                }
            }
            CargarTurnosDisponibles(HorarioCompleto);
            GrillaHoras.Visible = true;
        }
        catch (Exception ex)
        {
            divResultado.Visible = true;
            txtResultado.Text    = "Ha ocurrido el siguiente error: " + ex.Message;
        }
    }
예제 #2
0
    protected void grdEmpleados_SelectedIndexChanged(object sender, EventArgs e)
    {
        Limpiar();

        COD = int.Parse(grdEmpleados.SelectedDataKey.Value.ToString());

        EmpleadoEntidad emp = EmpleadoDao.ObtenerPorID(COD.Value);

        txtNombre.Text             = emp.Nombre;
        txtApellido.Text           = emp.Apellido;
        cboTipoDoc.SelectedIndex   = (int)emp.IdTipoDoc;
        txtNroDoc.Text             = emp.NroDoc.ToString();
        txtFechaNac.Text           = emp.FechaNacimiento.ToShortDateString();
        cboLocalidad.SelectedIndex = (int)emp.IdLocalidad;
        txtCalle.Text          = emp.Calle;
        txtNroCalle.Text       = emp.NroCalle.ToString();
        txtPiso.Text           = emp.Piso.ToString();
        txtDepto.Text          = emp.Departamento.ToString();
        txtTelefono.Text       = emp.Telefono.ToString();
        txtCelular.Text        = emp.Celular.ToString();
        cboCargo.SelectedIndex = (int)emp.IdCargo;
        txtSueldo.Text         = emp.Sueldo.ToString();
        txtHoraDesde.Text      = emp.HoraIngreso.ToShortTimeString();
        txtHoraHasta.Text      = emp.HoraEgreso.ToShortTimeString();
        ckbActivo.Checked      = emp.Activo.Value;

        btnEliminar.Enabled  = true;
        btnEliminar.CssClass = "btn btn-danger";
    }
예제 #3
0
    protected void gdvEspecialista_SelectedIndexChanged(object sender, EventArgs e)
    {
        COD = (int)(gdvEspecialista.SelectedDataKey.Value);

        EmpleadoEntidad emp = EmpleadoDao.ObtenerPorID(COD.Value);

        txtNombreEmpleado.Text = emp.Apellido + " " + emp.Nombre;
    }