protected void Selecionar(object sender)
        {
            Comando obj = new Comando();

            obj = boComando.BuscarComandoIdBotao(((Button)sender).ID);
            if (obj != null)
            {
                divCadastrarComando.Attributes.Add("class", "inicio bloco-inteiro");
                PreencherFormulario(obj);
            }
        }
Esempio n. 2
0
        protected void Selecionar(object sender)
        {
            Session["objComando"] = boComando.BuscarComandoIdBotao(((Button)sender).ID);

            if ((string)Session["Retorno"] != null)
            {
                Response.Redirect((string)Session["Retorno"]);
            }
            else
            {
                Response.Redirect(@"~\Forms\Tecnico\WFManterComando.aspx");
            }
        }
        protected Evento PreencherObjeto()
        {
            Evento    objEvento = new Evento();
            ComandoBO boComando = new ComandoBO();

            objEvento.ObjAgenda.Hora    = Convertt.ToTimeSpan(txtHora.Text);
            objEvento.ObjAgenda.Domingo = chDom.Checked;
            objEvento.ObjAgenda.Segunda = chSeg.Checked;
            objEvento.ObjAgenda.Terca   = chTer.Checked;
            objEvento.ObjAgenda.Quarta  = chQua.Checked;
            objEvento.ObjAgenda.Quinta  = chQui.Checked;
            objEvento.ObjAgenda.Sexta   = chSex.Checked;
            objEvento.ObjAgenda.Sabado  = chSab.Checked;
            if (txtRange.Text != "")
            {
                objEvento.Potencia = Convertt.ToString(txtRange.Text);
            }
            if (hfIdEvento.Value != "")
            {
                objEvento.Id = Convert.ToInt32(hfIdEvento.Value);
            }
            if (hfIdAgenda.Value != "")
            {
                objEvento.ObjAgenda.Id = Convert.ToInt32(hfIdAgenda.Value);
            }
            if (hfIdDispositivo.Value != "")
            {
                objEvento.ObjDispositvo.Id = Convert.ToInt32(hfIdDispositivo.Value);
            }
            for (int i = 0; i < objsRadioButton.Count; i++)
            {
                if (objsRadioButton[i].Checked == true)
                {
                    objEvento.ObjComando = boComando.BuscarComandoIdBotao(objsRadioButton[i].ID);
                }
            }

            return(objEvento);
        }