protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["busqueda"] != null)
            {
                string searchQuery = Request.QueryString["busqueda"].Trim();

                if (searchQuery != "")
                {
                    serviciozapateriaw.zapateriawsSoapClient appService = new serviciozapateriaw.zapateriawsSoapClient();
                    var clienteList = appService.getClienteByField(searchQuery);

                    foreach (var element in clienteList)
                    {
                        this.gridBody.InnerHtml += "<div class='grid-body-row'>";
                        this.gridBody.InnerHtml += "    <div class='body-cell'>" + element.NomCliente1 + "</div>";
                        this.gridBody.InnerHtml += "    <div class='body-cell'>" + element.ApeCliente1 + "</div>";
                        this.gridBody.InnerHtml += "    <div class='body-cell'>" + element.TelCliente1 + "</div>";
                        this.gridBody.InnerHtml += "    <div class='body-cell'>";
                        this.gridBody.InnerHtml += "        <a href='UpdateCliente.aspx?object_id=" + element.Id_cliente + "'>Editar</a>";
                        this.gridBody.InnerHtml += "    </div>";
                        this.gridBody.InnerHtml += "</div>";
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["busqueda"] != null)
            {
                string searchQuery = Request.QueryString["busqueda"].Trim();

                if (searchQuery != "")
                {
                    serviciozapateriaw.zapateriawsSoapClient appService = new serviciozapateriaw.zapateriawsSoapClient();
                    var clienteList = appService.getAllDetavent();

                    foreach (var element in clienteList)
                    {
                        this.gridBody.InnerHtml += "<div class='grid-body-row'>";
                        this.gridBody.InnerHtml += "    <div class='body-cell'>" + element.Ventas + "</div>";
                        this.gridBody.InnerHtml += "    <div class='body-cell'>" + element.Zapatos + "</div>";
                        this.gridBody.InnerHtml += "    <div class='body-cell'>" + element.Empleados + "</div>";
                        this.gridBody.InnerHtml += "    <div class='body-cell'>" + element.TotalPagar1 + "</div>";
                        this.gridBody.InnerHtml += "    <div class='body-cell'>" + element.CantidadProducto1 + "</div>";
                        this.gridBody.InnerHtml += "    <div class='body-cell'>";
                        this.gridBody.InnerHtml += "        <a href='UpdateCliente.aspx?object_id=" + element.Id_detalleVenta + "'>Editar</a>";
                        this.gridBody.InnerHtml += "    </div>";
                        this.gridBody.InnerHtml += "</div>";
                    }
                }
            }
        }
        protected void btnagregar_Click(object sender, EventArgs e)
        {
            Int32   codeventa    = 2;
            Int32   codcliente   = checkcmb(Convert.ToInt32(cmbCliente.SelectedIndex));
            Int32   codproducto  = checkcmb(Convert.ToInt32(cmbProducto.SelectedIndex));
            Int32   codempleado  = checkcmb(Convert.ToInt32(cmbEmpleado.SelectedIndex));
            Int32   cantproducto = comprobarint(txtcantproducto.Text);
            Decimal totalpagar   = comprobardecimal(txttotalpagar.Text);
            String  Message      = "error";

            serviciozapateriaw.zapateriawsSoapClient appService = new serviciozapateriaw.zapateriawsSoapClient();


            int transactionResult = appService.agregarDetavent(codeventa, codproducto, codempleado, cantproducto, totalpagar

                                                               );

            if (transactionResult == 1)
            {
                string targetUrl = Request.Url.GetLeftPart(UriPartial.Path);
                Response.Redirect(targetUrl + "?response=DataAdded");
            }
            else
            {
                string targetUrl = Request.Url.GetLeftPart(UriPartial.Path);
                Response.Redirect(targetUrl + "?response=Error");
            }
        }
        protected void deleteFormData(object sender, EventArgs e)
        {
            serviciozapateriaw.zapateriawsSoapClient appService = new serviciozapateriaw.zapateriawsSoapClient();

            int transactionResult = appService.deleteClientes(Convert.ToInt32(hddn_idCliente.Value));

            if (transactionResult == 1)
            {
                string targetUrl = Request.Url.GetLeftPart(UriPartial.Path);
                Response.Redirect(targetUrl + "?response=Deleted");
            }
            else
            {
                string targetUrl = Request.Url.GetLeftPart(UriPartial.Path);
                Response.Redirect(targetUrl + "?response=Error");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["object_id"] != null)
                {
                    serviciozapateriaw.zapateriawsSoapClient appService = new serviciozapateriaw.zapateriawsSoapClient();

                    int objectId = Convert.ToInt32(Request.QueryString["object_id"]);

                    var singleObjectInstance = appService.gatClientesById(objectId);

                    this.hddn_idCliente.Value       = singleObjectInstance.Id_cliente.ToString();
                    this.txbx_nombreCliente.Text    = singleObjectInstance.NomCliente1;
                    this.txbx_apellidoCliente.Text  = singleObjectInstance.ApeCliente1;
                    this.txbx_telefonoCliente.Text  = singleObjectInstance.TelCliente1;
                    this.txbx_direccionCliente.Text = singleObjectInstance.DireccionCliente1;
                }
            }
        }
Ejemplo n.º 6
0
        protected void btnRegistrar_Click(object sender, EventArgs e)
        {
            if (IsValid)
            {
                serviciozapateriaw.zapateriawsSoapClient ws = new serviciozapateriaw.zapateriawsSoapClient();
                String usuario    = this.txtUsuario.Text.Trim();
                String contraseña = this.txtContraseña.Text.Trim();

                serviciozapateriaw.usuarios usuario2 = ws.login(usuario, contraseña);

                if (usuario != null)
                {
                    this.Session["usuario"] = usuario;
                    this.Response.Redirect("/Default.aspx");
                }
                else
                {
                    this.Response.Redirect("/Login.aspx");
                }
            }
        }
Ejemplo n.º 7
0
        protected void saveFormData(object sender, EventArgs e)
        {
            serviciozapateriaw.zapateriawsSoapClient appService = new serviciozapateriaw.zapateriawsSoapClient();

            int transactionResult = appService.agregarCliente(
                this.txbx_nombreCliente.Text,
                this.txbx_apellidoCliente.Text,
                this.txbx_telefonoCliente.Text,
                this.txbx_direccionCliente.Text
                );

            if (transactionResult == 1)
            {
                string targetUrl = Request.Url.GetLeftPart(UriPartial.Path);
                Response.Redirect(targetUrl + "?response=DataAdded");
            }
            else
            {
                string targetUrl = Request.Url.GetLeftPart(UriPartial.Path);
                Response.Redirect(targetUrl + "?response=Error");
            }
        }
        protected void updateFormData(object sender, EventArgs e)
        {
            serviciozapateriaw.zapateriawsSoapClient appService = new serviciozapateriaw.zapateriawsSoapClient();

            int transactionResult = appService.updateClientes(
                Convert.ToInt32(hddn_idCliente.Value),
                txbx_nombreCliente.Text,
                txbx_apellidoCliente.Text,
                txbx_telefonoCliente.Text,
                txbx_direccionCliente.Text
                );

            if (transactionResult == 1)
            {
                string targetUrl = Request.Url.GetLeftPart(UriPartial.Path);
                Response.Redirect(targetUrl + "?response=Updated");
            }
            else
            {
                string targetUrl = Request.Url.GetLeftPart(UriPartial.Path);
                Response.Redirect(targetUrl + "?response=Error");
            }
        }