Exemple #1
0
        private void InsertarDetalle(Int32 FacturaID)
        {
            //Obtenemos el % de Comision del vendedor
            VendedorBL ObjetoVendedor = new VendedorBL();
            Decimal    Comision       = ObjetoVendedor.BuscarPorID(ObtenerVendedor()).Comision;

            //Obtenemos el detalle de las facturas creadas.

            List <cDetalleFactura> ListaDetalleFactura = new List <cDetalleFactura>();

            foreach (DataGridViewRow row in dgvDetalleFactura.Rows)
            {
                cDetalleFactura Detalle = new cDetalleFactura();
                Detalle.FacturaID      = FacturaID;
                Detalle.TipoDocumento  = "C";
                Detalle.ArticuloID     = Convert.ToInt32(row.Cells[0].Value);
                Detalle.Precio         = Convert.ToDecimal(row.Cells[4].Value);
                Detalle.Cantidad       = Convert.ToDecimal(row.Cells[3].Value);
                Detalle.Costo          = Convert.ToDecimal(row.Cells[10].Value);
                Detalle.ImpuestoValor  = Convert.ToDecimal(row.Cells[5].Value);
                Detalle.DescuentoValor = Convert.ToDecimal(row.Cells[7].Value);
                Detalle.UnidadVentaID  = Convert.ToInt32(row.Cells[11].Value);
                Detalle.TipoProducto   = row.Cells[12].Value.ToString();
                Detalle.ValorComision  = (Convert.ToDecimal(Comision) * (Convert.ToDecimal(row.Cells[4].Value)));
                Detalle.ComisionVenta  = Comision;
                ListaDetalleFactura.Add(Detalle);
            }
            DetalleFacturaBL ObjetoDetalleFactura = new DetalleFacturaBL();

            ObjetoDetalleFactura.Crear(ListaDetalleFactura);
        }
Exemple #2
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            //Eliminar vendedor
            DialogResult Resultado = MessageBox.Show("Se eliminara el vendedor del sistema, ¿Esta seguro que desea continuar?", "Eliminar vendedor", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (Resultado == DialogResult.Yes)
            {
                VendedorBL ObjetoVendedor = new VendedorBL();
                cVendedor  Vendedor       = ObjetoVendedor.BuscarPorID(VendedorID);

                Vendedor.Eliminado = true;

                ObjetoVendedor.GuardarCambios(Vendedor);
            }
        }
Exemple #3
0
 private void frmAgregarEditarVendedor_Load(object sender, EventArgs e)
 {
     if (Codigo.HasValue)
     {
         try
         {
             int ID = Convert.ToInt32(Codigo);
             MostrarDatos(ObjetoVendedor.BuscarPorID(ID));
         }
         catch (Exception Ex)
         {
             throw Ex;
         }
     }
     else
     {
         txtCodigo.Text = "-1";
     }
 }