Ejemplo n.º 1
0
        public ActionResult Search(string query)
        {
            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri("http://127.0.0.1:5000/");

                var responseTask = client.GetAsync("/membersearch/" + query);
                try
                {
                    responseTask.Wait();
                }
                catch (Exception)
                {
                    return(PartialView("_SearchError"));
                }

                var result = responseTask.Result;

                if (result.IsSuccessStatusCode)
                {
                    var readTask = result.Content.ReadAsAsync <ResultMember>();
                    readTask.Wait();

                    rm = readTask.Result;
                    rm.SaveDB();

                    return(PartialView("Results", rm));
                }
            }
            return(PartialView("_SearchError"));
        }
Ejemplo n.º 2
0
        public ActionResult GetMailsForSelectedProfile(string name, string query)
        {
            rm = new ResultMember(query);
            List <string> mails = rm.GenerateMail(name);

            ViewBag.name = name;

            return(PartialView("SelectedProfileMails", mails));
        }
Ejemplo n.º 3
0
        public ActionResult Results()
        {
            ResultMember rm = new ResultMember();

            return(View("Results", rm));
        }