Example #1
0
        protected void lbRedesignar_Click(object sender, EventArgs e)
        {
            try
            {
                cto = (Cto)Session["cto_redesignate"];

                OperationsCmApiBll operationsCmApiBll = new OperationsCmApiBll();
                operationsCmApiBll.redesignateFacility(Session["usuario"].ToString(), cto.idOlt
                                                       , Convert.ToInt32(gvRedesignar.DataKeys[gvRedesignar.SelectedIndex].Values["ID_OLT"]),
                                                       cto.point_id, cto.idSubPorta,
                                                       Convert.ToInt32(gvRedesignar.DataKeys[gvRedesignar.SelectedIndex].Values["POINT_ID"]),
                                                       Convert.ToInt32(gvRedesignar.DataKeys[gvRedesignar.SelectedIndex].Values["ID_SUB_PORTA"]),
                                                       txtCircuito.Text, txtStatus.Text);

                divMsg.Attributes.Add("class", "alert alert-success alert-dismissible");
                divMsg.Visible = true;
                lblMsg.Text    = ViewState["MSG_REDESIGNATE"].ToString();
                lbRedesignar.Attributes.Remove("disabled");
            }


            catch (Exception ex)
            {
                divMsg.Attributes.Add("class", "alert alert-danger alert-dismissible");
                divMsg.Visible = true;
                lblMsg.Text    = string.Concat(ex.Message, " - ", ex.InnerException);
            }
        }
Example #2
0
        private void redesignar(int index)
        {
            Cto cto = new Cto();

            cto.point_id               = Convert.ToInt32(gvFacilidade.DataKeys[index].Values["POINT_ID"]);
            cto.idSubPorta             = Convert.ToInt32(gvFacilidade.DataKeys[index].Values["ID_SUB_PORTA"]);
            cto.idOlt                  = Convert.ToInt32(gvFacilidade.DataKeys[index].Values["ID_OLT"]);
            cto.circuito               = gvFacilidade.Rows[index].Cells[4].Text;
            cto.nome                   = gvFacilidade.Rows[index].Cells[2].Text;
            cto.Olt_Nome               = gvFacilidade.Rows[index].Cells[13].Text;
            cto.ipOlt                  = gvFacilidade.Rows[index].Cells[14].Text;
            cto.ponto                  = gvFacilidade.Rows[index].Cells[5].Text;
            cto.shelf_slot_porta       = string.Concat(gvFacilidade.Rows[index].Cells[9].Text, ":", gvFacilidade.Rows[index].Cells[10].Text, ":", gvFacilidade.Rows[index].Cells[11].Text);
            cto.cliente                = gvFacilidade.Rows[index].Cells[18].Text;
            cto.status                 = ((Label)gvFacilidade.Rows[index].FindControl("lblStatus")).Text;
            Session["cto_redesignate"] = cto;

            olt.produto    = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[17].Text);
            olt.banda_mb   = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[19].Text);
            olt.ont_id     = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[20].Text);
            olt.serial     = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[21].Text);
            olt.vlan_outer = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[22].Text);
            olt.vlan_inner = Server.HtmlDecode(gvFacilidade.Rows[index].Cells[23].Text);

            Session["olt_search"] = olt;

            Response.Redirect("redesignate");
        }
