public ActionResult Search(string name, string comm, string addr) { if (!Authenticate(checkOrgLeadersOnly: true)) return Content("not authorized"); Response.NoCache(); var m = new SearchModel(name, comm, addr); return new SearchResult0(m.PeopleList(), m.Count()); }
public ActionResult SearchResults(string name, string comm, string addr) { if (!Authenticate(checkOrgLeadersOnly: true)) return Content("not authorized"); if (!CMSRoleProvider.provider.IsUserInRole(AccountModel.UserName2, "Access")) return Content("not authorized"); Response.NoCache(); DbUtil.LogActivity($"iphone search '{name}'"); var m = new SearchModel(name, comm, addr); return new SearchResult(m.PeopleList(), m.Count()); }
public ActionResult Search(string name, string comm, string addr) { if (!Authenticate(checkOrgLeadersOnly: true)) { return(Content("not authorized")); } Response.NoCache(); var m = new SearchModel(name, comm, addr); return(new SearchResult0(m.PeopleList(), m.Count())); }
public ActionResult SearchResults(string name, string comm, string addr) { if (!Authenticate(checkOrgLeadersOnly: true)) { return(Content("not authorized")); } if (!CMSRoleProvider.provider.IsUserInRole(AccountModel.UserName2, "Access")) { return(Content("not authorized")); } Response.NoCache(); DbUtil.LogActivity($"iphone search '{name}'"); var m = new SearchModel(name, comm, addr); return(new SearchResult(m.PeopleList(), m.Count())); }
public ActionResult FetchPeople(string data) { // Authenticate first var result = AuthenticateUser(); if (!result.IsValid) return AuthorizationError(result); BaseMessage dataIn = BaseMessage.createFromString(data); MobilePostSearch mps = JsonConvert.DeserializeObject<MobilePostSearch>(dataIn.data); BaseMessage br = new BaseMessage(); var m = new SearchModel(mps.name, mps.comm, mps.addr); br.setNoError(); switch (dataIn.device) { case BaseMessage.API_DEVICE_ANDROID: { Dictionary<int, MobilePerson> mpl = new Dictionary<int, MobilePerson>(); MobilePerson mp; foreach (var item in m.ApplySearch(mps.guest).OrderBy(p => p.Name2).Take(100)) { mp = new MobilePerson().populate(item); mpl.Add(mp.id, mp); } br.data = SerializeJSON(mpl, dataIn.version); break; } case BaseMessage.API_DEVICE_IOS: { List<MobilePerson> mp = new List<MobilePerson>(); foreach (var item in m.ApplySearch(mps.guest).OrderBy(p => p.Name2).Take(100)) { mp.Add(new MobilePerson().populate(item)); } br.data = SerializeJSON(mp, dataIn.version); break; } } br.count = m.Count(mps.guest); return br; }