Example #1
0
 private void llenaGrilla()
 {
     {
         var withBlock = dtgProducto;
         withBlock.DataSource = servicioGeneral.getProductos(1, 0, string.Empty, 0);
     }
 }
        private void asignaProductos()
        {
            if (validaCampos())
            {
                prbPorcentajeCalculo.Value   = 0;
                prbPorcentajeCalculo.Minimum = 0;
                string strResultado;

                foreach (var item in chkListaProductos.CheckedItems)
                {
                    this.Refresh();
                    ProductoListaPrecio productoListaPrecio = new ProductoListaPrecio();
                    prbPorcentajeCalculo.Maximum = chkListaProductos.CheckedItems.Count;
                    prbPorcentajeCalculo.Value   = prbPorcentajeCalculo.Value + 1;
                    lblPercent.Text = Convert.ToInt32(prbPorcentajeCalculo.Value * 100 / (double)prbPorcentajeCalculo.Maximum) + "%";
                    var DatosProducto = ServicioGeneral.getProductos(5, 0, string.Empty, Convert.ToInt32(((ProductoCodigoVenta)item).CODIGO_VENTA));

                    productoListaPrecio.APLICA_SUPERA_MONTO_MIN = false;
                    productoListaPrecio.CODIGO_LISTA_PRECIOS    = Convert.ToInt32(cboListaPrecios.SelectedValue);
                    productoListaPrecio.CODIGO_PRODUCTO_LISTA   = 0;
                    productoListaPrecio.COSTO_PRODUCTO          = 0;
                    productoListaPrecio.ESFALTANTE_ANUNCIADO    = false;
                    productoListaPrecio.ES_ACCESORIO            = false;
                    productoListaPrecio.LIMITE_VENTA            = 999;
                    productoListaPrecio.CODIGO_VENTA            = Convert.ToInt32(((ProductoCodigoVenta)item).CODIGO_VENTA);
                    productoListaPrecio.PERMITE_DIGITAR         = false;
                    productoListaPrecio.PRECIO_LISTA            = 1;
                    productoListaPrecio.PUNTOS             = DatosProducto.FirstOrDefault().PUNTOS;
                    productoListaPrecio.SE_APLICA_ESCALA   = false;
                    productoListaPrecio.SUMA_LLEGAR_ESCALA = false;
                    productoListaPrecio.SUMA_NETO          = true;
                    productoListaPrecio.SUMA_VALOR_PUBLICO = false;

                    strResultado = Convert.ToString(ServicePedidos.iuListaPreciosProducto(productoListaPrecio));
                }

                for (int idx = 1; idx <= this.chkListaProductos.Items.Count - 1; idx++)
                {
                    this.chkListaProductos.SetItemCheckState(idx, CheckState.Unchecked);
                }

                MessageBox.Show("Productos asignados a la Lista de precios exitosamente", "AsignaciĆ³n", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                prbPorcentajeCalculo.Value   = 0;
                prbPorcentajeCalculo.Minimum = 0;
                lblPercent.Text = null;
                llenarGrillaProdLista();
                cargaProductos();
            }
        }