Example #3
0
        private void saveFacility(int idPoint, string circuito, string status, string usuario, Olt oltNew, Facility facility = null)
        {
            FacilityHistoricDal facilityHistoricDal = new FacilityHistoricDal();
            FacilityDal         facilityDal         = new FacilityDal();

            Olt oltOld = new Olt();

            oltOld = facilityDal.getOLTAttributsByIdSubPorta(oltNew.idSubPorta);

            operationsCmAPI.atualizaPontoCompoment(idPoint, circuito.Trim(), status);
            operationsCmAPI.atualizaAtributosPortaOLT(oltNew);

            Cto ctoOld = new Cto();

            ctoOld = facilityDal.getCtoDetaisPort(idPoint);

            if (facility == null)
            {
                facility = new Facility();
            }

            facility.usuario    = usuario;
            facility.cto        = ctoOld.nome;
            facility.cnl        = ctoOld.cnl;
            facility.localidade = ctoOld.localidade;
            facility.porta_cto  = ctoOld.ponto;
            facility.ip_olt     = oltNew.ipOlt;
            facility.shelf      = ctoOld.shelf_slot_porta.Split('/').First();
            facility.slot       = ctoOld.shelf_slot_porta.Split('/')[1];
            facility.porta      = ctoOld.shelf_slot_porta.Split('/').Last();

            facility.circuito_novo         = oltNew.circuito.TrimStart();
            facility.status_novo           = oltNew.status;
            facility.cliente_novo          = oltNew.cliente;
            facility.produto_novo          = oltNew.produto;
            facility.banda_mb_novo         = oltNew.banda_mb;
            facility.banda_uplink_novo     = oltNew.banda_uplink;
            facility.ont_id_novo           = oltNew.ont_id;
            facility.serial_novo           = oltNew.serial;
            facility.vlan_inner_novo       = oltNew.vlan_inner;
            facility.vlan_novo             = oltNew.vlan_outer;
            facility.validade_reserva_novo = oltNew.validade_reserva;

            facility.circuito_antigo         = oltOld.circuito;
            facility.status_antigo           = oltOld.status;
            facility.cliente_antigo          = oltOld.cliente;
            facility.produto_antigo          = oltOld.produto;
            facility.banda_mb_antigo         = oltOld.banda_mb;
            facility.banda_uplink_antigo     = oltOld.banda_uplink;
            facility.ont_id_antigo           = oltOld.ont_id;
            facility.serial_antigo           = oltOld.serial;
            facility.vlan_inner_antigo       = oltOld.vlan_inner;
            facility.vlan_antigo             = oltOld.vlan_outer;
            facility.validade_reserva_antigo = oltOld.validade_reserva;
            facilityHistoricDal.save(facility);
        }
Example #4
0
        private void fillFields()
        {
            if (Session["cto_redesignate"] != null)
            {
                cto = (Cto)Session["cto_redesignate"];
            }

            txtCircuito.Text = cto.circuito;
            txtIP.Text       = cto.ipOlt;
            txtOlt.Text      = cto.Olt_Nome;
            txtShelf.Text    = cto.shelf_slot_porta.Split(':').First();
            txtSlot.Text     = cto.shelf_slot_porta.Split(':')[1].ToString();
            txtPorta.Text    = cto.shelf_slot_porta.Split(':').Last();
            txtPortaCto.Text = cto.ponto;
            txtCto.Text      = cto.nome;
            txtCliente.Text  = cto.cliente;
            txtStatus.Text   = cto.status;
        }
Example #5
0
        private void getUrl()
        {
            cto = (Cto)Session["cto_search"];
            DataRow dr = facilityBll.getLatLongByIdCto(cto.id);

            if (dr != null)
            {
                if (!dr["GEO_Y"].Equals("0") && !dr["GEO_X"].Equals("0"))
                {
                    ViewState["URL_CTO"] = "http://maps.google.com/maps?&z=16&q=" + dr["GEO_Y"].ToString().Replace(",", ".") + "+" + dr["GEO_X"].ToString().Replace(",", ".") + "&ll=" + dr["GEO_Y"].ToString().Replace(",", ".") + "+" + dr["GEO_X"].ToString().Replace(",", ".") + "";
                    lbMapa.Visible       = true;
                }
                else
                {
                    lbMapa.Visible = false;
                }
            }
        }
