Example #1
0
        public void TestSetup()
        {
            expectedItems = new List <PDFField>()
            {
                new PDFField()
                {
                    Name = "VOATestField"
                },

                new PDFField()
                {
                    Name = "VOAMockField"
                },

                new PDFField()
                {
                    Name = "VOASillyField"
                }
            };


            var mockPDFRepository = new Mock <IPDFRepository>();

            mockPDFRepository.Setup(x => x.GetPDFFields(String.Empty, String.Empty)).Returns(expectedItems);

            pdfManager = new PDFManager(mockPDFRepository.Object);
        }
Example #2
0
        public MainWindowViewModel(IPDFManager pdfManager,
                                   IIOManager ioManager,
                                   IFileNameManager fileNameManager,
                                   IDataManager dataManager,
                                   IDataConnector <IVOAType> dataConnector,
                                   ICSVManager csvManager
                                   )
        {
            mainWindow           = dataManager.MainWindow;
            this.pdfManager      = pdfManager;
            this.ioManager       = ioManager;
            this.fileNameManager = fileNameManager;
            this.dataManager     = dataManager;
            this.dataConnector   = dataConnector;
            this.csvManager      = csvManager;

#if DEBUG
            TemplatePath = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName;

            TemplatePath = Path.GetFullPath(Path.Combine(TemplatePath, @"..\"));

            TemplatePath += @"masts_dvr_tool.Tests\StubForms\mockForm.pdf";
#endif

            Prefix            = "VOA";
            EncryptionLabel   = "Encryption?";
            EncryptionEnabled = true;
        }
Example #3
0
        static void Main(string[] args)
        {
            // -- Call initialize --
            Initialize();

            //PDFManager.GetMultipleDataSet();

            string pdfPath = @"C:\Users\Sweet Family\Desktop\PdfFilesPath";

            _pdfManager = new PDFManager(_report,
                                         _pdfRepository,
                                         _consolidateHelper);

            _pdfManager.CreatePDF(pdfPath);

            Console.WriteLine("The End.");
        }
Example #4
0
        public IActionResult GetPdf(string token)
        {
            ITripManager m = ObjectContainer.GetTripManager();

            ClaimsIdentity identity = GetIdentityFromToken(token);

            if (identity == null)
            {
                return(Unauthorized());
            }

            Trip t = m.Get(Convert.ToInt32(identity.Name));

            IPDFManager pm = ObjectContainer.GetPDFManager();

            //Don't let the user export it if Title or anything else is not defined!
            return(File(pm.CreatePdf(t), "application/pdf" /*, t.Title + ".pdf"*/)); //Uncomment this so that the file gets downloaded and not opened
        }
Example #5
0
        public PDFViewModel(INavigationService _navigation, IDatabase _database, IDialogue _dialogue, IToastNotificator toastNotifier, ILogging _logging, IAccountManager _accountManager,
                            IPDFManager _pdfManager) : base(_navigation, _database, _logging, _dialogue)
        {
            //Services
            pdfManager     = _pdfManager;
            _toastNotifier = toastNotifier;

            Title = "My PDFs";

            //Relays
            IGoBack    = new Relays.RelayExtension(GoBack, CanGoBack);
            IOpenFloat = new Relays.RelayExtension(OpenFloat, CanOpenFloat); //Opens up the Password Generator

            //Relays - Refresh Data
            IRefreshData = new Relays.RelayExtension(OnRefresh, CanOnRefresh);

            //Initialization
            Initialize_Core();
        }