示例#1
0
        public ActionResult Search(string searchTerm)
        {
            var searchResults = JustGivingLogic.SearchCharities(searchTerm);

            return(PartialView("_CharityPartials", new CharityListVM {
                Charities = searchResults, ShowSelector = true, ShowJustGivingLink = false, ShowSocial = false
            }));
        }
示例#2
0
        public ActionResult MakePayment(string ContribID)
        {
            var ContribIDInt = GenericLogic.GetInt(ContribID);

            if (ContribIDInt.HasValue)
            {
                var contrib = db.PledgeContributors.FirstOrDefault(pc => pc.ID == ContribIDInt);
                var URL     = JustGivingLogic.GetPaymentURL(contrib, Url, Request);
                return(Redirect(URL));
            }

            return(null);
        }
示例#3
0
        public ActionResult userSearchPrompt(string SearchString)
        {
            SearchString = SearchString.ToLower();
            var ImageURL      = Url.Action("GetImage", "Image");
            var ActivitiesURL = Url.Content("~/Images/Activities/");

            var result = new
            {
                teams      = from t in db.Teams where t.Name.ToLower().Contains(SearchString) select new { t.Name, Url = ImageURL + "?ImageID=" + t.ImageID + "&Thumb=true" },
                activities = from act in Enum.GetNames(typeof(PledgeActivity.ActivityTypes)) where act.ToLower().Contains(SearchString) select new { Name = act.Replace("_", " "), Url = ActivitiesURL + act + ".png" },
                charities  = from c in JustGivingLogic.SearchCharities(SearchString) select new { c.Name, Url = c.JustGivingCharityImageURL }
            };


            Response.StatusCode = (int)HttpStatusCode.OK;
            return(Json(result, JsonRequestBehavior.AllowGet));
        }