public object GetCustomersByBirthdayBetween(DateTime from, DateTime to) { _lastQuery = QueryCriteria.Bithday; _paramsObjects.Clear(); _paramsObjects.Add(from); _paramsObjects.Add(to); _paramsObjects.Add("BETWEEN"); CustomRepository <DateTime> repo = new CustomRepository <DateTime>(); return(repo.FindByBetween(QueryCriteria.Bithday, from, to)); }
private Object FillData() { switch (_lastQuery) { case QueryCriteria.LastName: CustomRepository <string> repo = new CustomRepository <string>(); return(repo.FindBy(QueryCriteria.LastName, _paramsObjects[0].ToString())); case QueryCriteria.Address: repo = new CustomRepository <string>(); return(repo.FindBy(QueryCriteria.Address, _paramsObjects.Cast <string>().ToArray())); case QueryCriteria.Bithday: CustomRepository <DateTime> repo2 = new CustomRepository <DateTime>(); if (_paramsObjects.Count == 2) { return(repo2.FindByPredicate(QueryCriteria.Bithday, Convert.ToDateTime(_paramsObjects[0]), _paramsObjects[1].ToString())); } else if (_paramsObjects.Count == 3) { return(repo2.FindByBetween(QueryCriteria.Bithday, Convert.ToDateTime(_paramsObjects[0]), Convert.ToDateTime(_paramsObjects[0]))); } else { return(repo2.FindBy(QueryCriteria.Bithday, _paramsObjects.Cast <DateTime>().ToArray())); } case QueryCriteria.Glossary: return(_glossaryRepository.FindBy(_paramsObjects[0].ToString(), (int)_paramsObjects[1])); case QueryCriteria.GetGlossaries: return(_glossaryRepository.FillAll()); default: { return(FillAllCustomers()); } } }