Example #6
0
        private void setFacility()
        {
            olt = (Olt)Session["olt_search"];
            cto = (Cto)Session["cto_search"];

            olt.circuito         = txtCircuito.Text;
            olt.status           = ddlStatus.SelectedValue;
            olt.vlan_inner       = txtVlanInner.Text;
            olt.vlan_outer       = txtVlan.Text;
            olt.cliente          = txtCliente.Text;
            olt.produto          = txtProduto.Text;
            olt.banda_mb         = txtBandaMB.Text;
            olt.banda_uplink     = txtBandaUpLink.Text;
            olt.serial           = txtSerial.Text;
            olt.ont_id           = txtOnt.Text;
            olt.validade_reserva = txtDtValidadeReserva.Text;
            olt.nro_lote         = txtNumero.Text;
            olt.bairro           = Request.Form["ctl00$ContentPlaceHolder$ddlBairro"];
            olt.modelo_ont       = ddlModeloOnt.SelectedValue;
            olt.observacao       = txtObs.Text;
            olt.idlogradouro     = (hfLogradouro.Value != "" ? Convert.ToInt32(hfLogradouro.Value) : 0);
        }
Example #7
0
        public void redesignateFacility(string usuario, int idOltActual, int idOltNew, int pointIdActual, int subPortaIdActual, int pointIdNew, int subPortaIdNew, string circuito, string status)
        {
            try
            {
                FacilityDal facilityDal = new FacilityDal();
                Olt         olt         = new Olt();
                olt            = facilityDal.getOLTAttributsByIdSubPorta(subPortaIdActual, idOltNew);
                olt.idSubPorta = subPortaIdNew;
                olt.acao       = "REDESIGNAR";
                olt.copyVlan   = (idOltActual.Equals(idOltNew) ? true : false);
                operationsCmAPI.atualizaPontoCompoment(pointIdNew, circuito, status);
                operationsCmAPI.atualizaAtributosPortaOLT(olt);

                if (olt.copyVlan == false)
                {
                    FacilityHistoricDal facilityHistoricDal = new FacilityHistoricDal();
                    Facility            facility            = new Facility();
                    Cto cto = new Cto();
                    cto = facilityDal.getCtoDetaisPort(pointIdNew);

                    facility.usuario    = usuario;
                    facility.cto        = cto.nome;
                    facility.cnl        = cto.cnl;
                    facility.localidade = cto.localidade;
                    facility.porta_cto  = cto.ponto;
                    facility.ip_olt     = olt.ipOlt;
                    facility.shelf      = cto.shelf_slot_porta.Split('/').First();
                    facility.slot       = cto.shelf_slot_porta.Split('/')[1];
                    facility.porta      = cto.shelf_slot_porta.Split('/').Last();

                    facility.circuito_novo     = olt.circuito;
                    facility.status_novo       = olt.status;
                    facility.cliente_novo      = olt.cliente;
                    facility.produto_novo      = olt.produto;
                    facility.banda_mb_novo     = olt.banda_mb;
                    facility.banda_uplink_novo = olt.banda_uplink;
                    facility.ont_id_novo       = olt.ont_id;
                    facility.serial_novo       = olt.serial;
                    string vlan_outer_inner = facilityDal.getVlanByIdSubPorta(subPortaIdNew);
                    facility.vlan_inner_novo       = vlan_outer_inner.Split(':').Last();
                    facility.vlan_novo             = vlan_outer_inner.Split(':').First();
                    facility.validade_reserva_novo = olt.validade_reserva;

                    facility.circuito_antigo         = olt.circuito;
                    facility.status_antigo           = olt.status;
                    facility.cliente_antigo          = olt.cliente;
                    facility.produto_antigo          = olt.produto;
                    facility.banda_mb_antigo         = olt.banda_mb;
                    facility.banda_uplink_antigo     = olt.banda_uplink;
                    facility.ont_id_antigo           = olt.ont_id;
                    facility.serial_antigo           = olt.serial;
                    facility.vlan_inner_antigo       = olt.vlan_inner;
                    facility.vlan_antigo             = olt.vlan_outer;
                    facility.validade_reserva_antigo = olt.validade_reserva;
                    facilityHistoricDal.save(facility);
                }

                operationsCmAPI.atualizaPontoCompoment(pointIdActual, string.Empty, "VAGO");
                olt.idSubPorta = subPortaIdActual;
                operationsCmAPI.atualizaAtributosPortaOLT(clearOlt(olt));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Example #8
0
        private void fillFields()
        {
            checkProfile();
            getUrl();

            if (Session["cto_search"] != null)
            {
                cto = (Cto)Session["cto_search"];

                txtCto.Text             = cto.nome;
                txtCtoAntigo.Text       = cto.nome_antigo;
                txtEstacao.Text         = cto.estacao;
                txtCnl.Text             = cto.cnl;
                txtPortaCTO.Text        = cto.ponto;
                txtLocalidade.Text      = cto.localidade;
                txtPais.Text            = "BR";
                ddlStatus.SelectedValue = cto.status;
                txtCircuito.Text        = cto.circuito;
            }

            if (Session["olt_search"] != null)
            {
                olt = (Olt)Session["olt_search"];

                txtOlt.Text               = olt.nome;
                txtOltGerencia.Text       = olt.nome_gerencia;
                txtModelo.Text            = olt.modelo;
                txtIPOlt.Text             = olt.ipOlt;
                txtShelf.Text             = olt.shelf;
                txtSlot.Text              = olt.slot;
                txtPorta.Text             = olt.porta;
                txtTecnologia.Text        = "GPON " + olt.tecnologia;
                txtIPOlt.Text             = olt.ipOlt;
                txtVlanInner.Text         = olt.vlan_inner;
                txtVlan.Text              = olt.vlan_outer;
                txtVlanCompartilhada.Text = olt.vlan_banda_larga;
                txtVlanVobb.Text          = olt.vlan_voz_vobb;
                txtCliente.Text           = olt.cliente;
                txtProduto.Text           = olt.produto;
                txtBandaMB.Text           = olt.banda_mb;
                txtSerial.Text            = olt.serial;
                txtOnt.Text               = olt.ont_id;
                hfLogradouro.Value        = olt.idlogradouro.ToString();

                fillModelOnt(olt.tecnologia);

                if (cto.status.Equals("RESERVADO"))
                {
                    txtDtValidadeReserva.Attributes.Remove("disabled");
                }
            }

            if (!olt.idSubPorta.Equals(DBNull.Value) && olt.idSubPorta != 0)
            {
                DataRow drOlt = facilityBll.getFacilityOLTByIdSubPorta(olt.idSubPorta);

                txtDtValidadeReserva.Text = drOlt["VALIDADE_RESERVA"].ToString();
                txtNomeLogradouro.Text    = drOlt["LOGRADOURO"].ToString();
                ddlBairro.Items.Add(new ListItem(drOlt["BAIRRO"].ToString()));

                if (ddlModeloOnt.Items.FindByValue(drOlt["MODELO_ONT"].ToString()) != null)
                {
                    ddlModeloOnt.Items.FindByValue(drOlt["MODELO_ONT"].ToString()).Selected = true;
                }

                txtObs.Text         = drOlt["OBSERVACAO"].ToString();
                txtNumero.Text      = drOlt["NUMERO_LOTE"].ToString();
                txtBandaUpLink.Text = drOlt["BANDA_UPLINK"].ToString();
                txtVlanInner.Text   = drOlt["VLAN_OUTER_INNER"].ToString().Split(':').Last();
                txtVlan.Text        = drOlt["VLAN_OUTER_INNER"].ToString().Split(':').First();
                txtOnt.Text         = drOlt["ONT_ID"].ToString();
            }

            if (olt.tipoVlanBandaLarga == "COMPARTILHADA")
            {
                txtVlan.ReadOnly      = true;
                txtVlanInner.ReadOnly = true;
                if (txtVlanInner.Text == string.Empty)
                {
                    txtVlanInner.Text = "0";
                }
                if (txtVlan.Text == string.Empty)
                {
                    txtVlan.Text = "0";
                }

                dVlan.Visible = true;
            }
            else
            {
                dVlan.Visible = false;
                dVlanVobb.Attributes.Add("class", "col-sm-2");
            }

            if (!cto.status.Equals("VAGO"))
            {
                lbLiberar.Visible = true;
            }
        }