コード例 #1
0
        public Comprobante(List <VentaDto2> detalleCajaDtos, FechaDto fecha)
        {
            InitializeComponent();

            detalleCajaServicio = new DetalleCajaServicio();
            fechaDto            = new List <FechaDto>();

            ListaDetalle = detalleCajaDtos;

            fechaDto.Add(fecha);
        }
コード例 #2
0
        public void Modificar(FechaDto dto)
        {
            var fecha = _fechaRepositorio.GetById(dto.Id);

            fecha.HoraInicio  = dto.HoraInicio;
            fecha.HoraCierre  = dto.HoraCierre;
            fecha.FechaEvento = dto.FechaEvento;

            _fechaRepositorio.Update(fecha);

            Guardar();
        }
コード例 #3
0
        public FechaDto Modificar(FechaDto dto)
        {
            var entity = _fechaRepositorio.ObtenerPorId(dto.Id);

            entity.FechaTurno = dto.FechaTurno;
            entity.LugarId    = dto.LugarId;

            _fechaRepositorio.Modificar(entity);
            Guardar();

            return(dto);
        }
コード例 #4
0
        public FechaDto ObtenerPorId(long id)
        {
            var fecha = _fechaRepositorio.GetById(id);

            var aux = new FechaDto
            {
                FechaEvento = fecha.FechaEvento,
                HoraCierre  = fecha.HoraCierre,
                HoraInicio  = fecha.HoraInicio,
                Id          = fecha.Id
            };

            return(aux);
        }
コード例 #5
0
        public void VerTicket(List <VentaDto2> Lista)
        {
            //ticket

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

            var factura = new Comprobante(ListaVenta.ToList(), fecha);

            factura.ShowDialog();
        }
コード例 #6
0
        public ListaPedidos(List <Producto_Dato_Dto> listaDato)
        {
            InitializeComponent();

            ListaDato = listaDato;
            Fecha     = new List <FechaDto>();

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

            Fecha.Add(fecha);
        }
コード例 #7
0
        public FechaDto Insertar(FechaDto dto)
        {
            var Fecha = new Dominio.Entity.Entidades.Fecha()
            {
                FechaEvento = dto.FechaEvento,
                HoraCierre  = dto.HoraCierre,
                HoraInicio  = dto.HoraInicio
            };

            _fechaRepositorio.Add(Fecha);
            Guardar();

            dto.Id = Fecha.Id;
            return(dto);
        }
コード例 #8
0
        public FechaDto Agregar(FechaDto dto)
        {
            var entity = new Dominio.Entidades.Entidades.Fecha()
            {
                FechaTurno = dto.FechaTurno,
                LugarId    = dto.LugarId,
                Eliminado  = false
            };

            _fechaRepositorio.Agregar(entity);
            Guardar();
            dto.Id = entity.Id;

            return(dto);
        }
コード例 #9
0
        public ActionResult <IEnumerable <ReservaViewModel> > Get([FromBody] FechaDto fechaBuscar, int numPag = 1, int cantRegist = 5)
        {
            var query       = context.Reservas.AsQueryable();
            var totalRegist = query.Count();

            var reservas = query
                           .Skip(cantRegist * (numPag - 1))
                           .Take(cantRegist)
                           .Include(x => x.Pista).Include(x => x.Socio)
                           .Where(x => x.Fecha.Equals(fechaBuscar.Fecha)).ToList();

            if (!reservas.Any())
            {
                return(NotFound(new Result(404, false, "No hay reservas para la fecha solicitada").GetResultJson()));
            }

            Response.Headers["X-Total-Registros"]  = totalRegist.ToString();
            Response.Headers["X-Cantidad-Paginas"] =
                ((int)Math.Ceiling((double)totalRegist / cantRegist)).ToString();

            var reservaViewModel = mapper.Map <List <ReservaViewModel> >(reservas);

            return(reservaViewModel);
        }
コード例 #10
0
ファイル: Pedido.cs プロジェクト: JoseSabeckis/KosakoJean
        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);
            }
        }
コード例 #11
0
        public ActionResult Fecha(FechaDto fechaEventoDto)
        {
            _fechaServicio.Modificar(fechaEventoDto);

            return(RedirectToAction("Perfil", "Persona"));
        }
コード例 #12
0
        public ActionResult Crear(EventoViewDto eventoViewDto, HttpPostedFileBase img)
        {
            if (img != null)
            {
                using (var reader = new BinaryReader(img.InputStream))
                {
                    eventoViewDto.Imagen = reader.ReadBytes(img.ContentLength);
                }
            }
            else
            {
                ViewBag.ErrorEvento = "Ingrese una Imagen para su evento.";
                return(View());
            }


            ViewBag.ListaTipoEvento = _tipoEventoServicio.Get().ToList();

            if (ModelState.IsValid)
            {
                try
                {
                    if (!_eventoServicio.ValidarTitulo(eventoViewDto.Titulo))
                    {
                        if (!_eventoServicio.ValidarFecha(eventoViewDto.FechaEvento))
                        {
                            var evento = new EventoDto
                            {
                                Id           = eventoViewDto.Id,
                                Titulo       = eventoViewDto.Titulo,
                                Descripcion  = eventoViewDto.Descripcion,
                                Mail         = eventoViewDto.Mail,
                                Latitud      = eventoViewDto.Latitud,
                                Longitud     = eventoViewDto.Longitud,
                                TipoEventoId = eventoViewDto.TipoEventoId,
                                Orante       = eventoViewDto.Orante,
                                Organizacion = eventoViewDto.Organizacion,
                                Domicilio    = eventoViewDto.DomicilioCompleto,
                                Telefono     = eventoViewDto.Telefono,
                                Imagen       = eventoViewDto.Imagen
                            };

                            var EventoObj = _eventoServicio.Insertar(evento);

                            //*************************************************************//

                            var fecha = new FechaDto
                            {
                                FechaEvento = eventoViewDto.FechaEvento,
                                HoraInicio  = eventoViewDto.HoraInicio,
                                HoraCierre  = eventoViewDto.HoraFin
                            };

                            var FechaObj = _fechaServicio.Insertar(fecha);

                            //*************************************************************//

                            var fechaEvento = new FechaEventoDto
                            {
                                EventosId = EventoObj.Id,
                                FechaId   = FechaObj.Id
                            };

                            _fechaEventoServicio.Insertar(fechaEvento);

                            //*************************************************************//

                            var entrada = new EntradaDto
                            {
                                Monto      = eventoViewDto.Precio,
                                FechaDesde = DateTime.Now,
                                FechaHasta = DateTime.Now,
                                EventoId   = EventoObj.Id,
                                Cantidad   = 1
                            };

                            _entradaServicio.Insertar(entrada);

                            //*************************************************************//

                            var CreadorEvento = new CreadorEventoDto()
                            {
                                EventoId  = EventoObj.Id,
                                UsuarioId = SessionActiva.UsuarioId,
                                Fecha     = DateTime.Now
                            };

                            _creadorEventoServicio.Insertar(CreadorEvento);

                            //*************************************************************//

                            return(RedirectToAction("ViewEvento", new { id = EventoObj.Id }));
                        }
                        else
                        {
                            ViewBag.ErrorEvento = "Ingresa una fecha valida , anticipacion de 1 dia";
                            return(View());
                        }
                    }
                    else
                    {
                        ViewBag.ErrorEvento = "El Titulo del evento ya esta siendo utilizada.";
                        return(View());
                    }
                }
                catch (Exception e)
                {
                    ViewBag.ErrorEvento = "Ocurrio un error inesperado en el sistema";
                    return(View());
                }
            }
            else
            {
                return(View());
            }
        }