public void Can_SearchByDate() { var employee = new Employee { Active = true, Id = Guid.NewGuid(), Name = "Employee #1", Salary = 50000 }; var costData = new Models.Data.EmployeeCost { Id = Guid.NewGuid(), Date = DateTime.Today, Total = 1000 }; using (var conn = factory.OpenDbConnection()) { conn.InsertParam(employee); conn.InsertParam(costData); } var result = service.Search(new DateRangeSearchInfo { Start = DateTime.Today.AddDays(-1), End = DateTime.Today.AddDays(10), PageIndex = 1, PageSize = 10 }); Assert.Equal(1, result.Total); Compare(costData, null, result.Items[0]); }
public SearchResult <EmployeeCost> GetByCriteria(int page, int limit, DateTime?start = null, DateTime?end = null) { var searchInfo = new DateRangeSearchInfo { Start = start, End = end, PageIndex = page, PageSize = limit }; return(service.Search(searchInfo)); }
void OnRefresh(object param) { var searchInfo = new DateRangeSearchInfo { Start = startDate, End = endDate, PageIndex = pageIndex, PageSize = pageSize }; var result = costService.Search(searchInfo); CostList = new ObservableCollection <Models.EmployeeCost>(result.Items); TotalRecords = result.Total; DeleteCommand.EntityId = Guid.Empty; }