public ActionResult ReportSaleReturnSummary(string dateFrom, string dateTo, string customerId) { try { var identity = (LoginIdentity)Thread.CurrentPrincipal.Identity; DateTime?dfrom = null; DateTime?dto = null; if (!string.IsNullOrEmpty(dateFrom)) { dfrom = Convert.ToDateTime(dateFrom); dfrom = new DateTime(dfrom.Value.Year, dfrom.Value.Month, dfrom.Value.Day, 0, 0, 0); } if (!string.IsNullOrEmpty(dateTo)) { dto = Convert.ToDateTime(dateTo); dto = new DateTime(dto.Value.Year, dto.Value.Month, dto.Value.Day, 23, 59, 59); } if (!string.IsNullOrEmpty(dateFrom) && !string.IsNullOrEmpty(dateTo)) { return(View(Mapper.Map <IEnumerable <SaleReturnViewModel> >(_rawSqlService.GetAllSaleReturnSummary(identity.CompanyId, identity.BranchId, dateFrom, dateTo, customerId)))); } return(View()); } catch (Exception ex) { return(JavaScript($"ShowResult('{ex.Message}','failure')")); } }