public Result <List <Deal> > ListDeal(SearchUnit model) { if (model.unit_id <= 0) { return(Result <List <Deal> >(ApiResultEnum.Parameter_Error, null)); } IEnumerable <Deal> lst = new List <Deal>(); if (model.from_dt.Date < DateTime.Now.Date) { lst = lst.Union(DealDA.List(model)); } if (model.from_dt.Date <= DateTime.Now.Date && model.to_dt.Date >= DateTime.Now.Date) { lst = lst.Union(DealRA.List4Unit(model.unit_id)); } return(Result(lst.OrderBy(o => o.time_dt).ToList())); }
public Result <List <Deal> > ListDeal(SearchDealStatus model) { IEnumerable <Deal> lst = new List <Deal>(); if (model.from_dt.Date < DateTime.Now.Date) { lst = lst.Union(DealDA.List(model)); } if (model.from_dt.Date <= DateTime.Now.Date && model.to_dt.Date >= DateTime.Now.Date) { if (model.status == DealStatusEnum.In) { lst = lst.Union(DealRA.List().Where(d => d.unit_id > 0)); } else if (model.status == DealStatusEnum.Out) { lst = lst.Union(DealRA.List().Where(d => d.unit_id == 0)); } } return(Result(lst.OrderBy(o => o.time_dt).ToList())); }