Пример #1
0
    public string CitySuggest(string tryValue, string[] additionalParams)
    {
        List <SuggestionItem> items   = new List <SuggestionItem>();
        List <string>         surname = new List <string>();
        FAbonent        fa            = new FAbonent();
        FAbonentDO      fado          = new FAbonentDO();
        UniversalEntity ue            = new UniversalEntity();

        ue = fado.RetrieveLikeSurname(tryValue);
        if (ue.Count > 0)
        {
            for (int i = 0; i < ue.Count; i++)
            {
                fa = (FAbonent)ue[i];
                //create SuggestionItem
                SuggestionItem suggestionItem = new SuggestionItem();
                suggestionItem.Title       = fa.Surname;
                suggestionItem.Description = SuggestionTools.HighLight(fa.FirstName + " " + fa.LastName, tryValue) + fa.ID.ToString();
                suggestionItem.Id          = fa.ID.ToString();
                //add item to the list
                items.Add(suggestionItem);
            }
        }
        //create result Item
        SuggestionResult suggestionResult = new SuggestionResult();

        suggestionResult.Items  = items.ToArray();
        suggestionResult.Header = new BasicSuggestionTemplate("Please select your city.");
        suggestionResult.Footer = new BasicSuggestionTemplate("Powered by ConvincingMail");
        return(suggestionResult.ToJSON(tryValue));
    }
Пример #2
0
        IObservable <BitmapSource> ResolveImage(SuggestionItem uri)
        {
            if (uri.ImageUrl != null)
            {
                return(avatarProvider.GetAvatar(uri.ImageUrl));
            }

            return(Observable.Return(AvatarProvider.CreateBitmapImage(DefaultAvatar)));
        }
Пример #3
0
        public ActionResult Detail(string type)
        {
            PersonalizedCardProvider provider = new PersonalizedCardProvider();
            SuggestionItem           model    = provider.GetByType(type);

            model.Foods.ForEach((food) =>
            {
                food.Description = "Bacon ipsum dolor amet venison ground round jerky prosciutto short ribs. Chuck short ribs ground round porchetta, landjaeger turkey pastrami sirloin jerky. Brisket boudin short ribs swine leberkas beef ribs alcatra ham capicola pork loin turducken rump. ";
            });
            return(View(model));
        }
        public SuggestionItem GetBannedList()
        {
            SuggestionItem item   = new SuggestionItem();
            List <Food>    banned = new List <Food>();

            item.Title = "Banned";


            banned.Add(new Food()
            {
                FoodName    = "Pasta",
                Explanation = GetReason()
            });
            banned.Add(new Food()
            {
                FoodName    = "White Bread",
                Explanation = GetReason()
            });
            banned.Add(new Food()
            {
                FoodName    = "French Fries",
                Explanation = GetReason()
            });
            banned.Add(new Food()
            {
                FoodName    = "Candy",
                Explanation = GetReason()
            }); banned.Add(new Food()
            {
                FoodName    = "Ice Cream",
                Explanation = GetReason()
            }); banned.Add(new Food()
            {
                FoodName    = "Chips",
                Explanation = GetReason()
            });

            item.Foods = banned;
            return(item);
        }
        public SuggestionItem GetFullSnacks()
        {
            SuggestionItem item = new SuggestionItem();

            item.Title = "Snacks";
            List <Food> lowBudget = new List <Food>();

            lowBudget.Add(new Food()
            {
                FoodName    = "Apples",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Oranges",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Pears",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Salad",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Carrots",
                Explanation = GetReason()
            });

            item.Foods = lowBudget;

            return(item);
        }
Пример #6
0
 public IndexItem()
 {
     Suggest = new SuggestionItem();
 }
 /// <summary>
 /// Initializes a new instance of the SuggestionItemAutomationPeer class.
 /// </summary>
 /// <param name="owner">The SuggestionItem that is associated with this SuggestionItemAutomationPeer.</param>
 /// <param name="parent">The SuggestionItemsControl that is parent of SuggestionItem.</param>
 public SuggestionItemAutomationPeer(SuggestionItem owner, SuggestionItemsControl parent)
     : this(owner)
 {
     this.suggestionItemsControl = parent;
 }
 /// <summary>
 /// Initializes a new instance of the SuggestionItemAutomationPeer class.
 /// </summary>
 /// <param name="owner">The SuggestionItem that is associated with this SuggestionItemAutomationPeer.</param>
 public SuggestionItemAutomationPeer(SuggestionItem owner)
     : base(owner)
 {
 }
