Beispiel #1
0
        private async void OnBrowse(object sender, EventArgs e)
        {
            ContentPage browsePage = new BrowsePage(client, client.GetRootNode());

            browsePage.Title = "OPC Browse Service";
            await Navigation.PushAsync(browsePage);
        }
Beispiel #2
0
        public void Setup()
        {
            ChromeOptions options = new ChromeOptions();

            options.AddArguments("start-maximized");
            options.AddArguments("test-type");
            driver      = new ChromeDriver(options);
            mainPage    = new MainPage(driver);
            loginPage   = new LoginPage(driver);
            browsePage  = new BrowsePage(driver);
            accountPage = new AccountPage(driver);

            driver.Navigate().GoToUrl("https://www.n11.com");
        }
        public ActionResult Browse(int?categoryID = null)
        {
            SmartNerdDataContext dc = new SmartNerdDataContext();
            List <Product>       prods;

            //get all products
            if (categoryID == null)
            {
                prods = (from p in dc.Products
                         select new Product {
                    ProductName = p.Name,
                    ProductID = p.ProductID,
                    Price = p.Price,
                    Description = p.Description
                }).ToList();
            }
            else
            {
                prods = (from c in dc.Categories
                         join ce in dc.CategoryEntries on c.CategoryID equals ce.CategoryID
                         join p in dc.Products on ce.ProductID equals p.ProductID
                         where c.CategoryID == categoryID.Value
                         select new Product {
                    ProductName = p.Name,
                    ProductID = p.ProductID,
                    Price = p.Price,
                    Description = p.Description
                }).ToList();
            }
            BrowsePage mp = new BrowsePage {
                Categories = (from c in dc.Categories
                              select new Category {
                    CategoryID = c.CategoryID,
                    CategoryName = c.Name
                }).ToList(),
                Products = prods
            };

            return(View(mp));
        }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BrowsePageViewModel"/> class.
 /// </summary>
 /// <param name="model">The model.</param>
 public BrowsePageViewModel(BrowsePage model)
 {
     this.Model = model;
 }