//METODOS PRINCIPAIS protected void Load() { boComando = new ComandoBO(); boDispositivo = new DispositivoBO(); boLeitor = new LeitorBO(); Leitor objLeitor = (Leitor)Session["objLeitor"]; Dispositivo objDispositivo = (Dispositivo)Session["objDispositivo"]; Comando objComando = (Comando)Session["objComando"]; if (!IsPostBack) { PreecherFormulario(objLeitor); if (objDispositivo != null) { PreecherDispositivo(objDispositivo); } if (objComando != null) { PreecherComando(objComando); } } else { Session["objLeitor"] = RecuperarObjeto(); } }
//METODOS PRINCIPAIS protected void Load() { boComando = new ComandoBO(); boControle = new ControleBO(); Controle objControle = (Controle)Session["objControle"]; if (objControle != null) { CarregarControle(objControle); } else { Response.Redirect(@"~\Forms\Tecnico\WFManterLeitor.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); }
//METODOS PRINCIPAIS protected void Load() { boComando = new ComandoBO(); boControle = new ControleBO(); Controle objControle = (Controle)Session["objControle"]; if (objControle != null) { if (objControle.Id != 0) { CarregarControle(objControle); } } if (!IsPostBack) { PreencherFormulario(objControle); } else { ScriptManager.RegisterStartupScript(Page, this.GetType(), "ScrollPage", "window.scroll(0,1200);", true); } }