Пример #1
0
 private void pasarde0a1()
 {
     ServiceVenta.WebServiceVentaSoapClient Aux_negProv = new ServiceVenta.WebServiceVentaSoapClient();
     ServiceVenta.Venta new_proc = new ServiceVenta.Venta();
     new_proc.Diferenciador = 1;
     Aux_negProv.ServiceActulizarVent(new_proc);
 }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (String.IsNullOrEmpty(this.txtIdProducto.Text) || String.IsNullOrEmpty(this.txtCantidad.Text) || String.IsNullOrEmpty(this.txtPagarxProducto.Text))
                {
                    MessageBox.Show("No se pueden dejar datos en blanco ", "Mensaje Sistema");
                    return;
                }
                ServiceProducto.WebServiceProductoSoapClient new_procc = new ServiceProducto.WebServiceProductoSoapClient();
                int cantidadbsd = new_procc.ServiceGetCantidadP(txtIdProducto.Text);
                int cantGUI     = Convert.ToInt32(txtCantidad.Text);
                int resta       = cantidadbsd - cantGUI;
                if (cantidadbsd < cantGUI)
                {
                    MessageBox.Show("Error la cantidad excede la cantidad del stock: " + cantidadbsd, "Mensaje Sistema");
                    return;
                }
                else
                {
                    new_procc.ServiceSetCantidadP(txtIdProducto.Text, resta);
                    txtRutCliente.ReadOnly = true;
                    ServiceVenta.WebServiceVentaSoapClient Aux_negProv = new ServiceVenta.WebServiceVentaSoapClient();
                    ServiceVenta.Venta new_proc = new ServiceVenta.Venta();
                    new_proc.Idproducto = this.txtIdProducto.Text;
                    if (String.IsNullOrEmpty(this.txtRutCliente.Text))
                    {
                        new_proc.Rutcliente = null;
                    }
                    new_proc.Rutcliente    = this.txtRutCliente.Text;
                    new_proc.Cantidad      = Convert.ToInt32(this.txtCantidad.Text);
                    new_proc.Total         = Convert.ToInt32(this.txtPagarxProducto.Text);
                    new_proc.Diferenciador = 0;

                    Aux_negProv.Serviceinsertarproducto(new_proc);
                    //MessageBox.Show("V ", "Mensaje Sistema");
                    txtIdProducto.Text     = String.Empty;
                    txtPrecioP.Text        = String.Empty;
                    txtCantidad.Text       = String.Empty;
                    txtPagarxProducto.Text = String.Empty;
                    this.ventaTableAdapter.FillBy(this.panaderiaDataSetVenta.venta);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Datos No Guardados " + ex.Message, "Mensaje Sistema");
            }
        }