/// <summary> /// GET: /Reporting/Alarms/Export/ /// </summary> /// <param name="id">Id of the operation.</param> /// <returns></returns> public ActionResult Export(int id) { try { using (var service = ServiceFactory.GetCallbackServiceWrapper <IOperationService>(new OperationServiceCallback())) { Operation operation = service.Instance.GetOperationById(id); Stream stream = ExportUtilities.ExportOperation(operation); FileStreamResult result = new FileStreamResult(stream, MediaTypeNames.Text.Xml); result.FileDownloadName = string.Format("{0}.xml", id); return(result); } } catch (EndpointNotFoundException) { // Silently ignore this exception. } catch (Exception ex) { Logger.Instance.LogException(this, ex); } return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError)); }
/// <summary> /// GET: /Reporting/Alarms/Export/ /// </summary> /// <param name="id">Id of the operation.</param> /// <returns></returns> public ActionResult Export(int id) { using (var service = ServiceFactory.GetCallbackServiceWrapper <IOperationService>(new OperationServiceCallback())) { Operation operation = service.Instance.GetOperationById(id); Stream stream = ExportUtilities.ExportOperation(operation); FileStreamResult result = new FileStreamResult(stream, "text/xml"); result.FileDownloadName = string.Format("{0}.xml", id); return(result); } }