public ActionResult PackingListReport(Guid packingListId) { var operationResult = new OperationResult(); MemoryStream ms = new MemoryStream(); try { ms = ReportingManager.CreatePackingListReport(packingListId); } catch (Exception ex) { operationResult.Message = "Error occured printing PackingList"; logger.ErrorFormat("Error occured printing PackingList: {0} ", ex.ToString()); this.AddNotification(operationResult.Message, NotificationType.ERROR); } return(new FileStreamResult(ms, "application/pdf")); }
public JsonResult SendPackingListEmail(Guid packingListId, EmailModel model) { var operationResult = new OperationResult(); var _emailManager = new MailManager(); var ms = ReportingManager.CreatePackingListReport(packingListId); var fromUser = UserManager.FindById(User.Identity.GetUserId()); var packingList = _packingListRepository.GetPackingList(packingListId); model.MS = ms; model.FromEmail = fromUser.Email; model.Number = packingList.TrackingNumber; operationResult = _emailManager.SendEmail(model); return(Json(operationResult, JsonRequestBehavior.AllowGet)); }