Пример #1
0
 public void FetchPeople_ApostropheSearch_Test(string name)
 {
     using (var db = CMSDataContext.Create(DatabaseFixture.Host))
     {
         ContextTestUtils.CreateMockHttpContext();
         var m = new PeopleSearchModel(db);
         var p = MockPeople.CreateSavePerson(db, lastName: name);
         m.m.name = name.Replace("'", string.Empty);
         var people = m.FetchPeople().Any();
         people.ShouldBeTrue();
     }
 }
Пример #2
0
        public ActionResult Search(string name, string comm, string addr)
        {
            if (!Authenticate(checkOrgLeadersOnly: true))
            {
                return(Content("not authorized"));
            }
            Response.NoCache();

            var m = new PeopleSearchModel();

            m.m.name          = name;
            m.m.communication = comm;
            m.m.address       = addr;
            return(new SearchResult0(m.FetchPeople()));
        }
Пример #3
0
        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 PeopleSearchModel();

            m.m.name          = name;
            m.m.communication = comm;
            m.m.address       = addr;
            return(new SearchResult(m.FetchPeople()));
        }