Пример #1
0
 protected void btnGuardarDetalle_Click(object sender, EventArgs e)
 {
     try
     {
         tbl_DET_Sitio mdlDetalle = new tbl_DET_Sitio();
         mdlDetalle = obtenerDetalle();
         if (mdlDetalle != null)
         {
             bool valido = false;
             valido = NapoleonDA.setDetalleSitioEdicion(mdlDetalle);
             if (valido)
             {
                 ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ConfigModal", "$('#ConfigModal').modal('hide');", true);
                 ShowMessage("Se actualizó correctamente los datos.", MessageType.Correcto, "alert_container");
             }
             else
             {
                 ShowMessage("Existe un error, favor de verificar la información", MessageType.Error, "alert_container");
             }
         }
     }
     catch (Exception eBCD)
     {
         Log.EscribeLog("Existe un error en btnGuardarDetalle_Click: " + eBCD.Message);
     }
 }
Пример #2
0
        public tbl_DET_Sitio getDetalleSitio(int id_Sitio)
        {
            tbl_DET_Sitio _lstSitio = new tbl_DET_Sitio();

            try
            {
                NapoleonDataAccess controller = new NapoleonDataAccess();
                _lstSitio = controller.getDetalleSitio(id_Sitio);
            }
            catch (Exception egS)
            {
                throw egS;
            }
            return(_lstSitio);
        }
Пример #3
0
        public bool setDetalleSitioEdicion(tbl_DET_Sitio detalle)
        {
            bool valido = false;

            try
            {
                NapoleonDataAccess controller = new NapoleonDataAccess();
                valido = controller.setDetalleSitioEdicion(detalle);
            }
            catch (Exception egS)
            {
                valido = false;
                Log.EscribeLog("Existe un error en setDetalleSitioEdicion: " + egS.Message);
            }
            return(valido);
        }
Пример #4
0
 private void fillDetallleSitio(tbl_DET_Sitio mdlDetalle)
 {
     try
     {
         Label2.Text      = mdlDetalle.intDETSitioID.ToString();
         txtSCULocal.Text = mdlDetalle.vchAETitleSCU;
         txtSCPVNA.Text   = mdlDetalle.vchAETitleSCP;
         string[] ipformato = mdlDetalle.vchVNAIP.Split('.');
         txtIPVNA1.Text    = ipformato[0].ToString();
         txtIPVNA2.Text    = ipformato[1].ToString();
         txtIPVNA3.Text    = ipformato[2].ToString();
         txtIPVNA4.Text    = ipformato[3].ToString();
         txtPuertoVNA.Text = mdlDetalle.intPuertoSCP.ToString();
     }
     catch (Exception efDS)
     {
         Log.EscribeLog("Existe un error en frmConfigSites en fillDetallleSitio: " + efDS.Message);
     }
 }
Пример #5
0
        protected void grvBusqueda_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                int id_Site = 0;
                tbl_RegistroSitio mdlUsuario = new tbl_RegistroSitio();
                switch (e.CommandName)
                {
                case "viewEditar":
                    id_Site = Convert.ToInt32(e.CommandArgument.ToString());
                    tbl_RegistroSitio mdl = new tbl_RegistroSitio();
                    mdl = NapoleonDA.getRegistroContacto(id_Site);
                    if (mdl != null)
                    {
                        fillContacto(mdl);
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal", "$('#myModal').modal();", true);
                        upModal.Update();
                    }
                    break;

                case "Configuracion":
                    id_Site = Convert.ToInt32(e.CommandArgument.ToString());
                    tbl_DET_Sitio mdlDetalle = new tbl_DET_Sitio();
                    mdlDetalle = NapoleonDA.getDetalleSitio(id_Site);
                    if (mdlDetalle != null)
                    {
                        Control     ctl        = e.CommandSource as Control;
                        GridViewRow CurrentRow = ctl.NamingContainer as GridViewRow;
                        Label1.Text    = grvBusqueda.DataKeys[CurrentRow.RowIndex].Values["vchNombreSitio"].ToString();  //vchNombreSitio
                        lblIDSite.Text = id_Site.ToString();
                        fillDetallleSitio(mdlDetalle);
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ConfigModal", "$('#ConfigModal').modal();", true);
                        upConfigModal.Update();
                    }
                    break;
                }
            }
            catch (Exception eRC)
            {
                Log.EscribeLog("Existe un error en grvBusqueda_RowCommand: " + eRC.Message);
            }
        }
Пример #6
0
        private tbl_DET_Sitio obtenerDetalle()
        {
            tbl_DET_Sitio mdl = new tbl_DET_Sitio();

            try
            {
                mdl.bitActivo     = true;
                mdl.datFecha      = DateTime.Now;
                mdl.id_Sitio      = Convert.ToInt32(lblIDSite.Text);
                mdl.intDETSitioID = Convert.ToInt32(Label2.Text);
                mdl.intPuertoSCP  = Convert.ToInt32(txtPuertoVNA.Text);
                mdl.vchAETitleSCP = txtSCPVNA.Text;
                mdl.vchAETitleSCU = txtSCULocal.Text;
                mdl.vchUserAdmin  = user.vchUsuario;
                mdl.vchVNAIP      = txtIPVNA1.Text + "." + txtIPVNA2.Text + "." + txtIPVNA3.Text + "." + txtIPVNA4.Text;
            }
            catch (Exception eBCD)
            {
                mdl = null;
                Log.EscribeLog("Existe un error en obtenerDetalle: " + eBCD.Message);
            }
            return(mdl);
        }