/// <summary>
 /// Set the lookups efficiently which are in the userLookupModel
 /// </summary>
 private static void SetLookups(UserLookupModel model, IRepository repository)
 {
     model.Applications =
         repository.OfType <Application>().Queryable.OrderBy(x => x.Name).Select(
             x => new KeyValuePair <int, string>(x.Id, x.Name)).ToList();
     model.Units =
         repository.OfType <Unit>().Queryable.OrderBy(x => x.ShortName).Select(
             x => new KeyValuePair <int, string>(x.Id, x.ShortName)).ToList();
 }
Exemplo n.º 2
0
 public ActionResult UserLookup(string idName, string valueName)
 {
     UserLookupModel model = new UserLookupModel
     {
         LookupInputId = idName,
         LookupInputIdValue = valueName
     };
     
     return PartialView("UserLookup", model);
 }
Exemplo n.º 3
0
 public ActionResult UserLookup(UserLookupModel model)
 {
     model.Search();
     return PartialView("UserLookup", model);
 }
Exemplo n.º 4
0
 public void UserLookupModel_Search_InValidExistingUser_NoItemsFound()
 {
     var model = new UserLookupModel { UserFullName = Guid.NewGuid().ToString(), UserFullNameOptions = "%{0}%" };
     model.Search(Repository);
     Assert.IsFalse(model.SearchResults.Any());
 }
Exemplo n.º 5
0
 public void UserLookupModel_Search_ValidExistingUser_ItemsFound()
 {
     var model = new UserLookupModel { UserFullName = "Mehlhorn", UserFullNameOptions = "%{0}%" };
     model.Search(Repository);
     Assert.IsTrue(model.SearchResults.Any());
 }
Exemplo n.º 6
0
 public void UserLookupModel_Search_NoInput_ItemsFound()
 {
     var model = new UserLookupModel();
     model.Search(Repository);
     Assert.IsTrue(model.SearchResults.Any());
 }