public List <ReportStock> ReportStockReturn(int depid, int staffid, int fdepotid, int tdepotid, int status, int valid, string no, string m, string start, string end, int less, int big) { var list = _stockoutRepository.ReportStockReturn(); if (depid != 0) { list = list.Where(p => p.depId == depid); } if (staffid != 0) { list = list.Where(p => p.staffId == staffid); } if (fdepotid != 0) { list = list.Where(p => p.fdepotId == fdepotid); } if (tdepotid != 0) { list = list.Where(p => p.tdepotId == tdepotid); } if (status != -1) { list = list.Where(p => p.status == status); } if (valid == 1) { list = list.Where(p => p.valid == true); } if (valid == 0) { list = list.Where(p => p.valid == false); } if (no != "") { list = list.Where(p => p.returnNo.Contains(no) || p.stockNo.Contains(no)); } if (m != "") { list = list.Where(p => p.materialName.Contains(m) || p.materialModel.Contains(m) || p.materialUnit.Contains(m) || p.materialNo.Contains(m)); } if (less != -404) { list = list.Where(p => p.returnamount >= less); } if (big != -404) { list = list.Where(p => p.returnamount < big); } if (start != "") { var ds = Convert.ToDateTime(start); list = list.Where(x => DateTime.Compare(x.createDate, ds) >= 0); } if (end != "") { var de = Convert.ToDateTime(end); list = list.Where(x => DateTime.Compare(x.createDate, de) < 0); } return(list.ToList()); }