public ActionResult SaleReport(DateTime?fromDate, DateTime?toDate, int?saleId, int?recieptID) { var ctx = new SmsContext(); fromDate = fromDate == null ? SystemConstant.MIN_DATE : fromDate; toDate = toDate == null ? SystemConstant.MAX_DATE : toDate; var resultList = ctx.SP_GET_HOA_DON(fromDate, toDate, saleId, recieptID).ToList <SP_GET_HOA_DON_Result>(); ViewBag.Count = resultList.Count(); ctx.Dispose(); return(View()); }