Ejemplo n.º 1
0
        public override void SetVariables <T>(T data)
        {
            ReportFile.Load(GetReportMrtPath());
            var formattedData = data as RedemptionStatement;

            if (formattedData != null)
            {
                ReportFile.Dictionary.Variables.Add("FundTitle", formattedData.FundTitle);
                ReportFile.Dictionary.Variables.Add("SeoRegisterNumberTitle", formattedData.SeoRegisterNumber);
                ReportFile.Dictionary.Variables.Add("ReportTitle", Category.GetEnumDescription());
                ReportFile.Dictionary.Variables.Add("ReuestNumber", formattedData.RequestId);
                ReportFile.Dictionary.Variables.Add("RedemptionDate", formattedData.EmissionDate.ConvertMiladiToJalali(false));



                if (formattedData.PartyType == (int)PartyType.Retail)
                {
                    ReportFile.Dictionary.Variables.Add("RetailpPersonTitle", formattedData.PartyFullName);
                    ReportFile.Dictionary.Variables.Add("IdNumber", formattedData.IdentityCard);
                    ReportFile.Dictionary.Variables.Add("IssuePlace", "");
                    ReportFile.Dictionary.Variables.Add("BirthDate", formattedData.BirthDateJalali);
                    ReportFile.Pages.GetComponentByName("Text6").Enabled = false;
                }
                else
                {
                    ReportFile.Dictionary.Variables.Add("InstitutionalPersonTitle", formattedData.PartyFullName);
                    ReportFile.Dictionary.Variables.Add("RegistrationNumber", formattedData.IdentityCard);
                    ReportFile.Dictionary.Variables.Add("RegisterPlace", "");
                    ReportFile.Dictionary.Variables.Add("RegisterDate", formattedData.RegisterDateJalali);
                    ReportFile.Pages.GetComponentByName("Text5").Enabled = false;
                }
                ReportFile.Dictionary.Variables.Add("NationalId", formattedData.NationalId);


                ReportFile.Dictionary.Variables.Add("EvidenceVolume", formattedData.EvidenceVolume);
                ReportFile.Dictionary.Variables.Add("RemainVolume", formattedData.RemainVolume);


                ReportFile.Dictionary.Variables.Add("Price", formattedData.Price);

                ReportFile.Dictionary.Variables.Add("TotalAmount", formattedData.TotalAmount);

                ReportFile.Dictionary.Variables.Add("NetAmount", formattedData.NetAmount);

                ReportFile.Dictionary.Variables.Add("FixedFee", formattedData.FixedFee);
                ReportFile.Dictionary.Variables.Add("VariableFee", formattedData.VariableFee);


                ReportFile.Dictionary.Variables.Add("EmissionDate", formattedData.EmissionDate.ConvertMiladiToJalali(false));
                ReportFile.Dictionary.Variables.Add("AccountNumber", formattedData.CustomerAccountNumber);
                ReportFile.Dictionary.Variables.Add("AccountBrankBranch", formattedData.CustomerAccountBranchName ?? "");
                ReportFile.Dictionary.Variables.Add("BankName", formattedData.BankName ?? "");
            }

            ReportFile.Compile();
            ReportFile.Render();
        }
Ejemplo n.º 2
0
        public override void SetVariables <T>(T data)
        {
            ReportFile.Load(GetReportMrtPath());
            var formattedData = data as RedemptionReceipt;

            if (formattedData != null)
            {
                ReportFile.Dictionary.Variables.Add("FundTitle", formattedData.FundTitle);
                ReportFile.Dictionary.Variables.Add("SeoRegisterNumberTitle", formattedData.SeoRegisterNumber);
                ReportFile.Dictionary.Variables.Add("ReportTitle", Category.GetEnumDescription());
                ReportFile.Dictionary.Variables.Add("ReceiptNumber", formattedData.EvidenceNumber);
                ReportFile.Dictionary.Variables.Add("ReceiptDate", formattedData.Date.ConvertMiladiToJalali(false));
                ReportFile.Dictionary.Variables.Add("CustomerTitle", formattedData.PartyFullName);



                if (formattedData.PartyType == (int)PartyType.Retail)
                {
                    ReportFile.Dictionary.Variables.Add("RetailpPersonTitle", formattedData.PartyFullName);
                    ReportFile.Dictionary.Variables.Add("IdNumber", formattedData.IdentityCard);
                    ReportFile.Dictionary.Variables.Add("IssuePlace", "");
                    ReportFile.Dictionary.Variables.Add("BirthDate", formattedData.BirthDateJalali);
                    ReportFile.Pages.GetComponentByName("Text6").Enabled = false;
                }
                else
                {
                    ReportFile.Dictionary.Variables.Add("InstitutionalPersonTitle", formattedData.PartyFullName);
                    ReportFile.Dictionary.Variables.Add("RegistrationNumber", formattedData.IdentityCard);
                    ReportFile.Dictionary.Variables.Add("RegisterPlace", "");
                    ReportFile.Dictionary.Variables.Add("RegisterDate", formattedData.RegisterDateJalali);
                    ReportFile.Pages.GetComponentByName("Text5").Enabled = false;
                }
                ReportFile.Dictionary.Variables.Add("NationalId", formattedData.NationalId);


                ReportFile.Dictionary.Variables.Add("RequestNumber", formattedData.RequestId);
                ReportFile.Dictionary.Variables.Add("RedemptionUnit", formattedData.Volume);


                ReportFile.Dictionary.Variables.Add("ReceiptDateTime", formattedData.DataJalali);

                ReportFile.Dictionary.Variables.Add("ManagerName", formattedData.FundBranchManagerTitle);

                ReportFile.Dictionary.Variables.Add("BranchName", formattedData.FundBranchName);
            }

            ReportFile.Compile();
            ReportFile.Render();
        }
