Exemplo n.º 1
0
        public JsonResult InserirAulas(string listaAulas)
        {
            var         listaConvertida  = JsonConvert.DeserializeObject <List <Aula> >(listaAulas);
            ControleBO  controle         = new ControleBO();
            List <int>  construcao       = new List <int>();
            List <Aula> aulasencontradas = new List <Aula>();

            for (int i = 0; i < listaConvertida.Count; i++)
            {
                construcao.Add(listaConvertida[i].Construcao);
            }

            aulasencontradas = controle.BuscarAula(construcao);

            if (aulasencontradas.Count == 0)
            {
                controle.InserirAulas(listaConvertida);
            }
            //else
            //{
            //    for (int i = 0; i < aulasencontradas.Count; i++)
            //    {
            //        aulasencontradas[i].Construcao != listaConvertida[];
            //    }
            //}


            return(Json(JsonRequestBehavior.AllowGet));
        }
        //METODOS PRINCIPAIS
        protected void Load()
        {
            boDispositivo = new DispositivoBO();
            boDivisao     = new DivisaoBO();
            boControle    = new ControleBO();

            Divisao     objDivisao     = (Divisao)Session["objDivisao"];
            Controle    objControle    = (Controle)Session["objControle"];
            Dispositivo objDispositivo = (Dispositivo)Session["objDispositivo"];

            if (!IsPostBack)
            {
                PreecherFormulario(objDispositivo);
                if (objDivisao != null)
                {
                    PreecherDivisao(objDivisao);
                }
                if (objControle != null)
                {
                    PreecherControle(objControle);
                }
            }
            else
            {
                Session["objDispositivo"] = RecuperarObjeto();
            }
        }
        protected void CriarControlesDinamicos(Evento objEvento)
        {
            ControleBO boControle = new ControleBO();

            txtRange        = new TextBox();
            objsRadioButton = new List <RadioButton>();
            Controle objControle = boControle.BuscarComandosControle(objEvento.ObjDispositvo.ObjControle);

            for (int i = 0; i < objControle.ObjsComandos.Count; i++)
            {
                if (objControle.ObjsComandos[i].Estilo == "btn-touch-nulo")
                {
                    btnGravar.Enabled = false;
                    ExibirMensagem("a", "Esse dispositivo não pode ter agendamento");
                }
                else if (objControle.ObjsComandos[i].Estilo != "range-touch-inteiro")
                {
                    HtmlGenericControl divComando = new HtmlGenericControl("div");
                    divComando.Attributes.Add("class", "divchcomando");
                    divVisualizacaoAgendamento.Controls.Add(divComando);

                    HtmlGenericControl pComando = new HtmlGenericControl("p");
                    pComando.InnerText = objControle.ObjsComandos[i].Nome;
                    divComando.Controls.Add(pComando);

                    RadioButton rb = new RadioButton();
                    rb.ID        = "rdb" + objControle.ObjsComandos[i].Id;
                    rb.GroupName = "rbComando";
                    divComando.Controls.Add(rb);
                    objsRadioButton.Add(rb);
                    if (objEvento != null)
                    {
                        if (objControle.ObjsComandos[i].Id == objEvento.ObjComando.Id)
                        {
                            rb.Checked = true;
                        }
                        else
                        {
                            rb.Checked = false;
                        }
                    }
                }
                else if (objControle.ObjsComandos[i].Estilo == "range-touch-inteiro")
                {
                    TextBox range = new TextBox();
                    range.ID           = "txt" + objControle.ObjsComandos[i].Id.ToString();
                    range.CssClass     = objControle.ObjsComandos[i].Estilo;
                    range.Text         = objControle.ObjsComandos[i].Cmd;
                    range.TextMode     = TextBoxMode.Range;
                    range.TextChanged += range_TextChanged;
                    range.AutoPostBack = true;
                    txtRange           = range;
                    divVisualizacaoAgendamento.Controls.Add(range);
                    lblValorRange      = new Label();
                    lblValorRange.Text = txtRange.Text + "%";
                    lblValorRange.Attributes.Add("class", "lblrange");
                    divVisualizacaoAgendamento.Controls.Add(lblValorRange);
                }
            }
        }
Exemplo n.º 4
0
        protected void Pesquisa()
        {
            ControleBO boControle = new ControleBO();

            switch (ddlPesquisa.Text)
            {
            case "Geral":
                gvPesquisaControle.DataSource = boControle.BuscarGeral(txtPesquisa.Text);
                gvPesquisaControle.DataBind();
                break;
            }
        }
        //METODOS PRICIPAIS
        protected void Load()
        {
            boControle = new ControleBO();
            Controle objControle = (Controle)Session["objControle"];

            if (!IsPostBack)
            {
                PreencherFormulario(objControle);
            }
            else
            {
                Session["objControle"] = RecuperarObjeto();
            }
        }
Exemplo n.º 6
0
        //METODOS PRINCIPAIS
        protected void Selecionar()
        {
            ControleBO bo = new ControleBO();

            Session["objControle"] = bo.BuscarId((int)gvPesquisaControle.SelectedValue);

            if ((string)Session["Retorno"] != null)
            {
                Response.Redirect((string)Session["Retorno"]);
            }
            else
            {
                Response.Redirect(@"~\Forms\Tecnico\WFManterControle.aspx");
            }
        }
Exemplo n.º 7
0
        //METODOS PRINCIPAIS
        protected void Load()
        {
            boControle  = new ControleBO();
            boHistorico = new HistoricoBO();
            Dispositivo obj = (Dispositivo)Session["objDispositivo"];

            if (obj != null)
            {
                CarregarControles(obj);
            }
            else
            {
                Response.Redirect(@"~\Forms\Cliente\WFDispositivo.aspx");
            }
        }
        //METODOS PRINCIPAIS
        protected void Load()
        {
            boControle = new ControleBO();
            boEvento   = new EventoBO();
            Evento objEvento = (Evento)Session["objEvento"];

            if (objEvento != null)
            {
                CarregarControles(objEvento);
            }
            else
            {
                Response.Redirect(@"~\Forms\Cliente\WFDivisao.aspx");
            }
        }
Exemplo n.º 9
0
        //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");
            }
        }
Exemplo n.º 10
0
        protected void PesquisarComando()
        {
            ControleBO boControle = new ControleBO();
            Leitor     obj        = RecuperarObjeto();

            if (obj.ObjDispositivo.Id != 0)
            {
                Session["objControle"] = boDispositivo.BuscarControle(obj.ObjDispositivo).ObjControle;
                Session["objLeitor"]   = obj;
                Session["Retorno"]     = @"~\Forms\Tecnico\WFManterLeitor.aspx";
                Response.Redirect(@"~\Forms\Tecnico\WFBuscarComando.aspx");
            }
            else
            {
                ExibirMensagem("a", "O dispositivo não foi preenchido");
            }
        }
        //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);
            }
        }