예제 #1
0
        public void VerificarSiEstaEliminadoElPedido()
        {
            if (pedidoServicio.BuscarIDPedidos(PedidoId).EstaEliminado)
            {
                btnGuardar.Visible  = false;
                btnEliminar.Visible = false;

                btnEliminarPedidoSeleccionado.Visible = false;
                btnTerminar.Visible = false;

                lblCobrar.Visible = false;
                nudCobro.Visible  = false;
                btnCobro.Visible  = false;
                btnRestar.Visible = false;

                ckbNormal.Visible  = false;
                ckbTarjeta.Visible = false;

                btnAgregarProductos.Visible       = false;
                btnVolverPedidoNoRetirado.Visible = false;

                txtNotas.Enabled     = false;
                lblEliminado.Visible = true;
            }
        }
예제 #2
0
        public AgregarProductos(long pedidoId, bool semaforo)
        {
            InitializeComponent();

            productoServicio         = new ProductoServicio();
            producto_vent            = new Producto_Venta_Servicio();
            ventaServicio            = new VentaServicio();
            detalleCajaServicio      = new DetalleCajaServicio();
            cajaServicio             = new CajaServicio();
            clienteServicio          = new ClienteServicio();
            talleServicio            = new TalleServicio();
            pedidoServicio           = new PedidoServicio();
            producto_Dato_Servicio   = new Producto_Dato_Servicio();
            producto_Pedido_Servicio = new Producto_Pedido_Servicio();
            ctaCteServicio           = new CtaCteServicio();

            producto   = new ProductoDto();
            ListaVenta = new List <VentaDto2>();
            ventaDto   = new VentaDto();

            _Semaforo = semaforo;

            _PedidoId  = pedidoId;
            _Pedido    = pedidoServicio.BuscarIDPedidos(pedidoId);
            _clienteId = _Pedido.ClienteId;
            Bandera    = false;

            CargarTalle();
            CargarDatos();
            CargarGrilla(ListaVenta);

            CargarImageEnGeneral();
        }
예제 #3
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();
                    }
                }
            }
        }