Ejemplo n.º 3
0
        public void OpenFile(string SourceFile)
        {
            SelectedTab = -1;

            if (SourceFile == null)
            {
                var dialog = new OpenFileDialog()
                {
                    Filter = "Report Files (*.rxml Files)|*.rxml|Vuln Files (*.pxml)|*.pxml|All|*.*"
                };
                if (dialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
                {
                    return;
                }

                SourceFile = dialog.FileName;
            }

            var info = new FileInfo(SourceFile);

            ReportDir = info.Directory.FullName;

            if (info.Extension == ".rxml")
            {
                var reportFiles = ReportFile.Load(SourceFile);

                Func <string, string> getFilePath = x => info.DirectoryName + "\\" +
                                                    new FileInfo(x).Name;

                var staticAnalysisReport = reportFiles
                                           .SingleOrDefault(x => x.Name == "Static analysis");

                if (staticAnalysisReport != null)
                {
                    var alerts = StaticAnalysisFileAlertCollection
                                 .Load(getFilePath(staticAnalysisReport.Filename))
                                 .SelectMany(x => x.Alerts.Select(y => new
                    {
                        x.Filename,
                        Alert = y,
                    }))
                                 .OrderBy(x => x.Alert.Name);

                    if (alerts.Any())
                    {
                        StaticAnalysisVisibility = Visibility.Visible;
                        StaticAnalysisAlerts     = alerts;
                    }
                }

                var vulnReport = reportFiles
                                 .SingleOrDefault(x => new FileInfo(x.Filename).Extension == ".pxml");

                if (vulnReport != null)
                {
                    VulnerabilityTabVisibility = Visibility.Visible;
                    SelectedTab = 0;

                    var alerts = ScanAlertCollection.Load(getFilePath(vulnReport.Filename));

                    if (alerts == null)
                    {
                        return;
                    }

                    CreateAlertViewModels(alerts);
                }
                else
                {
                    VulnerabilityTabVisibility = Visibility.Collapsed;
                }


                var inputMap = reportFiles
                               .SingleOrDefault(x => x.Name == "Input Map Report");

                if (inputMap != null)
                {
                    var inputMapFile = inputMap.Filename;
                    InputTable = ApplicationMap
                                 .FromXml(getFilePath(inputMapFile)).Pages
                                 .ToDictionary(
                        x => string.Format(
                            "{0} ({1})",
                            x.Page,
                            x.SuperglobalNameCollectionTable.Sum(y => y.Value.Count())),
                        x => new Dictionary <string, List <object> >()
                    {
                        { "GET", x.Get.Select(y => (object)(new { Key = y })).ToList() },
                        { "POST", x.Post.Select(y => (object)(new { Key = y })).ToList() },
                        { "REQUEST", x.Request.Select(y => (object)(new { Key = y })).ToList() },
                        { "Files", x.Files.Select(y => (object)(new { Key = y })).ToList() },
                        { "Cookies", x.Cookie.Select(y => (object)(new { Key = y })).ToList() }
                    }
                        .Where(y => y.Value.Any())
                        .ToDictionary(
                            y => string.Format("{0} ({1})", y.Key,
                                               y.Value.Count()), y => y.Value));

                    InputMapVisibility = Visibility.Visible;
                    if (SelectedTab == -1)
                    {
                        SelectedTab = 1;
                    }
                }


                var coverageReport = reportFiles
                                     .SingleOrDefault(x => x.Name == "Annotation");

                if (coverageReport != null)
                {
                    CoverageVisibility = Visibility.Visible;
                    if (SelectedTab == -1)
                    {
                        SelectedTab = 2;
                    }

                    var annotationFile = Path.Combine(info.DirectoryName, coverageReport.Filename);
                    var pluginTable    = PluginAnnotationTable.Load(annotationFile);

                    CoverageTables = pluginTable.Items
                                     .Select(x => new CodeCoverageCalculator(x).CalculateCoverage(false))
                                     .ToArray();
                }
                else
                {
                    CoverageVisibility = Visibility.Collapsed;
                }

                if (SelectedTab != -1)
                {
                    DynamicAnalysisVisibility = Visibility.Visible;
                    SelectedRootTab           = 0;
                }
                else
                {
                    SelectedRootTab = 1;
                }
            }
            else
            {
                var alerts = ScanAlertCollection.Load(SourceFile);

                if (alerts == null)
                {
                    return;
                }

                DynamicAnalysisVisibility  = Visibility.Visible;
                SelectedRootTab            = 0;
                VulnerabilityTabVisibility = Visibility.Visible;
                InputMapVisibility         = Visibility.Collapsed;
                CoverageVisibility         = Visibility.Collapsed;
                SelectedTab = 0;

                CreateAlertViewModels(alerts);
            }
        }
        public override void SetVariables <T>(T data)
        {
            ReportFile.Load(GetReportMrtPath());
            var formattedData = data as SubscriptionReceipt;

            if (formattedData != null)
            {
                ReportFile.Dictionary.Variables.Add("FundTitle", formattedData.FundTitle);
                ReportFile.Dictionary.Variables.Add("SeoRegisterNumberTitle", formattedData.SeoRegisterNumber);
                ReportFile.Dictionary.Variables.Add("ReportTitle", Category.GetEnumDescription());
                ReportFile.Dictionary.Variables.Add("Amount", formattedData.Amount);
                ReportFile.Dictionary.Variables.Add("FishNumber", formattedData.DepositTranckigNumber);
                ReportFile.Dictionary.Variables.Add("ReuestNumber", formattedData.RequestId);
                ReportFile.Dictionary.Variables.Add("ReuestNumber", formattedData.RequestId);
                if (formattedData.PartyType == (int)PartyType.Retail)
                {
                    ReportFile.Dictionary.Variables.Add("RetailpPersonTitle", formattedData.PartyFullName);
                    ReportFile.Dictionary.Variables.Add("IdNumber", formattedData.IdentityCard);
                    ReportFile.Dictionary.Variables.Add("IssuePlace", "");
                    ReportFile.Dictionary.Variables.Add("BirthDate", formattedData.BirthDateJalali);
                    ReportFile.Pages.GetComponentByName("Text6").Enabled = false;
                }
                else
                {
                    ReportFile.Dictionary.Variables.Add("InstitutionalPersonTitle", formattedData.PartyFullName);
                    ReportFile.Dictionary.Variables.Add("RegistrationNumber", formattedData.IdentityCard);
                    ReportFile.Dictionary.Variables.Add("RegisterPlace", "");
                    ReportFile.Dictionary.Variables.Add("RegisterDate", formattedData.RegisterDateJalali);
                    ReportFile.Pages.GetComponentByName("Text5").Enabled = false;
                }
                ReportFile.Dictionary.Variables.Add("NationalId", formattedData.NationalId);

                ReportFile.Dictionary.Variables.Add("Address", formattedData.HomeAddress ?? formattedData.BusinessAddress);

                ReportFile.Dictionary.Variables.Add("Phone", formattedData.BusinessPhone ?? formattedData.HomePhone);

                ReportFile.Dictionary.Variables.Add("Mobile", formattedData.Mobile);

                ReportFile.Dictionary.Variables.Add("Email", formattedData.Email1);

                ReportFile.Dictionary.Variables.Add("PostalCode", formattedData.PostalCode);

                ReportFile.Dictionary.Variables.Add("AccountNumber", formattedData.CustomerAccountNumber);
                ReportFile.Dictionary.Variables.Add("FundAccountNumber", formattedData.AccountNumber);


                ReportFile.Dictionary.Variables.Add("AccountBrankBranch", formattedData.CustomerAccountBranchName ?? "");

                ReportFile.Dictionary.Variables.Add("BankName", formattedData.BankName);

                ReportFile.Dictionary.Variables.Add("AccountType", formattedData.CustomerAccountType > 0 ? ((BankAccountType)formattedData.CustomerAccountType).GetEnumDescription() : "");

                ReportFile.Dictionary.Variables.Add("SubscribtionDate", formattedData.DataJalali);

                ReportFile.Dictionary.Variables.Add("Manager", formattedData.FundBranchManagerTitle);

                ReportFile.Dictionary.Variables.Add("BranchName", formattedData.FundBranchName);
            }

            ReportFile.Compile();
            ReportFile.Render();
        }