Esempio n. 1
0
    protected void btnModificar_Click(object sender, EventArgs e)
    {
        if (!ValidarCamposMod())
        {
            cargarGrilla();
            return;
        }

        DataTable    dt         = new DataTable();
        TerminalesBO terminalBO = new TerminalesBO();

        try
        {
            terminalBO.Age_cod = Convert.ToInt32(txtCodMod.Text);
            terminalBO.Age_nom = txtNomMod.Text;

            dt = new TerminalesBLL().sp_updt_terminalesBLL(terminalBO);

            cargarGrilla();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Esempio n. 2
0
    protected void btnGuardar_Click(object sender, EventArgs e)
    {
        if (!ValidarCamposBusqueda())
        {
            cargarGrilla();
            return;
        }

        int       codigo = Convert.ToInt32(txtCodigo.Text);
        string    nombre = txtNombre.Text;
        DataTable dt     = new DataTable();

        TerminalesBO terminal = new TerminalesBO();

        terminal.Age_cod = codigo;
        terminal.Age_nom = nombre;

        try
        {
            dt = new TerminalesBLL().sp_ins_terminalesBLL(terminal);
            cargarGrilla();
        }
        catch (Exception ex)
        {
            throw ex;
        }

        limpiarForm();
    }
Esempio n. 3
0
    public static string eliminarTerminal(string codigo)
    {
        TerminalesBO terminal = new TerminalesBO();

        terminal.Age_cod = Convert.ToInt32(codigo);

        DataTable dt = new TerminalesBLL().sp_del_terminalesBLL(terminal);

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

        return(codstring);
    }
Esempio n. 4
0
        public string EditarTerminales(ref GlobalResponse globalResponse, string codigo)
        {
            DataTable dt = new DataTable();

            try
            {
                dt = new TerminalesBLL().sp_sel_terminalIDBLL(Convert.ToInt32(codigo));
            }
            catch (Exception ex)
            {
                globalResponse.Message  = ex.Message;
                globalResponse.HasError = true;
            }

            return(JsonConvert.SerializeObject(dt));
        }
Esempio n. 5
0
        public static void EliminarTerminal(ref GlobalResponse globalResponse, string codigo)
        {
            TerminalesBO terminal = new TerminalesBO();

            terminal.Age_cod = Convert.ToInt32(codigo);

            DataTable dt = new DataTable();

            try
            {
                dt = new TerminalesBLL().sp_del_terminalesBLL(terminal);
            }
            catch (Exception ex)
            {
                globalResponse.Message  = ex.Message;
                globalResponse.HasError = true;
            }
        }
Esempio n. 6
0
        public static void GuardarTerminalEdit(ref GlobalResponse globalresponse, string codigo, string descripcion)
        {
            TerminalesBO terminal = new TerminalesBO();

            terminal.Age_cod = Convert.ToInt32(codigo);
            terminal.Age_nom = descripcion;

            DataTable dt = new DataTable();

            try
            {
                dt = new TerminalesBLL().sp_updt_terminalesBLL(terminal);
            }
            catch (Exception ex)
            {
                globalresponse.Message  = ex.Message;
                globalresponse.HasError = true;
            }
        }
Esempio n. 7
0
        public List <TerminalesBO> ObtTerminales(ref GlobalResponse globalResponse)
        {
            var terminales = new List <TerminalesBO>();

            try
            {
                var resultados = new TerminalesBLL().sp_sel_terminalesBLL();
                terminales.AddRange(from DataRow row in resultados.Rows select new TerminalesBO {
                    Age_cod = Convert.ToInt32(row[0].ToString()), Age_nom = row[1].ToString()
                });
            }
            catch (Exception ex)
            {
                globalResponse.Message  = ex.Message;
                globalResponse.HasError = true;
            }

            return(terminales);
        }
Esempio n. 8
0
    public void cargarGrilla()
    {
        StringBuilder strblVideo = new StringBuilder();
        Literal       lTabla     = new Literal();
        string        tabla      = string.Empty;

        DataTable dt = new DataTable();

        dt = new TerminalesBLL().sp_sel_terminalesBLL();

        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["TERMINAL"] + "</td>"); strblVideo.Append("</tr>");
        }

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

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

        pnlTablaTerminales.Controls.Clear();

        pnlTablaTerminales.Controls.Add(lTabla);
        pnlTablaTerminales.Visible = true;
        UpdatePanel1.Update();
    }
Esempio n. 9
0
    public static Dictionary <string, string> modificarTerminal(string codigo)
    {
        int id = Convert.ToInt32(codigo);

        DataTable dt = new DataTable();

        try
        {
            dt = new TerminalesBLL().sp_sel_terminalIDBLL(id);
        }
        catch (Exception ex)
        {
            throw ex;
        }

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

        terminal.Add("Age_cod", dt.Rows[0].ItemArray[0].ToString());
        terminal.Add("Age_nom", dt.Rows[0].ItemArray[1].ToString());

        return(terminal);
    }