コード例 #1
0
        private void ShowInReportAction_Execute(object sender, SingleChoiceActionExecuteEventArgs e)
        {
            var reportStorage = ReportStorage.GetInstance(SecuritySystem.CurrentUserName);

            reportStorage.Dokument     = e.SelectedObjects[0] as IDokumentPdf;
            reportStorage.PacjentEmail = "Email";
        }
コード例 #2
0
        public override DocumentOperationResponse PerformOperation(DocumentOperationRequest request, PrintingSystemBase initialPrintingSystem, PrintingSystemBase printingSystemWithEditingFields)
        {
            userName = request.CustomData;

            var reportStorage = ReportStorage.GetInstance(userName);

            objectSpace = reportStorage.Application.CreateObjectSpace();

            var dokumentPdf  = objectSpace.GetObject(reportStorage.Dokument);
            var memoryStream = new MemoryStream();

            printingSystemWithEditingFields.ExportToPdf(memoryStream);
            memoryStream.Seek(0, SeekOrigin.Begin);
            reportStorage.MemoryStream = memoryStream;

            if (memoryStream != null)
            {
                if (memoryStream.Length > 0)
                {
                    if (dokumentPdf.DokumentPdf is null)
                    {
                        dokumentPdf.DokumentPdf = objectSpace.CreateObject <FileData>();
                    }
                    dokumentPdf.DokumentPdf.LoadFromStream($"Dokument.Pdf", memoryStream);

                    //var emailService = new EmailService("email", "password");
                    //emailService.SendEmail(memoryStream, dokumentPdf.PacjentEmail);
                    objectSpace.CommitChanges();
                }
            }

            return(base.PerformOperation(request, initialPrintingSystem, printingSystemWithEditingFields));
        }
コード例 #3
0
        public void CustomizeReportViewerViewItem(ReportWebViewerDetailItem reportWebViewerDetailItem)
        {
            ReportStorage.GetInstance(SecuritySystem.CurrentUserName).Application = Application;
            var item = reportWebViewerDetailItem;

            item.ReportViewer.ClientSideEvents.CustomizeMenuActions = "onCustomizeMenuActions";
            item.ReportViewer.ClientSideEvents.CustomizeMenuActions = @"function(s,e) {
                e.Actions.push({  
                    text: 'Wyślij dokument',  
                    imageClassName: 'custom-image',  
                    disabled: ko.observable(false),  
                    visible: true,
                    hasSeparator: true,
                    clickAction: function() { s.PerformCustomDocumentOperation('" + SecuritySystem.CurrentUserName + "'); }});}";
        }