Exemple #1
0
    public static Dictionary <string, string> modificarCliente(string rut)
    {
        int id = Convert.ToInt32(rut);

        DataTable dt = new DataTable();

        try
        {
            dt = new ForwardersBLL().sp_selPlanDesc_forwarderBLL(id);
        }
        catch (Exception ex)
        {
            throw ex;
        }

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

        cliente.Add("Rut_cliente", dt.Rows[0].ItemArray[0].ToString());
        cliente.Add("gls_nombre_cliente", dt.Rows[0].ItemArray[1].ToString());
        cliente.Add("gls_password", dt.Rows[0].ItemArray[2].ToString());
        cliente.Add("gls_mail", dt.Rows[0].ItemArray[4].ToString());
        cliente.Add("dv_cliente", dt.Rows[0].ItemArray[5].ToString());
        cliente.Add("fono", dt.Rows[0].ItemArray[3].ToString());

        return(cliente);
    }
Exemple #2
0
    public static string eliminarCliente(string rut)
    {
        ForwardersBO cliente = new ForwardersBO();

        cliente.Rut_cliente = Convert.ToInt32(rut);

        DataTable dt = new ForwardersBLL().sp_del_ForwarderBLL(cliente);

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

        return(codstring);
    }
Exemple #3
0
        public string EditarCliente(ref GlobalResponse globalResponse, string rut_cliente)
        {
            DataTable dt = new DataTable();

            try
            {
                dt = new ForwardersBLL().sp_selPlanDesc_forwarderBLL(Convert.ToInt32(rut_cliente));
            }
            catch (Exception ex)
            {
                globalResponse.Message  = ex.Message;
                globalResponse.HasError = true;
            }

            return(JsonConvert.SerializeObject(dt));
        }
Exemple #4
0
    public void cargarForwarders()
    {
        StringBuilder strblVideo = new StringBuilder();
        Literal       lTabla     = new Literal();
        string        tabla      = string.Empty;

        DataTable dt = new ForwardersBLL().sp_sel_ForwarderBLL();

        strblVideo.Append("<thead>");
        strblVideo.Append("<th>ELIMINAR</th>");
        strblVideo.Append("<th>EDITAR</th>");
        strblVideo.Append("<th>RUT</th>");
        strblVideo.Append("<th>DV</th>");
        strblVideo.Append("<th>NOMBRE</th>");
        strblVideo.Append("<th>PASS</th>");
        strblVideo.Append("<th>FONO</th>");
        strblVideo.Append("<th>EMAIL</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["rut_cliente"] + " runat=\"server\" onclick=\"eliminar(this.id); \" class=\"btn red\" >" +
                              "<i class=\"fa fa-trash-o\"></i></button>" + "</td>");
            strblVideo.Append("<td><button id=" + row["rut_cliente"] + " runat=\"server\" onclick=\"modificar(this.id);\" class=\"btn blue\" >" +
                              "<i class=\"fa fa-edit\"></i></button>" + "</td>");
            strblVideo.Append("<td>" + row["rut_cliente"] + "</td>");
            strblVideo.Append("<td>" + row["dv_cliente"] + "</td>");
            strblVideo.Append("<td>" + row["gls_nombre_cliente"] + "</td>");
            strblVideo.Append("<td>" + row["gls_password"] + "</td>");
            strblVideo.Append("<td>" + row["n_fono"] + "</td>");
            strblVideo.Append("<td>" + row["gls_mail"] + "</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;
    }
Exemple #5
0
        public List <ForwardersBO> ObtClientes(ref GlobalResponse globalResponse)
        {
            var clientes = new List <ForwardersBO>();

            try
            {
                var resultados = new ForwardersBLL().sp_sel_ForwarderBLL();
                clientes.AddRange(from DataRow row in resultados.Rows select new ForwardersBO {
                    Rut_cliente = Convert.ToInt32(row[0].ToString()), Nombre_cliente = row[1].ToString(), Dv_cliente = row[5].ToString(), Pass_cliente = row[2].ToString()
                });
            }
            catch (Exception ex)
            {
                globalResponse.Message  = ex.Message;
                globalResponse.HasError = true;
            }

            return(clientes);
        }
Exemple #6
0
        public static void EliminarCliente(ref GlobalResponse globalResponse, string rut)
        {
            ForwardersBO cliente = new ForwardersBO();

            string rut_cliente = rut.Remove(rut.Length - 2, 2);

            cliente.Rut_cliente = Convert.ToInt32(rut_cliente);

            DataTable dt = new DataTable();

            try
            {
                dt = new ForwardersBLL().sp_del_ForwarderBLL(cliente);
            }
            catch (Exception ex)
            {
                globalResponse.Message  = ex.Message;
                globalResponse.HasError = true;
            }
        }
Exemple #7
0
        public static void GuardarEditCliente(ref GlobalResponse globalresponse, string rut, string nombre, string mail, string password, string fono)
        {
            ForwardersBO cliente = new ForwardersBO();

            cliente.Rut_cliente    = Convert.ToInt32(rut);
            cliente.Nombre_cliente = nombre;
            cliente.Pass_cliente   = password;
            cliente.Email_cliente  = mail;
            cliente.Fono_cliente   = Convert.ToInt32(fono);

            DataTable dt = new DataTable();

            try
            {
                dt = new ForwardersBLL().sp_updt_ForwarderBLL(cliente);
            }
            catch (Exception ex)
            {
                globalresponse.Message  = ex.Message;
                globalresponse.HasError = true;
            }
        }
Exemple #8
0
    protected void btnModificar_Click(object sender, EventArgs e)
    {
        if (!ValidarCamposMod())
        {
            return;
        }

        DataTable    dt = new DataTable();
        ForwardersBO fw = new ForwardersBO();

        try
        {
            string razon, password, email;
            int    rut, fono;
            razon    = txtRazMod.Text;
            password = txtPassMod.Text;
            email    = txtEmailMod.Text;
            rut      = Convert.ToInt32(txtRutMod.Text);
            fono     = Convert.ToInt32(txtFonoMod.Text);

            ForwardersBO forwarder = new ForwardersBO();
            forwarder.Rut_cliente    = rut;
            forwarder.Nombre_cliente = razon;
            forwarder.Pass_cliente   = password;
            forwarder.Email_cliente  = email;
            forwarder.Fono_cliente   = fono;

            dt = new ForwardersBLL().sp_updt_ForwarderBLL(forwarder);
        }
        catch (Exception ex)
        {
            throw ex;
        }

        limpiarFormulario();
        Response.Redirect("ForwardersDesc.aspx");
    }