Пример #9
0
 public IssueAutoCompleteSuggestion(SuggestionItem suggestion, string prefix)
     : base(suggestion.Name, suggestion.Description, prefix)
 {
     this.suggestion = suggestion;
 }
        public SuggestionItem GetDinner(string budget, string affliction)
        {
            SuggestionItem item = new SuggestionItem();

            item.Title = "Dinner";
            List <Food> lowBudget = new List <Food>();

            lowBudget.Add(new Food()
            {
                FoodName    = "Kjúklingur",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Lasagna",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Núðlur",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Pasta",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Lobster Rolls",
                Explanation = GetReason()
            });
            List <Food> highBudget = new List <Food>();

            highBudget.Add(new Food()
            {
                FoodName    = "Kavíar",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "White Truffles",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "Oyster",
                Explanation = GetReason()
            });

            highBudget.Add(new Food()
            {
                FoodName    = "Mozzarella sticks",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "Tuna Casserol",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "MATCHA GREEN TEA",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "MOOSE MILK CHEESE",
                Explanation = GetReason()
            });

            if (budget == "low")
            {
                item.Foods = lowBudget;
            }

            else
            {
                item.Foods = highBudget;
            }
            Random r = new Random();

            item.Foods = item.Foods.OrderBy(x => r.Next()).Take(3).ToList();
            return(item);
        }
        public SuggestionItem GetSupper(string budget, string affliction)
        {
            SuggestionItem item = new SuggestionItem();

            item.Title = "Supper";
            List <Food> lowBudget = new List <Food>();

            lowBudget.Add(new Food()
            {
                FoodName    = "Samloka",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Hlölla bátur",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Núðlur",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Hamborgari",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Buffalo",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Chilli Dog",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Jelly-O",
                Explanation = GetReason()
            });


            List <Food> highBudget = new List <Food>();


            highBudget.Add(new Food()
            {
                FoodName    = "Kavíar",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "White Truffles",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "Vanilla",
                Explanation = GetReason()
            });

            highBudget.Add(new Food()
            {
                FoodName    = "DENSUKE WATERMELON",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "SAFFRON",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "MATCHA GREEN TEA",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "MOOSE MILK CHEESE",
                Explanation = GetReason()
            });


            if (budget == "low")
            {
                item.Foods = lowBudget;
            }

            else
            {
                item.Foods = highBudget;
            }
            Random r = new Random();

            item.Foods = item.Foods.OrderBy(x => r.Next()).Take(3).ToList();
            return(item);
        }
        public SuggestionItem GetFullDinner()
        {
            SuggestionItem item = new SuggestionItem();

            item.Title = "Dinner";
            List <Food> lowBudget = new List <Food>();

            lowBudget.Add(new Food()
            {
                FoodName    = "Chicken",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Beef",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Sweet Potato",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Mushroom",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Onion",
                Explanation = GetReason()
            });


            lowBudget.Add(new Food()
            {
                FoodName    = "Cod",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Tuna",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Salad",
                Explanation = GetReason()
            });

            lowBudget.Add(new Food()
            {
                FoodName    = "Whole wheat pasta",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Brown Rice",
                Explanation = GetReason()
            });
            item.Foods = lowBudget;

            return(item);
        }
        public SuggestionItem GetFullSupper()
        {
            SuggestionItem item = new SuggestionItem();

            item.Title = "Supper";
            List <Food> lowBudget = new List <Food>();

            lowBudget.Add(new Food()
            {
                FoodName    = "Eggs",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Chicken",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Cod",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Tuna",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Apples",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Oranges",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Mushrooms",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Ab-milk",
                Explanation = GetReason()
            });

            lowBudget.Add(new Food()
            {
                FoodName    = "Brown Pasta",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Cheese",
                Explanation = GetReason()
            });
            item.Foods = lowBudget;

            return(item);
        }
        public SuggestionItem GetFullBreakfast()
        {
            SuggestionItem item = new SuggestionItem();

            item.Title = "Breakfast";
            List <Food> lowBudget = new List <Food>();

            lowBudget.Add(new Food()
            {
                FoodName    = "Oats",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "AB - Milk",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Skyr.is",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Eggs",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Sesame Seeds",
                Explanation = GetReason()
            });


            lowBudget.Add(new Food()
            {
                FoodName    = "Strawberries",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Apples",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Crispbread",
                Explanation = GetReason()
            });

            lowBudget.Add(new Food()
            {
                FoodName    = "Tuna",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Cod",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Milk",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Cheese",
                Explanation = GetReason()
            });
            item.Foods = lowBudget;

            return(item);
        }
        public SuggestionItem GetBreatkfast(string budget, string affliction)
        {
            SuggestionItem item = new SuggestionItem();

            item.Title = "Breakfast";
            List <Food> lowBudget = new List <Food>();

            lowBudget.Add(new Food()
            {
                FoodName    = "Epli",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Banani",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Hafragrautur",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Bacon",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Bagel",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Bialy",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Baked Beans",
                Explanation = GetReason()
            });
            lowBudget.Add(new Food()
            {
                FoodName    = "Ham",
                Explanation = GetReason()
            });

            List <Food> highBudget = new List <Food>();


            highBudget.Add(new Food()
            {
                FoodName    = "Kavíar",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "White Truffles",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "Vanilla",
                Explanation = GetReason()
            });

            highBudget.Add(new Food()
            {
                FoodName    = "DENSUKE WATERMELON",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "SAFFRON",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "MATCHA GREEN TEA",
                Explanation = GetReason()
            });
            highBudget.Add(new Food()
            {
                FoodName    = "MOOSE MILK CHEESE",
                Explanation = GetReason()
            });

            if (budget == "low")
            {
                item.Foods = lowBudget;
            }

            else
            {
                item.Foods = highBudget;
            }
            Random r = new Random();

            item.Foods = item.Foods.OrderBy(x => r.Next()).Take(3).ToList();
            return(item);
        }