private void btnCobro_Click(object sender, EventArgs e)
        {
            if (cajaServicio.BuscarCajaAbierta() != null)
            {
                if (nudCobro.Value > 0)
                {
                    if (MessageBox.Show("Esta Por Cobrar Un Adelanto, Desea Continuar?", "Adelanto", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        arregloServicio.Cobrar(_ArregloId, nudCobro.Value);

                        //caja
                        var detalle = new DetalleCajaDto
                        {
                            Descripcion = $"{lblCliente.Text} - Cobro Adelanto",
                            Fecha       = DateTime.Now.ToLongDateString(),
                            Total       = _Debe,
                            CajaId      = detalleCajaServicio.BuscarCajaAbierta()
                        };

                        TipoPago(detalle);

                        detalleCajaServicio.AgregarDetalleCaja(detalle);

                        cajaServicio.SumarDineroACaja(nudCobro.Value);
                        var venta = new VentaDto
                        {
                            ClienteId = _ArregloDto.ClienteId,
                            Descuento = 0,
                            Fecha     = DateTime.Now,
                            Total     = nudCobro.Value
                        };

                        ventaServicio.NuevaVenta(venta);

                        Datos();

                        //limpieza
                        nudCobro.Value = 0;

                        VerificarSiEstaPagado();

                        var mensaje = new Afirmacion("Adelanto Cobrado", "Continue Con Las Ventas");
                        mensaje.ShowDialog();
                    }

                    return;
                }
                else
                {
                    MessageBox.Show("Error El Valor Tiene Que Ser Mayor a 0", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("La Caja Esta Cerrada", "Caja Cerrada", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Exemple #2
0
        private void btnTerminar_Click(object sender, EventArgs e)
        {
            if (cajaServicio.BuscarCajaAbierta() != null)
            {
                if (MessageBox.Show("Esta por Terminar el Pedido, Esta Seguro?", "Preguntar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    var pedido = pedidoServicio.Buscar(PedidoId);

                    pedidoServicio.CambiarProcesoRetirado(pedido.Id);

                    pedidoServicio.CambiarFechaRetirado(pedido.Id);

                    producto_Pedido_Servicio.CambiarEstado(pedido.Id);

                    //Total Cta Cte

                    var cuentaId = new CtaCteDto();

                    if (pedido.ClienteId != 1)
                    {
                        cuentaId = ctaCteServicio.ObtenerPorIdDePedidosId(pedido.Id);

                        ctaCteServicio.Pagar(_Debe, pedido.ClienteId, cuentaId.Id);
                    }

                    //Fin Cta Cte

                    btnTerminar.Visible = false;

                    //caja

                    var detalle = new DetalleCajaDto
                    {
                        Descripcion = $"{lblPersona.Text} - Pedido Terminado",
                        Fecha       = DateTime.Now.ToLongDateString(),
                        Total       = _Debe,
                        CajaId      = detalleCajaServicio.BuscarCajaAbierta()
                    };

                    TipoPago(detalle);

                    detalleCajaServicio.AgregarDetalleCaja(detalle);

                    cajaServicio.SumarDineroACaja(_Debe);

                    pedidoServicio.CambiarRamas(_Debe, PedidoId);

                    var venta = new VentaDto
                    {
                        ClienteId = pedido.ClienteId,
                        Descuento = 0,
                        Fecha     = DateTime.Now,
                        Total     = _Debe
                    };

                    ventaServicio.NuevaVenta(venta);

#pragma warning disable CS0436 // El tipo 'Afirmacion' de 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs' está en conflicto con el tipo importado 'Afirmacion' de 'Presentacion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se usará el tipo definido en 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs'.
                    var completado = new Afirmacion("Felicidades!", $"Completado \nse obtuvo de ganancias $ {_Debe}\nTipo de Pago: {detalle.TipoPago}");
#pragma warning restore CS0436 // El tipo 'Afirmacion' de 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs' está en conflicto con el tipo importado 'Afirmacion' de 'Presentacion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se usará el tipo definido en 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs'.
                    completado.ShowDialog();

                    Datos(PedidoId);

                    lblVendido.Visible                    = true;
                    btnAgregarProductos.Visible           = false;
                    btnVolverPedidoNoRetirado.Visible     = true;
                    btnEliminarPedidoSeleccionado.Visible = false;
                }
            }
            else
            {
                MessageBox.Show("la Caja se encuentra cerrada", "Cerrada", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemple #3
0
        private void btnCargar_Click(object sender, EventArgs e)
        {
            if (AsignarControles())
            {
                if (ckbNormal.Checked == false && ckbCtaCte.Checked == false && ckbTarjeta.Checked == false)
                {
                    MessageBox.Show("Seleccione el Tipo de Pago: Contado, CtaCte, Tarjeta.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    return;
                }

                if (MessageBox.Show("Esta Seguro de Continuar? Puede ser un Cobro para Despues", "Pregunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    var pedido = new PedidoDto
                    {
                        Adelanto        = nudAdelanto.Value,
                        Apellido        = txtApellido.Text,
                        FechaPedido     = DateTime.Now,
                        Nombre          = txtNombre.Text,
                        Proceso         = AccesoDatos.Proceso.InicioPedido,
                        FechaEntrega    = dtpFechaEntrega.Value.Date,
                        Total           = _total,
                        ClienteId       = ClienteId,
                        Descripcion     = txtDescripcion.Text,
                        Horario         = cmbHorario.Text,
                        DiasHastaRetiro = null
                    };

                    var pedidoId = pedidoServicio.NuevoPedido(pedido);

                    ProductoDto producto = new ProductoDto();

                    string segunda = string.Empty;

                    foreach (var item in ListaVentas)
                    {
                        producto = productoServicio.ObtenerPorId(item.Id);

                        segunda += " " + producto.Descripcion + " ";

                        //stock
                        productoServicio.BajarStock(producto.Id, item.Cantidad);
                    }

                    foreach (var item in ListaVentas)
                    {
                        var aux = new Producto_Pedido_Dto
                        {
                            Cantidad    = item.Cantidad,
                            ProductoId  = productoServicio.ObtenerPorId(item.Id).Id,
                            Estado      = AccesoDatos.EstadoPedido.Esperando,
                            Talle       = item.Talle,
                            PedidoId    = pedidoId,
                            Descripcion = segunda,
                            TalleId     = talleServicio.BuscarNombreDevuelveId(item.Talle),
                            Precio      = item.Precio
                        };

                        var _Id_Pedido = producto_Pedido_Servicio.NuevoProductoPedido(aux);

                        //datos
                        if (productoServicio.ObtenerPorId(item.Id).Creacion)
                        {
                            for (int i = 0; i < item.Cantidad; i++)
                            {
                                var dato = new Producto_Dato_Dto
                                {
                                    EstadoPorPedido   = AccesoDatos.EstadoPorPedido.EnEspera,
                                    Producto_PedidoId = _Id_Pedido
                                };

                                producto_Dato_Servicio.Insertar(dato);
                            }
                        }
                    }

                    var cuenta = new CtaCteDto
                    {
                        ClienteId   = ClienteId,
                        Estado      = AccesoDatos.CtaCteEstado.EnEspera,
                        Fecha       = dtpFechaEntrega.Value,
                        Total       = _total,
                        Debe        = _total - nudAdelanto.Value,
                        Descripcion = $"{segunda}",
                        PedidoId    = pedidoId
                    };

                    ctaCteServicio.Agregar(cuenta);


                    var detalle = new DetalleCajaDto
                    {
                        Descripcion = txtApellido.Text + " " + txtNombre.Text + " - " + segunda,
                        Fecha       = DateTime.Now.ToLongDateString(),
                        Total       = nudAdelanto.Value,
                        CajaId      = detallCajaServicio.BuscarCajaAbierta()
                    };

                    TipoPago(detalle);

                    detallCajaServicio.AgregarDetalleCaja(detalle);

                    //dinero a caja
                    cajaServicio.SumarDineroACaja(nudAdelanto.Value); //

#pragma warning disable CS0436                                        // El tipo 'Afirmacion' de 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs' está en conflicto con el tipo importado 'Afirmacion' de 'Presentacion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se usará el tipo definido en 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs'.
                    var mensaje = new Afirmacion("Agregado a la Cuenta!", $"Dinero Cobrado Por Adelanto $ {nudAdelanto.Value}\nTipo de Pago: {detalle.TipoPago}");
#pragma warning restore CS0436                                        // El tipo 'Afirmacion' de 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs' está en conflicto con el tipo importado 'Afirmacion' de 'Presentacion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se usará el tipo definido en 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs'.
                    mensaje.ShowDialog();

                    if (ckbNormal.Checked || ckbTarjeta.Checked)
                    {
                        if (nudAdelanto.Value == _total)
                        {
                            foreach (var item in ListaVentas)
                            {
                                item.Precio = item.Cantidad * item.Precio;
                            }

                            //ticket

                            var fecha = new FechaDto
                            {
                                Fecha = DateTime.Now.ToShortDateString(),
                                Hora  = DateTime.Now.ToShortTimeString()
                            };

                            var factura = new Comprobante(ListaVentas.ToList(), fecha);
                            factura.ShowDialog();
                        }
                    }

                    semaforo = true;

                    this.Close();

                    return;
                }
            }
            else
            {
#pragma warning disable CS0436 // El tipo 'Negativo' de 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Negativo.cs' está en conflicto con el tipo importado 'Negativo' de 'Presentacion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se usará el tipo definido en 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Negativo.cs'.
                var mens = new Negativo("Error", "Apellido y Nombre \nno puede estar vacio");
#pragma warning restore CS0436 // El tipo 'Negativo' de 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Negativo.cs' está en conflicto con el tipo importado 'Negativo' de 'Presentacion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se usará el tipo definido en 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Negativo.cs'.
                mens.ShowDialog();
                //MessageBox.Show("El Campo Apellido y Nombre no puede estar vacio", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (VerificarDatosObligatorios())
            {
                if (nudTotal.Value <= 0)
                {
                    MessageBox.Show("El Total No Puede Ser Cero", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    return;
                }

                if (txtDescripcion.Text == string.Empty)
                {
                    MessageBox.Show("Agregue Una Descripcion Para Poder Continuar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    return;
                }

                if (MessageBox.Show("Esta Seguro de Continuar?", "Pregunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    var arreglo = new ArregloDto
                    {
                        Adelanto      = nudAdelanto.Value,
                        Total         = nudTotal.Value,
                        Apellido      = txtApellido.Text,
                        Nombre        = txtNombre.Text,
                        ClienteId     = _ClienteId,
                        Descripcion   = txtDescripcion.Text,
                        Estado        = AccesoDatos.EstadoArreglo.EnEspera,
                        FechaPedido   = DateTime.Now,
                        Horario       = cmbHorario.Text,
                        FechaRetirado = null,
                        FechaEntrega  = dtpFechaEntrega.Value.Date
                    };

                    arregloServicio.Insertar(arreglo);

                    var detalle = new DetalleCajaDto
                    {
                        Descripcion = "Arreglo de" + " " + txtApellido.Text + " " + txtNombre.Text,
                        Fecha       = DateTime.Now.ToLongDateString(),
                        Total       = nudAdelanto.Value,
                        CajaId      = detallCajaServicio.BuscarCajaAbierta()
                    };

                    TipoPago(detalle);

                    detallCajaServicio.AgregarDetalleCaja(detalle);

                    //dinero a caja
                    cajaServicio.SumarDineroACaja(nudAdelanto.Value);

#pragma warning disable CS0436 // El tipo 'Afirmacion' de 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs' está en conflicto con el tipo importado 'Afirmacion' de 'Presentacion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se usará el tipo definido en 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs'.
                    var mensaje = new Afirmacion("-- Arreglo Creado --", "Se Guardo Su Arreglo");
#pragma warning restore CS0436 // El tipo 'Afirmacion' de 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs' está en conflicto con el tipo importado 'Afirmacion' de 'Presentacion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se usará el tipo definido en 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs'.
                    mensaje.ShowDialog();

                    LimpiarArreglo();
                }
            }
            else
            {
                MessageBox.Show("Verifique Apellido, Titulo, Total: Mayor a 0", "Problemas", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #5
0
        private void btnCobrar_Click(object sender, EventArgs e)
        {
            if (dgvGrilla.RowCount > 0)
            {
                if (ckbTarjeta.Checked == false && ckbPedido.Checked == false && ckbNormal.Checked == false && ckbCtaCte.Checked == false && ckbGuardar.Checked == false)
                {
                    MessageBox.Show("Seleccione el Tipo de Pago, Tarjeta, Contado, Pedido.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    return;
                }

                if (ckbNormal.Checked || ckbTarjeta.Checked)
                {
                    if (MessageBox.Show("Esta Seguro de Continuar?", "Pregunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (ventaDto.ClienteId == 0)
                        {
                            ventaDto.ClienteId = 0;
                        }

                        ventaDto.Fecha = DateTime.Now;
                        ventaDto.Total = _total;


                        var ventaId = ventaServicio.NuevaVenta(ventaDto);

                        string descripcion = string.Empty;

                        foreach (var item in ListaVenta)
                        {
                            var producto = productoServicio.ObtenerPorId(item.Id);

                            var producto_venta = new Producto_Venta_Dto
                            {
                                Cantidad    = item.Cantidad,
                                Descripcion = item.Descripcion,
                                Estado      = AccesoDatos.EstadoPedido.Terminado,
                                ProductoId  = item.Id,
                                Talle       = item.Talle,
                                Precio      = item.Precio * item.Cantidad,
                                VentaId     = ventaId,
                                TalleId     = ((TalleDto)cmbTalle.SelectedItem).Id
                            };

                            // descontar stock
                            productoServicio.BajarStock(producto.Id, item.Cantidad);
                            //

                            descripcion = $"{descripcion} - {producto_venta.Descripcion}";

                            producto_vent.NuevoProductoVenta(producto_venta);
                        }

                        var detalle = new DetalleCajaDto
                        {
                            Fecha       = DateTime.Now.ToLongDateString(),
                            Total       = _total,
                            Descripcion = $"Venta {descripcion}",
                            CajaId      = detalleCajaServicio.BuscarCajaAbierta(),
                        };

                        TipoPago(detalle);

                        detalleCajaServicio.AgregarDetalleCaja(detalle);

                        cajaServicio.SumarDineroACaja(_total);

                        //MessageBox.Show("Felicidades, Cobro Aceptado!", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);

#pragma warning disable CS0436 // El tipo 'Afirmacion' de 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs' está en conflicto con el tipo importado 'Afirmacion' de 'Presentacion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se usará el tipo definido en 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs'.
                        var mensaje = new Afirmacion("Genial", $"Cobro Aceptado!\n\nGanancia: $ {_total}\n{detalle.TipoPago}");
#pragma warning restore CS0436 // El tipo 'Afirmacion' de 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs' está en conflicto con el tipo importado 'Afirmacion' de 'Presentacion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se usará el tipo definido en 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs'.
                        mensaje.ShowDialog();

                        foreach (var item in ListaVenta)
                        {
                            item.Precio = item.Cantidad * item.Precio;
                        }


                        if (ckbTicket.Checked)
                        {
                            VerTicket(ListaVenta.ToList());
                        }

                        //limpiar
                        btnLimpiar.PerformClick();
                    }
                }
                else
                {
                    if (ckbPedido.Checked)
                    {
                        bool Bandera = false;

                        foreach (var item in ListaVenta)
                        {
                            if (productoServicio.ObtenerPorId(item.ProductoId).Creacion)
                            {
                                Bandera = true;
                            }
                        }

                        if (!Bandera)
                        {
                            if (MessageBox.Show("Esta Por Crear Un Pedido Sin Ninguna Prenda Para Fabricar, Desea Continuar?", "Pregunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                            {
                                return;
                            }
                        }

                        var pedidos = new Pedido.Pedido(ListaVenta, _total, ventaServicio.ObtenerClienteName(ventaDto.ClienteId), _clienteId, txtDescripcion.Text);
                        pedidos.ShowDialog();

                        if (pedidos.semaforo)
                        {
                            if (ckbTicket.Checked)
                            {
                                VerTicket(ListaVenta.ToList());
                            }

                            btnLimpiar.PerformClick();
                        }
                    }

                    if (ckbCtaCte.Checked || ckbGuardar.Checked)
                    {
                        foreach (var item in ListaVenta)
                        {
                            var producto = productoServicio.ObtenerPorId(item.Id);

                            var producto_venta = new Producto_Venta_Dto
                            {
                                Cantidad    = item.Cantidad,
                                Descripcion = item.Descripcion,
                                Estado      = AccesoDatos.EstadoPedido.Terminado,
                                ProductoId  = item.Id,
                                Talle       = item.Talle,
                                Precio      = item.Precio * item.Cantidad,
                                VentaId     = 0,
                                TalleId     = ((TalleDto)cmbTalle.SelectedItem).Id
                            };

                            ListaCtaCte.Add(producto_venta);
                        }

                        var cuenta = new CtaCteClientePedido(_clienteId, _total, ListaCtaCte, ListaVenta);
                        cuenta.ShowDialog();

                        if (cuenta.semaforo)
                        {
                            if (ckbTicket.Checked)
                            {
                                VerTicket(ListaVenta.ToList());
                            }

                            btnLimpiar.PerformClick();
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Cargue la Grilla", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            btnSeleccionProducto.Select();
        }
Exemple #6
0
        private void btnCobrar_Click(object sender, EventArgs e)
        {
            if (_CtaCteId != 0)
            {
                if (nudCobro.Value > 0)
                {
                    if (ckbNormal.Checked == false && ckbTarjeta.Checked == false)
                    {
                        MessageBox.Show("Seleccione Tipo de Pago: Contado o Tarjeta", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                        return;
                    }

                    if (MessageBox.Show("Esta Seguro de Cobrar?", "Pregunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        _ctaCteServicio.Pagar(nudCobro.Value, _ClienteId, _CtaCteId);

                        //Inicio Pedido
                        var ctacte = _ctaCteServicio.ObtenerPorId(_CtaCteId);

                        var pedido = pedidoServicio.BuscarIDPedidos(ctacte.PedidoId);

                        pedidoServicio.CambiarRamas(nudCobro.Value, ctacte.PedidoId);

                        if (pedido.Adelanto == pedido.Total)
                        {
                            pedidoServicio.CambiarProcesoTerminado(pedido.Id);
                        }

                        //caja

                        var detalle = new DetalleCajaDto
                        {
                            Fecha       = DateTime.Now.ToLongDateString(),
                            Total       = nudCobro.Value,
                            Descripcion = $"Cobro a {_clienteDto.Apellido} {_clienteDto.Nombre}",
                            CajaId      = detalleCajaServicio.BuscarCajaAbierta()
                        };

                        TipoPago(detalle);

                        detalleCajaServicio.AgregarDetalleCaja(detalle);

                        cajaServicio.SumarDineroACaja(nudCobro.Value);

                        //---//

                        DebeYTotal(_ctaCteServicio.Lista(_ClienteId));

                        //Fin Pedido

#pragma warning disable CS0436 // El tipo 'Afirmacion' de 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs' está en conflicto con el tipo importado 'Afirmacion' de 'Presentacion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se usará el tipo definido en 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs'.
                        var mensaje = new Afirmacion("Cobrado", $"Se Le Cobro $ {nudCobro.Value} Exitosamente!\nTipo de Pago: {detalle.TipoPago}");
#pragma warning restore CS0436 // El tipo 'Afirmacion' de 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs' está en conflicto con el tipo importado 'Afirmacion' de 'Presentacion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se usará el tipo definido en 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs'.
                        mensaje.ShowDialog();

                        Grilla();

                        Datos();

                        nudCobro.Value = 0;

                        //nudCobroMaximo();
                    }
                }
            }
        }
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (txtApellido.Text == string.Empty)
            {
                MessageBox.Show("Coloque El Nombre o el Apellido", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            if (!ckbTarjeta.Checked && !ckbNormal.Checked)
            {
                MessageBox.Show("Seleccione Contado o Tarjeta", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            if (MessageBox.Show("Seguro de Continuar?", "Pregunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                ventaDto.ClienteId = _Cliente.Id;
                ventaDto.Fecha     = DateTime.Now;
                ventaDto.Total     = nudAdelanto.Value;

                var ventaId = ventaServicio.NuevaVenta(ventaDto);

                string descripcion = string.Empty;

                foreach (var item in ListaVenta)
                {
                    var producto = productoServicio.ObtenerPorId(item.ProductoId);

                    item.VentaId = ventaId;

                    descripcion += " " + item.Descripcion + " ";

                    // descontar stock
                    productoServicio.BajarStock(producto.Id, item.Cantidad);

                    producto_vent.NuevoProductoVenta(item);
                }

                AccesoDatos.Proceso _Proceso;

                if (_Cliente.Id == 1)
                {
                    _Proceso = AccesoDatos.Proceso.Guardado;
                }
                else
                {
                    _Proceso = AccesoDatos.Proceso.CtaCte;
                }

                var pedido = new PedidoDto
                {
                    Adelanto     = nudAdelanto.Value,
                    Apellido     = txtApellido.Text,
                    FechaPedido  = DateTime.Now,
                    Nombre       = txtNombre.Text,
                    Proceso      = _Proceso,
                    FechaEntrega = dtpFechaEntrega.Value,
                    Total        = _Total,
                    ClienteId    = _Cliente.Id,
                    Descripcion  = $"Espera de Pago - {txtApellido.Text} {txtNombre.Text}",
                    Horario      = $"Sera Retirado a la {cmbHorario.Text}"
                };

                var pedidoId = pedidoServicio.NuevoPedido(pedido);

                foreach (var item in ListaVentasDto2)
                {
                    var aux = new Producto_Pedido_Dto
                    {
                        Cantidad    = item.Cantidad,
                        ProductoId  = productoServicio.ObtenerPorId(item.Id).Id,
                        Estado      = AccesoDatos.EstadoPedido.Esperando,
                        Talle       = item.Talle,
                        PedidoId    = pedidoId,
                        Descripcion = descripcion,
                        TalleId     = talleServicio.BuscarNombreDevuelveId(item.Talle),
                        Precio      = item.Precio
                    };

                    producto_Pedido_Servicio.NuevoProductoPedido(aux);
                }

                var cuenta = new CtaCteDto
                {
                    ClienteId   = _Cliente.Id,
                    Estado      = AccesoDatos.CtaCteEstado.EnEspera,
                    Fecha       = DateTime.Now,
                    Total       = _Total,
                    Debe        = _Total - nudAdelanto.Value,
                    Descripcion = $"Prenda Guardada",
                    PedidoId    = pedidoId
                };

                ctaCteServicio.Agregar(cuenta);


                var detalle = new DetalleCajaDto
                {
                    Descripcion = txtApellido.Text + " " + txtNombre.Text,
                    Fecha       = DateTime.Now.ToLongDateString(),
                    Total       = nudAdelanto.Value,
                    CajaId      = detallCajaServicio.BuscarCajaAbierta()
                };

                TipoPago(detalle);

                detallCajaServicio.AgregarDetalleCaja(detalle);

                //dinero a caja
                cajaServicio.SumarDineroACaja(nudAdelanto.Value); //

#pragma warning disable CS0436                                    // El tipo 'Afirmacion' de 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs' está en conflicto con el tipo importado 'Afirmacion' de 'Presentacion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se usará el tipo definido en 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs'.
                var NewPrenda = new Afirmacion("Prenda Guardada", $"A Esperar...\nAdelanto de Cobro: $ {nudAdelanto.Value}\n\nTipo de Pago: {detalle.TipoPago}");
#pragma warning restore CS0436                                    // El tipo 'Afirmacion' de 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs' está en conflicto con el tipo importado 'Afirmacion' de 'Presentacion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Se usará el tipo definido en 'C:\Users\Pepe\Source\Repos\JoseSabeckis\KosakoJean\Presentacion.Core\Mensaje\Afirmacion.cs'.
                NewPrenda.ShowDialog();

                semaforo = true;

                this.Close();
            }
        }