예제 #1
0
        public ActionResult NeverSoldReportList(GridCommand command, NeverSoldReportModel model)
        {
            DateTime? startDateValue = (model.StartDate == null) ? null
                            : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone);

            DateTime? endDateValue = (model.EndDate == null) ? null
                            : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1);

            var items = _orderReportService.ProductsNeverSold(startDateValue, endDateValue,
                command.Page - 1, command.PageSize, true);
            var gridModel = new GridModel<NeverSoldReportLineModel>
            {
                Data = items.Select(x =>
                {
                    var m = new NeverSoldReportLineModel()
                    {
                        ProductId = x.Id,
                        ProductName = x.Name,
                        ProductTypeName = x.GetProductTypeLabel(_localizationService),
                        ProductTypeLabelHint = x.ProductTypeLabelHint
                    };
                    return m;
                }),
                Total = items.TotalCount
            };
            return new JsonResult
            {
                Data = gridModel
            };
        }
예제 #2
0
 public ActionResult NeverSoldReport()
 {
     var model = new NeverSoldReportModel();
     return View(model);
 }