Exemplo n.º 1
0
        public async virtual Task <ActionResult> BadgeAwards(string userName)
        {
            var badgeAwardsForUser = await BadgeAwardEditCollection.GetAllBadgeAwardsForUser(userName);

            //return RedirectToAction("Index");
            return(PartialView(badgeAwardsForUser));
        }
Exemplo n.º 2
0
        public async virtual Task <ActionResult> Export()
        {
            var contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
            var fileName    = "PointsReportExport.xlsx";

            var pointsReportCollection = await PointsReportCollection.GetAllPayoutsToApproveAsync();

            var badgeAwardCollection = await BadgeAwardEditCollection.GetAllBadgeAwards();

            using (var pointsReportExportModel = new PointsReportExportModel(pointsReportCollection, badgeAwardCollection))
            {
                var fileBytes = pointsReportExportModel.CreateSpreadsheet();
                return(File(fileBytes, contentType, fileName));
            }
        }