コード例 #1
0
        public ActionResult IndexWithInfo(HttpPostedFileBase planData, HttpPostedFileBase template)
        {
            var seatPlanCreatorService = new SeatPlanCreatorService();
            var presentationResult     = seatPlanCreatorService.CreateWithInfo(planData, template);

            presentationResult.FileData = Convert.ToBase64String(presentationResult.Presentation.GetBytes());
            //presentationResult.FileData = presentationResult.Presentation.GetStream()

            presentationResult.Presentation = null;

            return(new JsonResult()
            {
                Data = presentationResult
            });
        }
コード例 #2
0
        public ActionResult Index(HttpPostedFileBase planData, HttpPostedFileBase template)
        {
            // TODO - Validation to check for valid xls/xlsx file

            var seatPlanCreatorService = new SeatPlanCreatorService();
            var presentationResult     = seatPlanCreatorService.Create(planData, template);

            if (!presentationResult.Success)
            {
                // TODO - Return errors information
                return(View());
            }

            presentationResult.Presentation.SaveToHttpResponse(
                presentationResult.FileName,
                FileFormat.Pptx2010,
                System.Web.HttpContext.Current.Response);

            System.Web.HttpContext.Current.Response.End();

            return(View());
        }