Ejemplo n.º 1
0
        public ActionResult MonthlyTaxes(DataSourceRequest command, ReportsListModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            DateTime? startDateValue = (model.StartDate == null) ? null
                           : (DateTime?)model.StartDate.Value;

            DateTime? endDateValue = (model.EndDate == null) ? null
                            : (DateTime?)model.EndDate.Value.AddDays(1);

            var report = _customService.MonthlyTaxes(createdFromUtc: startDateValue, createdToUtc: endDateValue);

            return Json(report);
        }
Ejemplo n.º 2
0
        public ActionResult MonthlyTaxes()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            var model = new ReportsListModel();
            model.AvailableOrderStatuses = OrderStatus.Pending.ToSelectList(false).ToList();
            model.AvailableOrderStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" });
            model.AvailablePaymentStatuses = PaymentStatus.Pending.ToSelectList(false).ToList();
            model.AvailablePaymentStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" });
            return View(model);
        }
Ejemplo n.º 3
0
        public ActionResult MemberCredit()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            var model = new ReportsListModel();
            //DateTime.Today.Year;
            List<SelectListItem> list = new List<SelectListItem>();
            for (int year = 2013; year <= DateTime.Today.Year; year++)
            {
                var blnSelected = false;
                if (year == DateTime.Today.Year)
                    blnSelected = true;
                list.Add(new SelectListItem() { Selected = blnSelected, Text = year.ToString(), Value = year.ToString() });
            }

            model.AvailableYear = list;
            model.ReportYear = DateTime.Today.Year;
            return View(model);
        }
Ejemplo n.º 4
0
        public ActionResult DepartmentSummaryList(DataSourceRequest command, ReportsListModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            DateTime? startDateValue = (model.StartDate == null) ? null
                           : (DateTime?)model.StartDate.Value;

            DateTime? endDateValue = (model.EndDate == null) ? null
                            : (DateTime?)model.EndDate.Value.AddDays(1);

            OrderStatus? orderStatus = model.OrderStatusId > 0 ? (OrderStatus?)(model.OrderStatusId) : null;
            PaymentStatus? paymentStatus = model.PaymentStatusId > 0 ? (PaymentStatus?)(model.PaymentStatusId) : null;

            var report = _customService.GetDepartmentSummary(createdFromUtc: startDateValue,
                createdToUtc: endDateValue,
                os: orderStatus,
                ps: paymentStatus);

            return Json(report);
            //var affiliates = _affiliateService.GetAllAffiliates(model.StartDate,
            //    model.EndDate, model.OrderStatusId,
            //    model.PaymentStatusId,
            //    command.Page - 1, command.PageSize, true);

            //var gridModel = new DataSourceResult
            //{
            //    Data = report.Select(x =>
            //    {
            //        var m = new AffiliateModel();
            //        PrepareAffiliateModel(m, x, false, false);
            //        return m;
            //    }),
            //    Total = affiliates.TotalCount,
            //};
            //return Json(gridModel);
        }
Ejemplo n.º 5
0
        public ActionResult DepartmentSummary()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            var model = new ReportsListModel();
            model.AvailableOrderStatuses = OrderStatus.Pending.ToSelectList(false).ToList();
            model.AvailableOrderStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" });
            model.AvailablePaymentStatuses = PaymentStatus.Pending.ToSelectList(false).ToList();
            model.AvailablePaymentStatuses.Insert(0, new SelectListItem { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" });

            //if (orderStatusId.HasValue)
            //{
            //    pre-select value?
            //    var item = model.AvailableOrderStatuses.FirstOrDefault(x => x.Value == orderStatusId.Value.ToString());
            //    if (item != null)
            //        item.Selected = true;
            //}
            return View(model);
        }
Ejemplo n.º 6
0
        public ActionResult AnnualSalesReport(DataSourceRequest command, ReportsListModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            int year = model.ReportYear;

            var report = _customService.GetAnnualSalesReport(year);

            return Json(report);
        }