Exemple #1
0
        public async Task <VentaTicketRequest> ObtenerTicket(Guid IdVenta)
        {
            try
            {
                var x = await Repository.GetTicket(IdVenta);

                ListaProducto.Clear();
                //ListaPaquete.Clear();
                ListaServicio.Clear();

                foreach (var item in x.dtoProducto)
                {
                    ListaProducto.Add(item);
                }

                //foreach (var item in x.dtoPaquete)
                //{
                //    ListaPaquete.Add(item);
                //}

                foreach (var item in x.dtoServicio)
                {
                    ListaServicio.Add(item);
                }

                return(x);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        //public async Task GetFoto(int IdServicio)
        //{
        //    try
        //    {
        //        var x = await Repository.ObtenerFoto(IdServicio);
        //        this.FotoBase64 = x;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        public async Task BusquedaServicio()
        {
            try
            {
                var x = await Repository.GetBusqServicioAsync(this.BandNombre, this.Nombre, this.BandClave, this.Clave);

                ListaServicio.Clear();
                foreach (var item in x)
                {
                    ListaServicio.Add(item);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        public async Task GetAllAsync()
        {
            try
            {
                var x = await Repository.GetAllAsync();

                ListaServicio.Clear();
                foreach (var item in x)
                {
                    //item.DuracionStr = item.Duracion.ToLongTimeString();
                    item.AplicaIvaStr  = item.IdTipoIva == 2 ? "SI" : "NO";
                    item.Porcentaje100 = item.Porcentaje == 16 ? item.Porcentaje / 100 : item.Porcentaje;
                    ListaServicio.Add(item);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #4
0
        public async Task GetBusquedaRapida(int TipoBusqueda, string Busqueda, int Idsucursal)
        {
            try
            {
                if (TipoBusqueda == 1)
                {
                    var x = await BusqProductoRepository.GetBusquedaProductoAsync(false, Busqueda, true, Busqueda, Idsucursal);

                    ListaBusquedaProducto.Clear();
                    foreach (var item in x)
                    {
                        ListaBusquedaProducto.Add(item);
                    }
                }
                else if (TipoBusqueda == 2)
                {
                    var x = await ServicioRepository.GetBusqServicioAsync(false, Busqueda, true, Busqueda);

                    ListaServicio.Clear();
                    foreach (var item in x)
                    {
                        ListaServicio.Add(item);
                    }
                }
                else if (TipoBusqueda == 3)
                {
                    var x = await PaqueteRepository.GetBusqPaqueteAsync(false, Busqueda, true, Busqueda);

                    ListaPaquete.Clear();
                    foreach (var item in x)
                    {
                        ListaPaquete.Add(item);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        //public async Task GetFoto(Guid IdCliente)
        //{
        //    try
        //    {
        //        var x = await Repository.ObtenerFoto(IdCliente);
        //        this.FotoBase64 = x;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        public async Task GetAllServicioPaquete(Paquetes paquete)
        {
            try
            {
                var x = await RepositoryPaquete.GetAsync(paquete.IdPaquete);

                ListaServicio.Clear();
                foreach (var item in x.ListaDetallePaquete)
                {
                    if (item.IdTipo == 2)
                    {
                        Servicio servicio = new Servicio();
                        servicio.Nombre     = item.Nombre;
                        servicio.IdServicio = item.IdGenerico;
                        ListaServicio.Add(servicio);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }