示例#1
0
        void AddTocTemplate()
        {
            var tocReportSource = new TypeReportSource();

            tocReportSource.TypeName = typeof(ReportBookToc).AssemblyQualifiedName;
            this.TocReportSource     = tocReportSource;
        }
示例#2
0
        private void OnPrintExpense()
        {
            if (TravelExpense.Id == 0)
            {
                NotificationRequest.Raise(new Notification()
                {
                    Title   = "QuantCo Deutschland GmbH",
                    Content = "Die Reisekosten müssen vor dem Druck erst gespeichert werden"
                });
                return;
            }

            NotificationRequest.Raise(new Notification()
            {
                Title   = "QuantCo Deutschland GmbH",
                Content = "Nicht gespeicherte Änderungen werden nicht ausgedruckt"
            });

            List <int> idList = new List <int>();

            idList.Add(TravelExpense.Id);

            TypeReportSource source = new TypeReportSource();

            source.TypeName = typeof(AccountingHelper.Reporting.TravelExpenses).AssemblyQualifiedName;
            source.Parameters.Add("TravelExpenseIds", idList);
            ViewerParameter parameter = new ViewerParameter()
            {
                typeReportSource = source
            };

            eventAggregator.GetEvent <ViewerParameterEvent>().Publish(parameter);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         TypeReportSource reportSource = new TypeReportSource();
         reportSource.TypeName           = typeof(ReportCatalog).AssemblyQualifiedName;
         this.ReportViewer1.ReportSource = reportSource;
     }
 }
示例#4
0
        private void OnContractBonus()
        {
            TypeReportSource source = new TypeReportSource();

            source.TypeName = typeof(AccountingHelper.Reporting.BonusYear).AssemblyQualifiedName;
            ViewerParameter parameter = new ViewerParameter()
            {
                typeReportSource = source
            };

            eventAggregator.GetEvent <ViewerParameterEvent>().Publish(parameter);
        }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
            System.Collections.Hashtable deviceInfo   = new System.Collections.Hashtable();
            TypeReportSource             reportSource = new TypeReportSource();

            reportSource.TypeName = typeof(PatientRegistrationForm).AssemblyQualifiedName;
            ReportSource myrep = reportSource;

            myrep.Parameters.Add(new Telerik.Reporting.Parameter("patientpk", Session["PatientId"].ToString()));

            reportViewer1.ReportSource          = reportSource;
            reportViewer1.ParametersAreaVisible = false;
            this.reportViewer1.RefreshReport();
        }
        private void OnSalaryOverview()
        {
            TypeReportSource source = new TypeReportSource();

            source.TypeName = typeof(AccountingHelper.Reporting.SalaryOverviewReport).AssemblyQualifiedName;
            DateTime reportDate = timeFunctions.MonthEnd(DateTime.Now);

            source.Parameters.Add("ReportDate", reportDate);
            ViewerParameter parameter = new ViewerParameter()
            {
                typeReportSource = source
            };

            eventAggregator.GetEvent <ViewerParameterEvent>().Publish(parameter);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            IIQCareSystem appManager = (IIQCareSystem)ObjectFactory.CreateInstance("BusinessProcess.Security.BIQCareSystem, BusinessProcess.Security");

            Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
            System.Collections.Hashtable deviceInfo   = new System.Collections.Hashtable();
            TypeReportSource             reportSource = new TypeReportSource();

            reportSource.TypeName = typeof(PatientSummary).AssemblyQualifiedName;
            ReportSource myrep = reportSource;

            myrep.Parameters.Add(new Telerik.Reporting.Parameter("patientpk", Session["PatientId"].ToString()));
            myrep.Parameters.Add(new Telerik.Reporting.Parameter("logopath", "\\logo.png"));

            reportViewer1.ReportSource          = reportSource;
            reportViewer1.ParametersAreaVisible = false;
            this.reportViewer1.RefreshReport();
        }
 public Window_ReportViewer(TypeReportSource reportSource)
 {
     InitializeComponent();
     typeReportSource = reportSource;
 }
        private void PrintProtocolls(List <TravelExpense> travelExpensesToBeMoved)
        {
            List <int> idList = new List <int>();

            foreach (TravelExpense item in travelExpensesToBeMoved)
            {
                idList.Add(item.Id);

                if (CreateFiles)
                {
                    TravelExpense newItem = dbAccess.SetProvidedToDatev(item);
                    if (item == null)
                    {
                        NotificationRequest.Raise(new Notification()
                        {
                            Title   = "QuantCo Deutschland GmbH",
                            Content = $"Beim Setzen des Datums 'ProvidedToDatev' ({item.Id} ist ein Fehler aufgetreten"
                        });
                    }
                    else
                    {
                        // reload travelexpenses to show the updates made in SetProvidedToDatev

                        travelExpenses.Clear();
                        travelExpenses = new ObservableCollection <TravelExpense>(dbAccess.GetAllTravelExpenses());

                        ListOfTravelExpenses = CollectionViewSource.GetDefaultView(travelExpenses);

                        ListOfTravelExpenses.CurrentChanged -= ListOfTravelExpenses_CurrentChanged;
                        ListOfTravelExpenses.CurrentChanged += ListOfTravelExpenses_CurrentChanged;
                        RaisePropertyChanged("ListOfTravelExpenses");
                        if (travelExpenses.Count > 0)
                        {
                            selectedItem = travelExpenses[0];
                        }
                    }
                }
            }
            if (ShowReport)
            {
                TypeReportSource source = new TypeReportSource();
                source.TypeName = typeof(AccountingHelper.Reporting.TravelExpenses).AssemblyQualifiedName;
                source.Parameters.Add("TravelExpenseIds", idList);
                ViewerParameter parameter = new ViewerParameter()
                {
                    typeReportSource = source
                };
                eventaggregator.GetEvent <ViewerParameterEvent>().Publish(parameter);
            }


            if (CreateFiles)
            {
                // create Report as pdf file
                var reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();

                // set any deviceInfo settings if necessary
                var deviceInfo = new System.Collections.Hashtable();


                var reportSource = new Telerik.Reporting.TypeReportSource();

                // reportName is the Assembly Qualified Name of the report
                reportSource.TypeName = typeof(AccountingHelper.Reporting.TravelExpenses).AssemblyQualifiedName;


                // Pass parameter value with the Report Source if necessary
                reportSource.Parameters.Add("TravelExpenseIds", idList);

                Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", reportSource, deviceInfo);


                using (System.IO.FileStream fs = new System.IO.FileStream(Path.Combine(csvFolder, "ProtokollReisekosten.pdf"), System.IO.FileMode.Create))
                {
                    fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
                }
            }
        }
        private void OnPrepareTaxableExpenses()
        {
            List <int> employeeList = dbAccess.GetEmployeeIdsForOpenTaxableIncome();

            if (employeeList.Count == 0)
            {
                NotificationRequest.Raise(new Notification()
                {
                    Title   = "QuantCo Deutschland GmbH",
                    Content = "Es sind keine Datensätze vorhanden, die noch nicht versendet wurden"
                });
                return;
            }
            TypeReportSource source = new TypeReportSource();

            source.TypeName = typeof(AccountingHelper.Reporting.TaxableIncomeReport).AssemblyQualifiedName;
            ViewerParameter parameter = new ViewerParameter()
            {
                typeReportSource = source
            };

            eventaggregator.GetEvent <ViewerParameterEvent>().Publish(parameter);

            #region Save Report as File
            // pdf Datei erzeugen und in Datev speichern

            // specify foldername  .../Datev/TaxableIncomeReports/Report yyyyMMdd

            string foldername = Path.Combine(Properties.Settings.Default.RootDirectory, Properties.Settings.Default.DatevDirectory, "TaxableIncomeReports");
            Directory.CreateDirectory(foldername);
            string filename = $"Report {DateTime.Now.Date:yyyyMMdd}.pdf";
            filename = Path.Combine(foldername, filename);

            // create Report as pdf file
            var reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();

            // set any deviceInfo settings if necessary
            var deviceInfo = new System.Collections.Hashtable();


            var reportSource = new Telerik.Reporting.TypeReportSource();

            // reportName is the Assembly Qualified Name of the report
            reportSource.TypeName = typeof(AccountingHelper.Reporting.TaxableIncomeReport).AssemblyQualifiedName;


            Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", reportSource, deviceInfo);


            using (System.IO.FileStream fs = new System.IO.FileStream(filename, System.IO.FileMode.Create))
            {
                fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
            }
            #endregion

            #region Send File To Taxadvisor
            // send file to taxAdvisor

            // prepare Email

            SendEmailClass sendEmail = new SendEmailClass();
            sendEmail.Subject   = "Besteuerung von geldwerten Vorteilen ";
            sendEmail.ToAddress = Properties.Settings.Default.BdoHr;
            sendEmail.Attachments.Add(filename);
            sendEmail.Body = $"Sehr geehrte Damen und Herren,{System.Environment.NewLine} {System.Environment.NewLine} als Anlage erhalten Sie eine Aufstellung über die geldwerten Vorteile aus den Reisekostenabrechnungen. " +
                             $"{System.Environment.NewLine} {System.Environment.NewLine} Mit freundlichen Grüßen {System.Environment.NewLine} {System.Environment.NewLine} QuantCo Deutschland GmbH";

            bool success = sendEmail.SendEmailToServer();

            if (!success)
            {
                NotificationRequest.Raise(new Notification()
                {
                    Title   = "QuantCo Deutschland GmbH",
                    Content = $"Das Email an {sendEmail.ToAddress} konnte nicht gesendet werden"
                });
            }


            //MailItem mailItem = outlookApp.CreateItem(OlItemType.olMailItem);

            //mailItem.BodyFormat = OlBodyFormat.olFormatHTML;
            //mailItem.SendUsingAccount = outlookUsingAccount;
            //mailItem.Subject = "Besteuerung von geldwerten Vorteilen ";

            //string BdoHr = Properties.Settings.Default.BdoHr;

            //string[] emails = BdoHr.Split(';');

            //foreach (string email in emails)
            //{
            //    Recipient recipTo = mailItem.Recipients.Add(email);
            //    recipTo.Type = (int)OlMailRecipientType.olTo;
            //}


            //if (!mailItem.Recipients.ResolveAll())
            //{
            //    NotificationRequest.Raise(new Notification()
            //    {
            //        Title = "QuantCo Deutschland GmbH",
            //        Content = $"Die E-Mail-Adressen '{BdoHr}' enthalten mindestens einen falschen Eintrag"
            //    });

            //}
            //else
            //{
            //    mailItem.Body = $"Sehr geehrte Damen und Herren,{System.Environment.NewLine} {System.Environment.NewLine} als Anlage erhalten Sie eine Aufstellung über die geldwerten Vorteile aus den Reisekostenabrechnungen. " +
            //  $"{System.Environment.NewLine} {System.Environment.NewLine} Mit freundlichen Grüßen {System.Environment.NewLine} {System.Environment.NewLine} QuantCo Deutschland GmbH";


            //    mailItem.Attachments.Add(filename, OlAttachmentType.olByValue);
            //    mailItem.Save();

            //}
            #endregion

            ConfirmationRequest.Raise(new Confirmation()
            {
                Title   = "QuantCo Deutschland GmbH",
                Content = "Sollen die Einträge als 'gesendet' gekennzeichnet werden? "
            }, response =>
            {
                if (response.Confirmed)
                {
                    // send Emails to Employees
                    TaxableIncomeSendEmailsToEmployees();

                    // mark records as sent
                    int nrOfAmendments = dbAccess.SetProvidedToTaxableIncome();

                    NotificationRequest.Raise(new Notification()
                    {
                        Title   = "QuantCo Deutschland GmbH",
                        Content = $"Es wurden {nrOfAmendments} Datensätze geändert."
                    });
                }
            });
        }