public void cargarControl(string control)
        {
            lbOpcion.Text           = "Modifiar Control de Luces";
            panelCondominio.Visible = false;
            panelModificar.Visible  = false;
            controlEdificio         = new CONTROL_ILUMINACION_EDIFICIO();
            controlEdificio         = Controller.ControllerControlIluminacionEdificio.buscarIdControl(Convert.ToInt64(control));
            string año = controlEdificio.HORA_INICIO_E.Substring(6, 4);
            string mes = controlEdificio.HORA_INICIO_E.Substring(3, 2);
            string dia = controlEdificio.HORA_INICIO_E.Substring(0, 2);

            txtDia.Text = año + "-" + mes + "-" + dia;

            string horaI = controlEdificio.HORA_INICIO_E.Substring(11, 5);

            txtHoraInicio.Text = horaI;

            string horaT = controlEdificio.HORA_TERMINO_E.Substring(11, 5);

            txtHoraTermino.Text = horaT;

            if (controlEdificio.ESTADO_LUZ_CE == true)
            {
                rbOpcion.SelectedIndex = 0;
            }
            else
            {
                rbOpcion.SelectedIndex = 1;
            }
            btnProgramarLuz.Visible      = false;
            btnModificarPrograma.Visible = true;
        }
示例#2
0
        public static CONTROL_ILUMINACION_EDIFICIO buscarIdControl(long control)
        {
            using (EasyLifeEntities dbc = new EasyLifeEntities())
            {
                CONTROL_ILUMINACION_EDIFICIO aux = (from u in dbc.CONTROL_ILUMINACION_EDIFICIO
                                                    where u.ID_CILUMINACION_E == control
                                                    select u).FirstOrDefault();

                if (aux != null)
                {
                    return(aux);
                }
                else
                {
                    return(null);
                }
            }
        }