예제 #1
0
 public PhoneBookRecordListModel InitializePhoneBookRecordListModel(PhoneBookRecordQueryItem queryItem)
 {
     if (queryItem.UnitId == null)
         throw new ArgumentException("queryItem.UnitId不能为null");
     var model = new PhoneBookRecordListModel();
     _phoneBookRepository.GetAll(queryItem.UnitId.Value).ToList().ForEach(o => model.PhoneBookRecordSearchModel.PhoneBookOptions.Add(o.Id.ToString(), o.Name));
     model.PhoneBookRecords = _phoneBookRecordRepository.Query(queryItem);
     model.PhoneBookRecordSearchModel.PhoneBookRecordQueryItem = queryItem;
     return model;
 }
예제 #2
0
 public SelectedRecordsResponse InitializeSelectedRecordsResponse(SelectePhoneBookRecordModel selectedUsersModel)
 {
     var model = new SelectedRecordsResponse();
     var queryItem = new PhoneBookRecordQueryItem();
     queryItem.Pagination.PageSize = 1000;
     if (selectedUsersModel.CheckedAllPage)
     {
         queryItem.PhoneBookId = selectedUsersModel.WhereOptions.PhoneBookId;
         queryItem.Name = selectedUsersModel.WhereOptions.Name;
         queryItem.Mobile = selectedUsersModel.WhereOptions.Mobile;
     }
     else
     {
         if (!selectedUsersModel.Ids.Any())
             return model;
         queryItem.Ids = selectedUsersModel.Ids;
     }
     queryItem.UnitId = selectedUsersModel.UnitId;
     _phoneBookRecordRepository.Query(queryItem).ToList().ForEach(phoneBookRecord =>
         model.Telnumbers.Add(phoneBookRecord.Mobile));
     return model;
 }
예제 #3
0
 public PhoneBookRecordSearchModel()
 {
     PhoneBookRecordQueryItem = new PhoneBookRecordQueryItem();
     PhoneBookOptions=new Dictionary<string, string>();
 }