Beispiel #1
0
        public void cargarControl(string control)
        {
            lbOpcion.Text        = "Modifiar Control de Luces";
            panelPropDep.Visible = false;
            panelEstado.Visible  = false;
            controlDep           = new CONTROL_ILUMINACION_DEPARTAMENTO();
            controlDep           = Controller.ControllerControlIlimunacionDep.buscarIdControl(Convert.ToInt64(control));
            string año = controlDep.HORA_INICIO_D.Substring(6, 4);
            string mes = controlDep.HORA_INICIO_D.Substring(3, 2);
            string dia = controlDep.HORA_INICIO_D.Substring(0, 2);

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

            string horaI = controlDep.HORA_INICIO_D.Substring(11, 5);

            txtHoraInicio.Text = horaI;
            string horaT = controlDep.HORA_TERMINO_D.Substring(11, 5);

            txtHoraTermino.Text = horaT;

            if (controlDep.ESTADO_LUZ_CD == true)
            {
                rbOpcion.SelectedIndex = 0;
            }
            else
            {
                rbOpcion.SelectedIndex = 1;
            }
            btnProgramarLuz.Visible      = false;
            btnModificarPrograma.Visible = true;
        }
Beispiel #2
0
 public static CONTROL_ILUMINACION_DEPARTAMENTO buscarIdControl(long control)
 {
     using (EasyLifeEntities dbc = new EasyLifeEntities())
     {
         CONTROL_ILUMINACION_DEPARTAMENTO aux = (from u in dbc.CONTROL_ILUMINACION_DEPARTAMENTO
                                                 where u.ID_CILUMINACION_D == control
                                                 select u).SingleOrDefault();
         if (aux != null)
         {
             return(aux);
         }
         else
         {
             return(null);
         }
     }
 }