Exemplo n.º 1
0
    protected void btnModificar_Click(object sender, EventArgs e)
    {
        if (!ValidarCamposMod())
        {
            return;
        }
        DataTable dt = new DataTable();

        string cod    = txtModCOd.Text;
        string nombre = txtNomMod.Text;

        PuertosBO puerto = new PuertosBO();

        puerto.Cod_puerto        = cod;
        puerto.Gls_nombre_puerto = nombre;

        try
        {
            dt = new PuertoBLL().sp_updt_puertoBLL(puerto);
        }
        catch (Exception ex)
        {
            var visibilityClass = "alert alert-danger";
            var style           = "display:block;";
            mensajeError.Attributes["class"] = visibilityClass;
            mensajeError.Attributes["style"] = style;
            cv_Resultado.Text = "Ocurrio un error al cargar los datos: " + ex.Message;
        }

        Response.Redirect("PuertosDesc.aspx");
    }
Exemplo n.º 2
0
    public static string eliminarPuertos(string codigo)
    {
        PuertosBO puertos = new PuertosBO();

        puertos.Cod_puerto = codigo;

        DataTable dt = new PuertoBLL().sp_del_puertoBLL(puertos);

        string codstring = dt.Rows[0].ItemArray[0].ToString();

        return(codstring);
    }
Exemplo n.º 3
0
        public List <PuertosBO> ObtPuertos(ref GlobalResponse globalResponse)
        {
            var puertos = new List <PuertosBO>();

            try
            {
                var resultados = new PuertoBLL().sp_sel_puertoBLL();
                puertos.AddRange(from DataRow row in resultados.Rows select new PuertosBO {
                    Cod_puerto = row[0].ToString(), Gls_nombre_puerto = row[1].ToString()
                });
            }
            catch (Exception ex)
            {
                globalResponse.Message  = ex.Message;
                globalResponse.HasError = true;
            }

            return(puertos);
        }
Exemplo n.º 4
0
    public static Dictionary <string, string> modificarPuertos(string codigo)
    {
        DataTable dt = new DataTable();

        try
        {
            dt = new PuertoBLL().sp_sel_puertoIDBLL(codigo);
        }
        catch (Exception ex)
        {
            throw ex;
        }

        Dictionary <string, string> puerto = new Dictionary <string, string>();

        puerto.Add("Cod_puerto", dt.Rows[0].ItemArray[0].ToString());
        puerto.Add("Nom_puerto", dt.Rows[0].ItemArray[1].ToString());

        return(puerto);
    }
Exemplo n.º 5
0
    private void cargarGrilla()
    {
        StringBuilder strblVideo = new StringBuilder();
        Literal       lTabla     = new Literal();
        string        tabla      = string.Empty;

        DataTable dt = new DataTable();

        dt = new PuertoBLL().sp_sel_puertoBLL();

        strblVideo.Append("<thead>");
        strblVideo.Append("<th>ELIMINAR</th>");
        strblVideo.Append("<th>EDITAR</th>");
        strblVideo.Append("<th>CODIGO</th>");
        strblVideo.Append("<th>NOMBRE</th>");
        strblVideo.Append("</thead>");
        strblVideo.Append("<tbody>");
        foreach (DataRow row in dt.Rows)
        {
            strblVideo.Append("<tr class=odd gradeX>");
            strblVideo.Append("<td><button id=" + row["CODIGO"] + " runat=\"server\" onclick=\"eliminar(this.id); \" class=\"btn red\" >" +
                              "<i class=\"fa fa-trash-o\"></i></button>" + "</td>");
            strblVideo.Append("<td><button id=" + row["CODIGO"] + " runat=\"server\" onclick=\"modificar(this.id);\" class=\"btn blue\" >" +
                              "<i class=\"fa fa-edit\"></i></button>" + "</td>");
            strblVideo.Append("<td>" + row["CODIGO"] + "</td>");
            strblVideo.Append("<td>" + row["NOMBRE"] + "</td>"); strblVideo.Append("</tr>");
        }

        strblVideo.Append("</tbody>");

        tabla       = strblVideo.ToString();
        lTabla.Text = tabla;

        pnlTablaVideos.Controls.Add(lTabla);
        pnlTablaVideos.Visible = true;
        UpdatePanel1.Update();
        UpdatePanel1.Visible = true;
    }