예제 #1
0
        public ActionResult AccountExpenseSummaryReport(ReportViewModel model)
        {
            var operationResult = new OperationResult();

            MemoryStream ms = new MemoryStream();

            try
            {
                if (model.Condition == "International")
                {
                    ms = ReportingManager.CreateAccountExpenseSummaryReportForInternational(model.StartDate, model.EndDate);
                }
                else if (model.Condition == "Domestic")
                {
                    ms = ReportingManager.CreateAccountExpenseSummaryReportForDomestic(model.StartDate, model.EndDate);
                }
            }
            catch (Exception ex)
            {
                operationResult.Message = "Error occured printing Account Expense Summary Report";
                logger.ErrorFormat("Error occured printing Account Expense Summary Report: {0} ", ex.ToString());
                this.AddNotification(operationResult.Message, NotificationType.ERROR);
            }

            return(new FileStreamResult(ms, "application/pdf"));
        }