public List <CreditBill> GetCreditSalesDetailsForSelectedDate(DateTime fromDate, DateTime toDate) { List <CreditBill> allSalesDetails = accessDB.GetAllCreditSalesDetails(); if (allSalesDetails != null && allSalesDetails.Count > 0) { List <CreditBill> selectedDateSalesDetails = allSalesDetails.Where(obj => obj.SoldDate.Date >= fromDate.Date && obj.SoldDate.Date <= toDate.Date).OrderByDescending(obj => obj.SoldDate).ThenBy(obj => obj.BillNos).ToList(); return(selectedDateSalesDetails); } return(new List <CreditBill>()); }