Esempio n. 1
0
        private async void SearchProductGroupAc(SearchPane sender, SearchPaneSuggestionsRequestedEventArgs args)
        {
            if (sender.QueryText.Length >= 2)
            {
                var deferral = args.Request.GetDeferral();

                var productGroupAcs = await ProductGroupManager.SearchAutoCompletePgAsync(sender.QueryText, 10);

                var suggestions = args.Request.SearchSuggestionCollection;

                foreach (var pg in productGroupAcs)
                {
                    var productImagesDirFormat = (string)Application.Current.Resources["ProductImagesDirFormat"];
                    var imageUrl = string.Format(productImagesDirFormat, pg.ImageUrl);                                                  //PL: http://localhost:50308/Content/Images/ProductImages/P-Kemiai-elemek-687268.jpg
                    var image    = RandomAccessStreamReference.CreateFromUri(new Uri(imageUrl));

                    suggestions.AppendResultSuggestion(pg.Title, pg.SubTitle, pg.FriendlyUrl, image, pg.Title);
                }

                if (suggestions.Size == 0)
                {
                    var uriMock = RandomAccessStreamReference.CreateFromUri(new Uri("http://valid-uri"));
                    suggestions.AppendResultSuggestion("Nincs találat", "", " ", uriMock, "");
                }

                deferral.Complete();
            }
        }
        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session.  The state will be null the first time a page is visited.</param>
        private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            var fullDetailedProductGroups = await ProductGroupManager.GetFullDetailedAsync((String)e.NavigationParameter, 1, 100);

            BookRowPlvm          = fullDetailedProductGroups;
            pageRoot.DataContext = BookRowPlvm;
        }
 public QuickBooksProductAgent(TransactionContext context) : base(context)
 {
     pm       = new ProductManager(context);
     um       = new UnitManager(context);
     qmanager = new QuickBooksProductMapManager(context);
     pgm      = new ProductGroupManager(context);
 }
 public ProductGroupPageSampleData()
 {
     Task.Run(
         async() =>
     {
         BookRowPlvm = await ProductGroupManager.GetFullDetailedAsync(ProductGroupFu, 1, 100);
     }).Wait();
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!UsersManager.IsUserAutorized)
     {
         Response.Redirect("~/Login.aspx");
     }
     manager = new ProductGroupManager();
 }
Esempio n. 6
0
        private async void LoadSearchResultsPage(string searchText)
        {
            var data = await ProductGroupManager.SearchWithGroupedByCategoryAsync(searchText, 1, 100);

            CategoryViewModel    = data;
            pageRoot.DataContext = CategoryViewModel;
            pageTitle.Text       = "Keresés: " + searchText;

            IfEmptyOperations();
        }
Esempio n. 7
0
        private async void SearchBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            LabelValuePair[] labelValuePairs = null;

            // Search ProductGroup AutoComplete
            if (SearchBox.Text.Length >= 2)
            {
                labelValuePairs = await ProductGroupManager.SearchAutoCompleteAsync(SearchBox.Text, 10);
            }

            if (labelValuePairs != null && labelValuePairs.Length > 0)
            {
                searchAutoCompleteLb.ItemsSource = labelValuePairs;
                searchAutoCompleteLb.Visibility  = Visibility.Visible;
            }
            else
            {
                searchAutoCompleteLb.ItemsSource = null;
                searchAutoCompleteLb.Visibility  = Visibility.Collapsed;
            }
        }
 public ProductGroup(TransactionContext context) : base("PRODUCT_GROUP", context)
 {
     this.IsProgressing    = false;
     this.MainEntitySample = new MaestroProductGroup();
     pm = new ProductGroupManager(context);
 }
Esempio n. 9
0
 public ProductGroupController(IProductGroupService prodGroupService)
 {
     _prodGroupManager = new ProductGroupManager(prodGroupService);
 }