Ejemplo n.º 1
0
 private void fillGrid()
 {
     try
     {
         FacilityBll facilityBll = new FacilityBll();
         DataTable   dt          = facilityBll.consultaFacilidades(txtCircuito.Text, txtEstacao.Text, ddlStatus.SelectedValue, txtCnl.Text, txtSerial.Text,
                                                                   txtCto.Text, txtOlt.Text, txtIpOlt.Text, txtCtoAntiga.Text, txtOuterVlan.Text, txtInnerVlan.Text);
         lblTotalTitulo.Text     = " (" + dt.Rows.Count + ")";
         gvFacilidade.DataSource = dt;
         gvFacilidade.DataBind();
     }
     catch (Exception ex)
     {
         Utility.Alertbootsrap(ex.Message, this, upGridView);
     }
 }
Ejemplo n.º 2
0
        private void fillGrid()
        {
            FacilityBll facilityBll = new FacilityBll();

            if (txtCtoSearch.Text != "" || txtIpSearch.Text != "")
            {
                gvRedesignar.DataSource = facilityBll.getFacilitysRedesignate(txtCtoSearch.Text, txtIpSearch.Text, cto.point_id);
            }

            gvRedesignar.DataBind();


            if (gvRedesignar.Rows.Count > 0)
            {
                txtRedesignar.Visible = true;
            }
            else
            {
                lbRedesignar.Attributes.Add("disabled", "true");
            }
        }
Ejemplo n.º 3
0
        //private void paginacao(GridViewPageEventArgs e)
        //{
        //    Utility.PaginacaoGridView(gvFacilidade, e, dt);
        //}

        private void selectRow(int index)
        {
            try
            {
                if (gvFacilidade.DataKeys[index].Values["ID_SUB_PORTA"].Equals(DBNull.Value))
                {
                    FacilityBll facilityBll = new FacilityBll();

                    if (facilityBll.getTotalSubPortaVagoByPorta(Convert.ToInt32(gvFacilidade.DataKeys[index].Values["COMPONENT_ID_PORTA_OLT"])) < 1)
                    {
                        throw new Exception(string.Concat((gvFacilidade.Rows[index].Cells[13].Text.Contains('(') ? gvFacilidade.Rows[index].Cells[13].Text.Split('(').First().Trim() : gvFacilidade.Rows[index].Cells[13].Text)
                                                          , ": ", gvFacilidade.Rows[index].Cells[9].Text, "/", gvFacilidade.Rows[index].Cells[10].Text, "/", gvFacilidade.Rows[index].Cells[11].Text, " sem sub porta VAGO"));
                    }

                    olt.idSubPorta = facilityBll.getIdSubPortaVagoByPorta(Convert.ToInt32(gvFacilidade.DataKeys[index].Values["COMPONENT_ID_PORTA_OLT"]));
                    if (olt.idSubPorta == 0)
                    {
                        throw new Exception(string.Concat((gvFacilidade.Rows[index].Cells[13].Text.Contains('(') ? gvFacilidade.Rows[index].Cells[13].Text.Split('(').First().Trim() : gvFacilidade.Rows[index].Cells[13].Text)
                                                          , ": ", gvFacilidade.Rows[index].Cells[9].Text, "/", gvFacilidade.Rows[index].Cells[10].Text, "/", gvFacilidade.Rows[index].Cells[11].Text, " sem vlan disponível"));
                    }
                }
                else
                {
                    olt.idSubPorta = Convert.ToInt32(gvFacilidade.DataKeys[index].Values["ID_SUB_PORTA"]);
                }

                cto.id                = Convert.ToInt32(gvFacilidade.DataKeys[index].Values["DESIGNATION_ID"]);
                cto.component_id      = Convert.ToInt32(gvFacilidade.DataKeys[index].Values["COMPONENT_ID"]);
                cto.point_id          = Convert.ToInt32(gvFacilidade.DataKeys[index].Values["POINT_ID"]);
                cto.nome              = (gvFacilidade.Rows[index].Cells[2].Text.Contains('(') ? gvFacilidade.Rows[index].Cells[2].Text.Split('(').First().Trim() : gvFacilidade.Rows[index].Cells[2].Text);
                cto.nome_antigo       = (gvFacilidade.Rows[index].Cells[2].Text.Contains('(') ? gvFacilidade.Rows[index].Cells[2].Text.Split('(').Last().Replace(")", "") : string.Empty);
                cto.estacao           = gvFacilidade.Rows[index].Cells[6].Text;
                cto.ponto             = gvFacilidade.Rows[index].Cells[5].Text;
                cto.cnl               = gvFacilidade.Rows[index].Cells[8].Text;
                cto.status            = ((Label)gvFacilidade.Rows[index].FindControl("lblStatus")).Text;
                cto.circuito          = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[4].Text);
                cto.localidade        = gvFacilidade.Rows[index].Cells[7].Text;
                Session["cto_search"] = cto;

                olt.status             = cto.status;
                olt.circuito           = cto.circuito;
                olt.idlogradouro       = (gvFacilidade.DataKeys[index].Values["ID_LOGRADOURO"] != DBNull.Value ? Convert.ToInt32(gvFacilidade.DataKeys[index].Values["ID_LOGRADOURO"]) : 0);
                olt.tecnologia         = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[12].Text);
                olt.nome               = (gvFacilidade.Rows[index].Cells[13].Text.Contains('(') ? gvFacilidade.Rows[index].Cells[13].Text.Split('(').First().Trim() : gvFacilidade.Rows[index].Cells[13].Text);
                olt.nome_gerencia      = (gvFacilidade.Rows[index].Cells[13].Text.Contains('(') ? gvFacilidade.Rows[index].Cells[13].Text.Split('(').Last().Replace(")", "") : string.Empty);
                olt.modelo             = gvFacilidade.Rows[index].Cells[15].Text;
                olt.ipOlt              = gvFacilidade.Rows[index].Cells[14].Text;
                olt.shelf              = gvFacilidade.Rows[index].Cells[9].Text;
                olt.slot               = gvFacilidade.Rows[index].Cells[10].Text;
                olt.porta              = gvFacilidade.Rows[index].Cells[11].Text;
                olt.ont_id             = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[20].Text);
                olt.vlan_banda_larga   = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[16].Text);
                olt.vlan_voz_vobb      = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[17].Text);
                olt.vlan_outer         = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[23].Text);
                olt.vlan_inner         = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[24].Text);
                olt.produto            = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[18].Text);
                olt.cliente            = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[19].Text);
                olt.banda_mb           = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[20].Text);
                olt.ont_id             = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[21].Text);
                olt.serial             = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[22].Text);
                olt.tipoVlanBandaLarga = gvFacilidade.DataKeys[index].Values["TIPO_VLAN_BANDA_LARGA"].ToString();
                Session["olt_search"]  = olt;

                Response.Redirect("change");
            }
            catch (Exception ex)
            {
                Utility.Alertbootsrap(ex.Message, this, upGridView);
            }
        }