public AddProductParametrVM()
        {
            SelectedProduct = new Entity.Product();
            SelectedProduct.ProductType = new ProductType();
            SelectedProductParameter = new ProductParametr();

            surrogateProduct = new Surrogate<Entity.Product>(new ProductServiceProxy());
            Products = surrogateProduct.Deserialize(surrogateProduct.GetAll());

            surrogateProductParameter = new Surrogate<ProductParametr>(new ProductParameterServiceProxy());
            Products = surrogateProduct.Deserialize(surrogateProductParameter.GetAll());

            ProductParametrs = new ObservableCollection<ProductParametr>(Products.Select(a => a.ProductType).ToList().FirstOrDefault().ProductParametrs.ToList());
        }
예제 #2
0
        public AddTypeVM()
        {
            SelectedProduct = new Entity.Product();
            SelectedProduct.ProductType = new ProductType();

            surrogate = new Surrogate<Entity.Product>(new ProductServiceProxy());
            Products = surrogate.Deserialize(surrogate.GetAll());

            surrogateProductType = new Surrogate<ProductType>(new ProductTypeServiceProxy());
        }
        public MainWindowVM()
        {
            _surrogateProduct = new Surrogate<Product>(new ProductServiceProxy());
            Products = _surrogateProduct.Deserialize(_surrogateProduct.GetAll());
            _surrogateBuyer = new Surrogate<Buyer>(new BuyerServiceProxy());
            Buyers = _surrogateBuyer.Deserialize(_surrogateBuyer.GetAll());
            _surrogatePurchase = new Surrogate<Purchase>(new PurchaseServiceProxy());
            _surrogatePurchaseProduct = new Surrogate<PurchaseProduct>(new PurchaseProductServiceProxy());

            originator = new OriginatorSearching();
            history = new ProductsHistory();
            history.History.Push(originator.SaveState(new List<Product>(Products)));

            ProductPurchasesInCheck = new ObservableCollection<PurchaseProduct>();
        }
 public AddValueToParametrVM()
 {
     surrogateProduct = new Surrogate<Entity.Product>(new ProductServiceProxy());
     surrogateProductParametrValue = new Surrogate<Entity.ProductParametrValue>(new ProductParameterValueServiceProxy());
     Products = surrogateProduct.Deserialize(surrogateProduct.GetAll());
 }
예제 #5
0
 public LoginVM()
 {
     _surrogateBuyer = new Surrogate<Entity.Buyer>(new BuyerServiceProxy());
     Buyers = _surrogateBuyer.Deserialize(_surrogateBuyer.GetAll());
 }