public ActionResult Index(string productName)
        {
            RavenDemoModel model = null;

            try
            {
                model           = new RavenDemoModel();
                ViewBag.Message = "Let's Get  Social.";

                if (!string.IsNullOrEmpty(productName))
                {
                    var product = new Product {
                        Id = productName, ProductName = productName
                    };
                    _products.CreateProduct(product);
                }

                model.Products = _products.GetProducts();
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }

            return(View(model));
        }
Beispiel #2
0
 public MainViewModel()
 {
     Products = new ObservableCollection <Product>();
     Pouch    = new ObservableCollection <Moneyy>();
     ToReturn = new ObservableCollection <Moneyy>();
     moneyHandler.FillMoneyPouch(Pouch, true);
     productHandler.GetProducts(Products);
 }
        public List <Product> GetProduct(string productName)
        {
            if (string.IsNullOrEmpty(productName))
            {
                throw  new ArgumentException();
            }

            return(_handler.GetProducts(productName));
        }
 public List <Product> GetProducts()
 {
     return(_handler.GetProducts());
 }