コード例 #1
0
        public ConsultaVentaViewModel()
        {
            _common = new Helpers.CommonHelper();
            this.PropertyChanged += ConsultaVentaViewModel_PropertyChanged;
            _proxy   = CommonServiceLocator.ServiceLocator.Current.GetInstance <Common.ServiceContracts.IDataServiceAsync>();
            _reports = new Helpers.ReportsHelper();

            this.SearchCommand = new RelayCommand(() => {
                var settings = CommonServiceLocator.ServiceLocator.Current.GetInstance <Utilities.Models.Settings>();
                var folio    = _common.PrepareVentaDevolucion(this.Search);
                this.Venta   = _proxy.FindVentaView(settings.Sucursal.Clave, folio, this.Cajero.Id);
                if (this.Venta != null)
                {
                    this.Search = null;
                }
            });
            if (this.IsInDesignMode)
            {
                this.Search = "venta";
                this.Venta  = new Common.Entities.VentaView
                {
                    Folio     = "folio",
                    Sucursal  = "sucursal",
                    Productos = new Common.Entities.ProductoView[] {
                        new Common.Entities.ProductoView {
                            Serie = "1", Precio = 100
                        },
                        new Common.Entities.ProductoView {
                            Serie = "2", Precio = 99.9m
                        },
                        new Common.Entities.ProductoView {
                            Serie = "3", Precio = 1999.89m
                        }
                    }
                };
            }
        }