public ReportResult GetReport()
        {
            ReportResult result = new ReportResult();

            result.Date = DateTime.Now;

            foreach (TreeTestDomain td in this.list)
            {
                if (td.TestEngine == null)
                {
                    continue;
                }
                if (td.TestEngine.Report == null)
                {
                    continue;
                }
                if (td.TestEngine.Report.Result == null)
                {
                    continue;
                }

                result.Merge(td.TestEngine.Report.Result);
            }

            result.UpdateCounts();
            return(result);
        }
Example #2
0
        public void CheckInheritedSetUpAndTearDownAreCalled()
        {
            ReportResult result = Run(typeof(SetUpAndTearDownFixture));

            Assert.AreEqual(1, setUpCount);
            Assert.AreEqual(1, tearDownCount);
        }
Example #3
0
        public void LoadAndRunFixtures()
        {
            this.CreateAssembly();

            // load assembly
            using (TestDomain domain = new TestDomain(this.compiler.Parameters.OutputAssembly))
            {
                domain.ShadowCopyFiles = false;
                domain.InitializeEngine();
                foreach (string dir in this.Compiler.Parameters.ReferencedAssemblies)
                {
                    domain.TestEngine.AddHintDirectory(dir);
                }
                domain.PopulateEngine();
                Console.WriteLine("Domain loaded");
                Console.WriteLine("Tree populated, {0} tests", domain.TestEngine.GetTestCount());
                // Assert.AreEqual(1, domain.TestTree.GetTestCount());
                // domain.TestTree.Success+=new MbUnit.Core.RunSuccessEventHandler(TestTree_Success);
                // running tests
                domain.TestEngine.RunPipes();

                // display report
                TextReport report = new TextReport();
                result = domain.TestEngine.Report.Result;
                report.Render(result, Console.Out);
                counter = domain.TestEngine.GetTestCount();
            }
        }
        /// <summary>
        /// Return reports for DOK.
        /// Supported Queries:
        /// QueryName = "register-DOK-selectedAndAdditional".
        /// QueryName = "register-DOK-selectedTheme".
        /// QueryName = "register-DOK-coverage".
        /// </summary>
        public ReportResult Post(ReportQuery query)
        {
            Trace.WriteLine("QueryName: " + query.QueryName);

            ReportResult result = new ReportResult();

            if (query.QueryName == "register-DOK-selectedAndAdditional")
            {
                result = _dokReportService.GetSelectedAndAdditionalDatasets(query);
            }
            else if (query.QueryName == "register-DOK-selectedSuitability")
            {
                result = _dokReportService.GetSelectedSuitabilityDatasets(query);
            }
            else if (query.QueryName == "register-DOK-selectedTheme")
            {
                result = _dokReportService.GetSelectedDatasetsByTheme(query);
            }
            else if (query.QueryName == "register-DOK-coverage")
            {
                result = _dokReportService.GetSelectedDatasetsCoverage(query);
            }


            return(result);
        }
Example #5
0
        private void GenerateReports(ITestListener testListener, Assembly assembly, ReportResult result)
        {
            try
            {
                string outputPath = GetAppDataPath("");
                string nameFormat = assembly.GetName().Name + ".Tests";

                string file = HtmlReport.RenderToHtml(result, outputPath, nameFormat);

                if (file != "")
                {
                    Uri uri = new Uri("file:" + Path.GetFullPath(file).Replace("\\", "/"));
                    testListener.TestResultsUrl(uri.AbsoluteUri);
                }
                else
                {
                    testListener.WriteLine("Skipping report generation", Category.Info);
                }
            }
            catch (Exception ex)
            {
                testListener.WriteLine("failed to create reports", Category.Error);
                testListener.WriteLine(ex.ToString(), Category.Error);
            }
        }
Example #6
0
        //[Test]
        //[TestCaseSource( "RunReport_GetTestData" )]
        // Requires <system.web><machinekey ...> to be present
        public void RunReport_Web(TenantInfo tenant, long reportId, string reportName)
        {
            using (tenant.GetTenantAdminContext( ))
            {
                string uri = $"data/v1/report/{reportId}/?metadata=full&page=0,1";
                using (var request = new PlatformHttpRequest(uri, PlatformHttpMethod.Post))
                {
                    request.PopulateBodyString(@"{""conds"":[]}");

                    HttpWebResponse response = request.GetResponse( );
                    Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.OK));

                    ReportResult reportResult = request.DeserialiseResponseBody <ReportResult>( );

                    Assert.That(reportResult, Is.Not.Null, "result");
                    Assert.That(reportResult.Metadata, Is.Not.Null, "Metadata");
                    Assert.That(reportResult.Metadata.ReportColumns, Is.Not.Null, "ReportColumns");
                    Assert.That(reportResult.Metadata.ReportColumns.Count, Is.GreaterThan(0), "ReportColumns.Count");
                    Assert.That(reportResult.Metadata.InvalidReportInformation, Is.Not.Null, "InvalidReportInformation missing");
                    Assert.That(reportResult.Metadata.InvalidReportInformation ["nodes"], Is.Null, "Report has invalid nodes");
                    Assert.That(reportResult.Metadata.InvalidReportInformation ["columns"], Is.Null, "Report has invalid columns");
                    Assert.That(reportResult.Metadata.InvalidReportInformation ["conditions"], Is.Null, "Report has invalid conditions");
                }
            }
        }
        public static DataTable QueryInvoices(CustomProcessingSoapClient customSdk, Datalayer.Xero.Interresolve.AquariumCustomProcessing.SessionDetails sessionDetails, AquariumInvoiceTypeToQuery theInvoiceType)
        {
            DataTable TableToReturn = new DataTable();
            string ProcName = "";

            switch(theInvoiceType)
            {
                case AquariumInvoiceTypeToQuery.InboundInvoice:
                    ProcName = System.Configuration.ConfigurationManager.AppSettings["_C74_Xero_GetInboundInvoiceData"].ToString();
                    break;

                case AquariumInvoiceTypeToQuery.OutboundInvoice:
                    ProcName = System.Configuration.ConfigurationManager.AppSettings["_C74_Xero_GetInvoiceData"].ToString();
                    break;

            }

            string[] ProcParm = null;

            ReportResult result = new ReportResult();

            result = customSdk.RunCustomProc(sessionDetails, ProcName, ProcParm);

            if (result.ResultInfo.ReturnCode == Datalayer.Xero.Interresolve.AquariumCustomProcessing.BasicCode.OK)
            {
                TableToReturn = SDKGeckoboardHelper.GetDataTableFromSdkResult(result.Data.Columns, result.Data.Rows);
                return TableToReturn;
            }

            else
            {
                Exception ex = new Exception("There has been a problem in the QueryInvoices method in the invoice helper class");
                throw ex;
            }
        }
Example #8
0
        /// <summary>
        /// Render the report result to a file
        /// </summary>
        /// <param name="result">Result from the test</param>
        /// <param name="fileName">Report output file name </param>
        public virtual void Render(ReportResult result, string fileName)
        {
            bool isProfiling = Environment.GetEnvironmentVariable("cor_enable_profiling") == "1";

            if (!isProfiling)
            {
                if (result == null)
                {
                    throw new ArgumentNullException("result");
                }
                if (fileName == null)
                {
                    throw new ArgumentNullException("fileName");
                }
                if (fileName.Length == 0)
                {
                    throw new ArgumentException("Length is 0", "fileName");
                }

                using (StreamWriter writer = new StreamWriter(fileName))
                {
                    // this will create a UTF-8 format with no preamble.
                    // We might need to change that if it create a problem with internationalization
                    Render(result, writer);
                }
            }
        }
Example #9
0
        public void TestReportsReportFiltersReportsAssignedToAccessRules( )
        {
            using (new SecurityBypassContext( ))
            {
                var reportsReport = Entity.Get <ReadiNow.Model.Report>("k:reportsReport");

                var          reportInterface = new ReportingInterface( );
                ReportResult result          = reportInterface.RunReport(reportsReport, null);

                var errors = new StringBuilder( );

                foreach (DataRow row in from row in result.GridData let report = Entity.Get <ReadiNow.Model.Report>(row.EntityId) where report != null where report.ReportForAccessRule != null select row)
                {
                    if (errors.Length > 0)
                    {
                        errors.Append(",");
                    }
                    errors.AppendFormat("{0}", row.EntityId);
                }

                if (errors.Length > 0)
                {
                    errors.Insert(0, "The following reports are assigned to access rules: ");
                    Assert.Fail(errors.ToString( ));
                }
            }
        }
Example #10
0
        public void Test_Rollup_Report_On_EditForm()
        {
            using (new SecurityBypassContext())
            {
                var report         = CodeNameResolver.GetInstance("AA_All Fields Rollup", "Report");
                var typeId         = Factory.ScriptNameResolver.GetTypeByName("AA_Herb");
                var instance       = CodeNameResolver.GetInstance("Basil", "AA_Herb");
                var relationshipId = Factory.ScriptNameResolver.GetMemberOfType("AA_All Fields", typeId, MemberType.Relationship).MemberId;

                ReportSettings settings = new ReportSettings
                {
                    ReportRelationship = new ReportRelationshipSettings
                    {
                        EntityId       = instance.Id,
                        RelationshipId = relationshipId,
                        Direction      = ReportRelationshipSettings.ReportRelationshipDirection.Forward
                    },
                    RequireFullMetadata = true
                };

                var          reportInterface = new ReportingInterface();
                ReportResult result          = reportInterface.RunReport(report.Id, null);

                Assert.That(result, Is.Not.Null);
                Assert.That(result.GridData, Has.Count.GreaterThan(0));
                Assert.That(result.AggregateMetadata.Groups, Has.Count.EqualTo(2));
            }
        }
Example #11
0
        public static ReportResult RunQuery(QueryOption queryOption)
        {
            ReportResult rptResult = new ReportResult();
            Dictionary <string, object> sqlParams;

            var query = GenerateQuery(queryOption, out sqlParams, queryOption.DateTypeFilters);

            var data = ExecuteTextTable(query, queryOption.TableName, queryOption.ConnectionString, sqlParams, queryOption.ReportTimeOut);

            rptResult.ResultData = data;

            if (queryOption.IsGetDataColumns && data != null)
            {
                var listColumnNames = new List <string>();

                foreach (DataColumn column in data.Columns)
                {
                    listColumnNames.Add(column.ColumnName);
                }

                rptResult.ResultColums = listColumnNames;
            }

            return(rptResult);
        }
Example #12
0
        public void TestReportWithWriteOnlyField(bool isFieldWriteOnly)
        {
            try
            {
                var field = Entity.Get <Field>("test:afString", true);
                field.IsFieldWriteOnly = isFieldWriteOnly;
                field.Save();

                IEnumerable <IEntity> reports = Entity.GetByName("AF_String");

                var          reportInterface = new ReportingInterface();
                ReportResult result          = reportInterface.RunReport(reports.First().Id, null);

                if (isFieldWriteOnly)
                {
                    Assert.IsTrue(result.GridData.All(d => string.IsNullOrEmpty(d.Values[1].Value)), "We should not have any values");
                }
                else
                {
                    Assert.IsTrue(result.GridData.Any(d => !string.IsNullOrEmpty(d.Values[1].Value)), "We should have at least 1 value");
                }
            }
            finally
            {
                CacheManager.ClearCaches();
            }
        }
Example #13
0
        private readonly IUserManager _userManager; ///< Manager for user

        #endregion

        #region [Public Methods]

        /// <summary> Gets the given request. </summary>
        /// <param name="request"> The request. </param>
        /// <returns> A Task&lt;object&gt; </returns>
        public object Get(GetActivityLogs request)
        {
            request.DisplayType = "Screen";
            ReportResult result = GetReportActivities(request);

            return(result);
        }
Example #14
0
        public ReportResult Build(ReportBuildSettings settings, bool force = false)
        {
            // load data that doen't depend of settings
            LoadBaseReportData();
            // load data correpont to provided settings
            LoadData(settings, force);

            // filter transactions by data type
            var filteredTransactions = _transactions.Where(x =>
                                                           (settings.DataType == RecordType.Expense && x.IsExpense) || (settings.DataType == RecordType.Income && x.IsIncome));

            // filter transactions by user data filter
            filteredTransactions = settings.ApplyFilter(filteredTransactions);

            // build result
            var result = new ReportResult();

            // populate report units correspont to selected section
            result.ReportUnits = settings.Section == BarChartSection.Category
                ? BuildReportUnits(filteredTransactions, settings.CategoryLevel, settings.DetailsDepth, settings.Sorting)
                : BuildReportUnits(filteredTransactions, settings.PeriodType, settings.DateFrom, settings.DateUntil);
            // calculate total
            result.TotAmountDetailed = FormatMainCurrency(result.ReportUnits.Sum(x => x.Amount), true);

            return(result);
        }
Example #15
0
        /// <summary> Export to CSV. </summary>
        /// <param name="reportResult"> The report result. </param>
        /// <returns> A string. </returns>
        public string ExportToCsv(ReportResult reportResult)
        {
            StringBuilder returnValue = new StringBuilder();

            returnValue.AppendLine(string.Join(";", reportResult.Headers.Select(s => s.Name.Replace(',', ' ')).ToArray()));

            if (reportResult.IsGrouped)
            {
                foreach (ReportGroup group in reportResult.Groups)
                {
                    foreach (ReportRow row in reportResult.Rows)
                    {
                        returnValue.AppendLine(string.Join(";", row.Columns.Select(s => s.Name.Replace(',', ' ')).ToArray()));
                    }
                }
            }
            else
            {
                foreach (ReportRow row in reportResult.Rows)
                {
                    returnValue.AppendLine(string.Join(";", row.Columns.Select(s => s.Name.Replace(',', ' ')).ToArray()));
                }
            }

            return(returnValue.ToString());
        }
Example #16
0
        public void Test_MaxCols_Returns_Grouped_Columns()
        {
            using (new SecurityBypassContext())
            {
                var report = Entity.GetByName <Report>("Temperature").First(r => r.InSolution != null && r.InSolution.Name == "Foster University");

                ReportSettings settings = new ReportSettings
                {
                    ColumnCount         = 3,
                    RequireFullMetadata = true
                };

                var          reportInterface = new ReportingInterface();
                ReportResult result          = reportInterface.RunReport(report.Id, settings);

                Assert.That(result, Is.Not.Null);
                Assert.That(result.GridData, Has.Count.GreaterThan(0));
                Assert.That(result.GridData[0].Values, Has.Count.EqualTo(4));
                Assert.That(result.Metadata.ReportColumns, Has.Count.EqualTo(4));
                Assert.That(result.AggregateMetadata.Groups, Has.Count.EqualTo(1));
                Assert.That(result.AggregateMetadata.Groups[0], Has.Count.EqualTo(1));
                long groupColumnId = result.AggregateMetadata.Groups[0].Keys.First();
                Assert.IsTrue(result.Metadata.ReportColumns.ContainsKey(groupColumnId.ToString(CultureInfo.InvariantCulture)));
            }
        }
        private void GenerateTable(ReportResult result, bool showTotal)
        {
            MainTable.Rows.Clear();

            ProcessChildItems(result.Items, "group_", 0, true);

            if (showTotal)
            {
                // Total row
                TableRow row = new TableRow();
                {
                    TableCell cell1 = new TableCell();
                    cell1.Text      = LocRM.GetString("Total");
                    cell1.Font.Bold = true;
                    row.Cells.Add(cell1);

                    TableCell cell2 = new TableCell();
                    cell2.Text            = result.Total.ToString("f");
                    cell2.Font.Bold       = true;
                    cell2.HorizontalAlign = HorizontalAlign.Right;
                    cell2.Width           = Unit.Pixel(100);
                    row.Cells.Add(cell2);
                }
                MainTable.Rows.Add(row);
            }
        }
Example #18
0
        public ReportResult SetResultRequest(long scan_id, string report_type, resultClass token)
        {
            try
            {
                ReportRequest request = new ReportRequest()
                {
                    reportType = report_type,
                    scanId     = scan_id
                };

                post   Post         = new post();
                secure token_secure = new secure(token);
                token_secure.findToken(token);
                string path = token_secure.post_rest_Uri(CxConstant.CxReportRegister);
                Post.post_Http(token, path, request);
                if (token.status == 0)
                {
                    ReportResult report = JsonConvert.DeserializeObject <ReportResult>(token.op_result);
                    return(report);
                }
            }
            catch (Exception ex)
            {
                token.status        = -1;
                token.statusMessage = ex.Message;
            }
            return(null);
        }
Example #19
0
        private bool InternalExecute()
        {
            this.Log.LogMessage("MbUnit {0} test runner",
                                typeof(Fixture).Assembly.GetName().Version);

            this.DisplayTaskConfiguration();
            // check data
            this.VerifyData();

            // create new report
            this.result = new ReportResult();

            // load and execute
            using (
                TestDomainDependencyGraph graph =
                    TestDomainDependencyGraph.BuildGraph(this.Assemblies, this.AssemblyPaths, FixtureFilters.Any, false))
            {
                graph.Log += new ErrorReporter(graph_Log);
                ReportResult r = graph.RunTests();
                graph.Log -= new ErrorReporter(graph_Log);
                result.Merge(r);
            }

            this.GenerateReports();

            return(result.Counter.FailureCount == 0);
        }
Example #20
0
        private void GenerateTable(ReportResult result)
        {
            MainTable.Rows.Clear();

            // Header
            TableHeaderRow row = new TableHeaderRow();

            {
                TableCell cell1 = new TableCell();
                cell1.Text = "&nbsp;";
                row.Cells.Add(cell1);

                TableCell cell2 = new TableCell();
                cell2.Text            = LocRM.GetString("Approved");
                cell2.Width           = Unit.Pixel(100);
                cell2.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cell2);

                TableCell cell3 = new TableCell();
                cell3.Text            = LocRM.GetString("Registered");
                cell3.Width           = Unit.Pixel(100);
                cell3.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cell3);

                TableCell cell4 = new TableCell();
                cell4.Text            = LocRM.GetString("Cost");
                cell4.Width           = Unit.Pixel(100);
                cell4.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cell4);
            }
            MainTable.Rows.Add(row);

            ProcessChildItems(result.Items, "group_", 0, true);
        }
Example #21
0
        void GenerateReports(ReportResult reportResult, string reportTypes)
        {
            Ensure.ArgumentIsNotNull(reportResult, "reportResult");

            if (BuildEnvironment.IsTeamCityBuild)
            {
                TeamCityReportGenerator.RenderReport(reportResult, this);
            }

            if (String.IsNullOrEmpty(reportTypes))
            {
                return;
            }

            Log(Level.Info, "Generating reports");
            foreach (string reportType in reportTypes.Split(';'))
            {
                string reportFileName = null;
                Log(Level.Verbose, "Report type: {0}", reportType);
                switch (reportType.ToLower())
                {
                case "text":
                    reportFileName = TextReport.RenderToText(reportResult, ReportDirectory, ReportFileNameFormat);
                    break;

                case "xml":
                    reportFileName = XmlReport.RenderToXml(reportResult, ReportDirectory, ReportFileNameFormat);
                    break;

                case "html":
                    reportFileName = HtmlReport.RenderToHtml(reportResult, ReportDirectory, ReportFileNameFormat);
                    break;

                case "dox":
                    reportFileName = DoxReport.RenderToDox(reportResult, ReportDirectory, ReportFileNameFormat);
                    break;

                case "transform":
                    if (Transform == null)
                    {
                        throw new BuildException(String.Format("No transform specified for report type '{0}'", reportType));
                    }

                    reportFileName = HtmlReport.RenderToHtml(reportResult,
                                                             ReportDirectory,
                                                             Transform.FullName,
                                                             TransformReportFileNameFormat);
                    break;

                default:
                    Log(Level.Error, "Unknown report type {0}", reportType);
                    break;
                }

                if (reportFileName != null)
                {
                    Log(Level.Info, "Created report at {0}", reportFileName);
                }
            }
        }
Example #22
0
        public JsonResult UpdateReport([FromBody] ReportObj reportObj)
        {
            var report = _context.Reports.FirstOrDefault(r => r.ID == reportObj.ReportID);

            if (report == null)
            {
                report = new Report();
                _context.Reports.Add(report);
                _context.SaveChanges();
            }

            report.Updated = DateTime.Now;

            Location location = new Location
            {
                ReportID  = report.ID,
                Longitude = reportObj.Longitude,
                Latitude  = reportObj.Latitude,
                DateTime  = DateTime.Now
            };

            _context.Locations.Add(location);
            _context.SaveChanges();

            var result = new ReportResult(200, "Success", report.ID);

            return(Json(result));
        }
Example #23
0
        public void ExecuteAssemblies(
            [UsingFactories("AssemblyNames")] string name,
            [UsingFactories("AssemblyNames")] string secondName,
            [UsingFactories("AssemblyNames")] string thirdName
            )
        {
            int       successCount = 0;
            ArrayList names        = new ArrayList();

            names.Add(name);
            names.Add(secondName);
            names.Add(thirdName);

            if (names.Contains("ChildAssembly"))
            {
                if (!names.Contains("SickParentAssembly"))
                {
                    successCount++;
                }
            }
            if (names.Contains("ParentAssembly"))
            {
                successCount++;
            }

            string[] files = new string[] { name + ".dll", secondName + ".dll", thirdName + ".dll" };

            using (TestDomainDependencyGraph graph = TestDomainDependencyGraph.BuildGraph(files, null, MbUnit.Core.Filters.FixtureFilters.Any, false))
            {
                ReportResult result = graph.RunTests();
                Assert.AreEqual(successCount, result.Counter.SuccessCount);
            }
        }
        public override byte[] Convert(ReportResult report)
        {
            if (report == null)
            {
                throw new ArgumentNullException(nameof(report));
            }

            var prReport = report as WeeklyStatusReport;

            if (prReport == null)
            {
                throw new NotSupportedException($"Report of type {report.GetType()} is not supported by {nameof(WeeklyStatusReportToExcelConverter)}");
            }

            var memory = new MemoryStream();
            {
                var workbook = new XSSFWorkbook();
                CreateReportSheet(workbook, "Resolved Work Items", prReport.ResolvedWorkItems);
                CreateReportSheet(workbook, "Work Items In Pull Request", prReport.WorkItemsInReview);
                CreateReportSheet(workbook, "Active Work Items", prReport.ActiveWorkItems, true);

                workbook.Write(memory);
                return(memory.ToArray());
            }
        }
Example #25
0
        public IActionResult Index(IndexPatientReceptionViewModel model)
        {
            System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);

            List <DataSetsValues> list = _patientReceptionsRepository.GetAllPatientReceptions(model.StartDateTime, model.EndDateTime)
                                         .Select(x => new DataSetsValues
            {
                PatientFirstName     = x.PatientFirstName,
                DateOfReception      = x.DateOfReception,
                DoctorFirstName      = x.DoctorFirstName,
                DoctorLastName       = x.DoctorLastName,
                DoctorLicenseNumber  = x.DoctorLicenseNumber,
                EmergencyCase        = x.EmergencyCase,
                IsThereMedicalReport = x.IsThereMedicalReport,
                PatientLastName      = x.PatientLastName,
                PatientReceptionId   = x.PatientReceptionId,
                MedicalReport        = string.IsNullOrEmpty(x.MedicalReport) ? "Medical report doesn't exist!" : x.MedicalReport
            }).ToList();

            LocalReport _localReport = new LocalReport("Reports/Report1.rdlc");

            _localReport.AddDataSource("DataSet1", list);

            ReportResult result = _localReport.Execute(RenderType.Pdf);

            return(File(result.MainStream, "application/pdf"));
        }
        public object Drukuj(Context cx)
        {
            var parametry = new ParametryWydrukuDokumentu(cx)
            {
                Oryginał   = false,
                IloscKopii = 1,
                Duplikat   = true
            };

            cx[typeof(ParametryWydrukuDokumentu)] = parametry;

            context = cx;

            var reportResult = new ReportResult
            {
                Context            = cx,
                DataType           = typeof(DokumentHandlowy),
                TemplateFileSource =
                    AspxSource.Local,
                TemplateFileName = "handel/sprzedaz.aspx",
                Format           = ReportResultFormat.PDF,
                OutputHandler    = ZapiszPlik
            };

            return(reportResult);
        }
Example #27
0
        public static string RenderToXml(ReportResult result, string outputPath, string transform, string nameFormat)
        {
            if (result == null)
            {
                throw new ArgumentNullException("result");
            }
            if (nameFormat == null)
            {
                throw new ArgumentNullException("nameFormat");
            }
            if (nameFormat.Length == 0)
            {
                throw new ArgumentException("Length is zero", "nameFormat");
            }

            XmlReport xmlReport = new XmlReport();

            if (transform != null)
            {
                if (!File.Exists(transform))
                {
                    throw new ArgumentException("Transform does not exist.", "transform");
                }
                XslTransform xsl = new XslTransform();
                xsl.Load(transform);
                xmlReport.Transform = xsl;
            }
            return(xmlReport.Render(result, outputPath, nameFormat));
        }
Example #28
0
        public async Task <IHttpActionResult> PutReportResult(int id, ReportResult reportResult)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != reportResult.ReportResultId)
            {
                return(BadRequest());
            }

            db.Entry(reportResult).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ReportResultExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        private readonly IUserManager _userManager; ///< Manager for user

        #endregion

        #region [Public Methods]

        /// <summary> Gets the given request. </summary>
        /// <param name="request"> The request. </param>
        /// <returns> A Task&lt;object&gt; </returns>
        public async Task <object> Get(GetActivityLogs request)
        {
            request.DisplayType = "Screen";
            ReportResult result = await GetReportActivities(request).ConfigureAwait(false);

            return(result);
        }
Example #30
0
        /// <summary>
        /// Insert date from datatable to worksheet.
        /// </summary>
        private static void InsertTableData(ReportResult reportResult, SheetData sheetData, List <DataRow> rows)
        {
            // Add column names to the first row
            Row header = new Row();

            header.RowIndex = (UInt32)1;
            int headerColInx = 0;

            foreach (ReportColumn column in reportResult.Metadata.ReportColumns.Values)
            {
                if (!column.IsHidden && column.Type != "Image")
                {
                    Cell headerCell = CreateTextCell(null);
                    SetCellLocation(headerCell, headerColInx, 1);
                    header.AppendChild(headerCell);
                    sharedStrings.TryAdd(sharedStringIndex, column.Title.Trim());
                    headerColInx++;
                }
            }
            sheetData.AppendChild(header);

            // Loop through each data row
            int excelRowIndex = 2;

            foreach (DataRow row in rows)
            {
                Row excelRow = CreateContentRow(reportResult, row, excelRowIndex++);
                sheetData.AppendChild(excelRow);
            }
        }
Example #31
0
        public async Task <IHttpActionResult> PostReportResult(ReportResult reportResult)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ReportResults.Add(reportResult);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (ReportResultExists(reportResult.ReportResultId))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = reportResult.ReportResultId }, reportResult));
        }
        public void ReportWrite(ReportResult reportResult)
        {
            var result = (ReportGeneralTrafficResult) reportResult;

            _dataGridView.DataSource = null;
            _dataGridView.Columns.Clear();
            _dataGridView.Columns.Add("generalTraffic", "General traffic");
            _dataGridView.Rows.Add(result.FilesSize);
        }
        public void ReportWrite(ReportResult reportResult)
        {
            var bindingSource = new BindingSource();
            var result = (ReportUniqueIpResult) reportResult;

            _dataGridView.Columns.Clear();
            _dataGridView.DataSource = bindingSource;
            bindingSource.DataSource = _converter.Convert(result.IpAddressCollection);
        }
 public void ReportWrite(ReportResult reportResult)
 {
     using (_writer)
     {
         var result = (ReportUniqueIpResult) reportResult;
         foreach (IpAddress ipAddress in result.IpAddressCollection)
             _writer.Write(_converter.Convert(ipAddress));
     }
 }
        public void ReportWrite(ReportResult reportResult)
        {
            var result = (ReportCodeStatisticsResult) reportResult;
            var bindingSource = new BindingSource();

            _dataGridView.Columns.Clear();
            _dataGridView.DataSource = bindingSource;
            bindingSource.DataSource = _converter.Convert(result.CodeCollection);
        }
 public void ReportWrite(ReportResult reportResult)
 {
     using (_writer)
     {
         var result = (ReportCodeStatisticsResult) reportResult;
         double count = result.CodeCollection.Sum(x => x.Probability);
         foreach (CodeStatistics codeStatistic in result.CodeCollection)
             _writer.Write(_converter.Convert(codeStatistic));
     }
 }
        /// <summary>
        /// Adds a new DiaryTitle
        /// </summary>
        public void AddDiaryTitle()
        {
            string ProcName = System.Configuration.ConfigurationManager.AppSettings["AddDiaryTitle"].ToString();
            string[] ProcParm = new string[] { Title };
            ReportResult result = new ReportResult();

            SessionDetails sd = SDKHelper.GetSessionDetails<SessionDetails>("User");
            result = sdk.RunCustomProc(sd, ProcName, ProcParm);

            if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.Failed)
            {
                throw new System.ApplicationException("Error ID:" + result.ResultInfo.Errors[0].ResultCodeID + ", Description:" + result.ResultInfo.Errors[0].Description);
            }
        }
        /// <summary>
        /// Add the log to the Database
        /// </summary>
        public void AddDiaryLog()
        {
            string ProcName = System.Configuration.ConfigurationManager.AppSettings["AddDiaryLog"].ToString();
            string covertedstring = String.Format("{0:yyyy/M/d HH:mm}", CreatedOn);
            string[] ProcParm = new string[] { DiaryAppointmentID.ToString(), covertedstring, CreatedBy.ToString(), Comments, DiaryLogTypeID.ToString() };
            ReportResult result = new ReportResult();

            SessionDetails sd = SDKHelper.GetSessionDetails<SessionDetails>("User");

            result = sdk.RunCustomProc(sd, ProcName, ProcParm);

            if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.Failed)
            {
                throw new System.ApplicationException("Error ID:" + result.ResultInfo.Errors[0].ResultCodeID + ", Description:" + result.ResultInfo.Errors[0].Description);
            }
        }
        /// <summary>
        /// Get all the Claim Statuses by LeadID from DB
        /// </summary>
        /// <param name="LeadID">LeadID</param>
        public void GetClaimStatuses(int LeadID)
        {
            string ProcName = System.Configuration.ConfigurationManager.AppSettings["GetClaimStatusesbyLeadID"].ToString();
            string[] ProcParm = new string[] {LeadID.ToString()} ;
            ReportResult result = new ReportResult();

            SessionDetails sd = SDKHelper.GetSessionDetails<SessionDetails>("User");
            result = sdk.RunCustomProc(sd, ProcName, ProcParm);

            if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.OK)
            {
                ToList(result.Data);
            }
            else if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.Failed)
            {
                throw new System.ApplicationException("Error ID:" + result.ResultInfo.Errors[0].ResultCodeID + ", Description:" + result.ResultInfo.Errors[0].Description);
            }
        }
        /// <summary>
        /// Link a new DiaryAppointment with a DiaryPriority
        /// </summary>
        public void AddPriorityLink()
        {
            string ProcName = System.Configuration.ConfigurationManager.AppSettings["AddPriorityLink"].ToString();
            string[] ProcParm = new string[] { DiaryPriorityID.ToString(), DiaryAppointmentID.ToString() };
            ReportResult result = new ReportResult();

            SessionDetails sd = SDKHelper.GetSessionDetails<SessionDetails>("User");
            result = sdk.RunCustomProc(sd, ProcName, ProcParm);

            if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.OK)
            {
                //ToObject(result.Data);
            }
            else if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.Failed)
            {
                throw new System.ApplicationException("Error ID:" + result.ResultInfo.Errors[0].ResultCodeID + ", Description:" + result.ResultInfo.Errors[0].Description);
            }
        }
        /// <summary>
        /// Gets allDiaryTexts
        /// </summary>
        public void GetAllDiaryTexts()
        {
            string ProcName = System.Configuration.ConfigurationManager.AppSettings["GetAllDiaryTexts"].ToString();
            string[] ProcParm = null;
            ReportResult result = new ReportResult();

            SessionDetails sd = SDKHelper.GetSessionDetails<SessionDetails>("User");
            result = sdk.RunCustomProc(sd, ProcName, ProcParm);

            if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.OK)
            {
                AllDiaryTexts = ToList(result.Data);
                AllDiaryTexts.Add(new DiaryText { DiaryTextID = 10000, Text = "Other" });
            }
            else if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.Failed)
            {
                throw new System.ApplicationException("Error ID:" + result.ResultInfo.Errors[0].ResultCodeID + ", Description:" + result.ResultInfo.Errors[0].Description);
            }
        }
        /// <summary>
        /// Add a new Priority
        /// </summary>
        public void AddDiaryPriority()
        {
            string ProcName = System.Configuration.ConfigurationManager.AppSettings["AddDiaryPriority"].ToString();
            string[] ProcParm = new string[] { DiaryPriorityName, DiaryPriorityColor };
            ReportResult result = new ReportResult();

            SessionDetails sd = SDKHelper.GetSessionDetails<SessionDetails>("User");
            result = sdk.RunCustomProc(sd, ProcName, ProcParm);

            if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.OK)
            {
                //ToObject(result.Data);
                MsgLabel = "Priority added Successfully!";
                IsError = false;
            }
            else if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.Failed)
            {
                MsgLabel = "Error ID:" + result.ResultInfo.Errors[0].ResultCodeID + ", Description:" + result.ResultInfo.Errors[0].Description;
                IsError = true;
            }
        }
        /// <summary>
        /// Get All Work TimeShifts
        /// </summary>
        /// <returns>List of TimeShifts</returns>
        public List<TimeShift> GetAllTimeshiftValues()
        {
            List<TimeShift> TempList = new List<TimeShift>();

            string ProcName = System.Configuration.ConfigurationManager.AppSettings["GetAllTimeshiftsSPName"].ToString();
            string[] ProcParm = null;
            ReportResult result = new ReportResult();
            CustomProcessingSoapClient Customsdk = new CustomProcessingSoapClient();

            AquariumCustomProcessing.SessionDetails sd = SDKHelper.GetSessionDetails<AquariumCustomProcessing.SessionDetails>("User");
            result = Customsdk.RunCustomProc(sd, ProcName, ProcParm);

            if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.OK)
            {
                TempList = ToList(result.Data);
            }
            else if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.Failed)
            {
                throw new System.ApplicationException("Error ID:" + result.ResultInfo.Errors[0].ResultCodeID + ", Description:" + result.ResultInfo.Errors[0].Description);
            }

            return TempList;
        }
        /// <summary>
        /// calls the stored proc to put this invoice into aquarium 
        /// </summary>
        /// <returns></returns>
        public bool ApplyInvoiceToAquarium()
        {
            try
            {

                //  bool result = false;
                //gets specified invoices -- everything in this case

                AquariumLogin login = new AquariumLogin();
                login.LoginToAquarium();

                LoggedOnUserResult theUserResult = login.GetLoggedOnUserResult();

                Datalayer.Xero.Interresolve.AquariumUserManagement.SessionDetails sessionDetails = new Datalayer.Xero.Interresolve.AquariumUserManagement.SessionDetails(); //set this from the logon
                //set the USER sesson
                sessionDetails.SessionKey = theUserResult.SessionKey;
                sessionDetails.Username = theUserResult.Username;
                sessionDetails.ThirdPartySystemId = 29;

                //map a custom session
                Datalayer.Xero.Interresolve.AquariumCustomProcessing.SessionDetails customSessionDetails = new Datalayer.Xero.Interresolve.AquariumCustomProcessing.SessionDetails();
                customSessionDetails.SessionKey = sessionDetails.SessionKey;
                customSessionDetails.ThirdPartySystemId = 29;
                customSessionDetails.Username = theUserResult.Username;

                CustomProcessingSoapClient customSdk = new CustomProcessingSoapClient();

                //now put this invoice's fields into the proc and push the proc to Aquarium
                string ProcName = System.Configuration.ConfigurationManager.AppSettings["_C74_Insert_Inbound_Invoice_Table_Record"].ToString();

                string[] ProcParm = new string[21];

                //map the elements of this invoice to the string array

                ProcParm[0] = this.LeadID.ToString();
                ProcParm[1] = this.MatterID.ToString();
                ProcParm[2] = this.LeadTypeID.ToString();
                ProcParm[3] = this.InvoiceDate.ToString();
                ProcParm[4] = this.InvoiceType.ToString();
                ProcParm[5] = this.ProvidersInvoiceNumber.ToString();

                ProcParm[6] = this.LineItem1Desc.ToString();
                ProcParm[7] = this.LineItem1Qty.ToString();
                ProcParm[8] = this.LineItem1Cost.ToString();

                ProcParm[9] = this.LineItem2Desc.ToString();
                ProcParm[10] = this.LineItem2Qty.ToString();
                ProcParm[11] = this.LineItem2Cost.ToString();

                ProcParm[12] = this.LineItem3Desc.ToString();
                ProcParm[13] = this.LineItem3Qty.ToString();
                ProcParm[14] = this.LineItem3Cost.ToString();

                ProcParm[15] = this.LineItem4Desc.ToString();
                ProcParm[16] = this.LineItem4Qty.ToString();
                ProcParm[17] = this.LineItem4Cost.ToString();

                ProcParm[18] = this.InvoiceVATAmount.ToString();
                ProcParm[19] = this.InvoiceSubtotal.ToString();
                ProcParm[20] = this.InvoiceTotalCost.ToString();

                //  DataTable InvoiceResults = new DataTable();
                //  InvoiceResults = InvoiceHelper.QueryInvoices(customSdk, customSessionDetails, InvoiceHelper.AquariumInvoiceTypeToQuery.OutboundInvoice);
                ReportResult result = new ReportResult();

                result = customSdk.RunCustomProc(customSessionDetails, ProcName, ProcParm);

                //has it worked?
                if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.OK)
                {

                    //it's worked
                }
                else
                {
                    //it ain't
                }

            }
            catch (Exception ex)
            { throw ex; }

            return true;
        }
 public void ReportWrite(ReportResult reportResult)
 {
     var result = (ReportGeneralTrafficResult) reportResult;
     _writer.Write(result.FilesSize);
 }
Example #46
0
        private void GenerateTable(ReportResult result, bool showTotal)
        {
            MainTable.Rows.Clear();

            ProcessChildItems(result.Items, "group_", 0, true);

            if (showTotal)
            {
                // Total row
                TableRow row = new TableRow();
                {
                    TableCell cell1 = new TableCell();
                    cell1.Text = LocRM.GetString("Total");
                    cell1.Font.Bold = true;
                    row.Cells.Add(cell1);

                    TableCell cell2 = new TableCell();
                    cell2.Text = result.Total.ToString("f");
                    cell2.Font.Bold = true;
                    cell2.HorizontalAlign = HorizontalAlign.Right;
                    cell2.Width = Unit.Pixel(100);
                    row.Cells.Add(cell2);
                }
                MainTable.Rows.Add(row);
            }
        }
        /// <summary>
        /// Get all Diary Priorities
        /// </summary>
        /// <returns>List of DiaryPriorities</returns>
        public List<DiaryPriority> GetAllDiaryPriorities()
        {
            string ProcName = System.Configuration.ConfigurationManager.AppSettings["GetAllDiaryPriorities"].ToString();
            string[] ProcParm = null;
            ReportResult result = new ReportResult();

            SessionDetails sd = SDKHelper.GetSessionDetails<SessionDetails>("User");
            result = sdk.RunCustomProc(sd, ProcName, ProcParm);

            if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.OK)
            {
                DiaryPrioritiesList = ToList(result.Data);
            }
            else if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.Failed)
            {
                throw new System.ApplicationException("Error ID:" + result.ResultInfo.Errors[0].ResultCodeID + ", Description:" + result.ResultInfo.Errors[0].Description);
            }

            return DiaryPrioritiesList;
        }
        /// <summary>
        /// Get DiaryTitle by DiaryTitleID
        /// </summary>
        /// <param name="ID">DiaryTitleID</param>
        public void GetDiaryTitlebyID(int ID)
        {
            List<DiaryTitle> TempList = new List<DiaryTitle>();
            string ProcName = System.Configuration.ConfigurationManager.AppSettings["GetDiaryTitlebyID"].ToString();
            string[] ProcParm = new string[] { ID.ToString() };
            ReportResult result = new ReportResult();

            SessionDetails sd = SDKHelper.GetSessionDetails<SessionDetails>("User");
            result = sdk.RunCustomProc(sd, ProcName, ProcParm);

            if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.OK)
            {
                TempList = ToList(result.Data);
                this.Title = TempList[0].Title;
                this.DiaryTitleID = TempList[0].DiaryTitleID;
            }
            else if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.Failed)
            {
                throw new System.ApplicationException("Error ID:" + result.ResultInfo.Errors[0].ResultCodeID + ", Description:" + result.ResultInfo.Errors[0].Description);
            }
        }
Example #49
0
        private void GenerateTable(ReportResult result)
        {
            MainTable.Rows.Clear();

            // Header
            TableHeaderRow row = new TableHeaderRow();
            {
                TableCell cell1 = new TableCell();
                cell1.Text = "&nbsp;";
                row.Cells.Add(cell1);

                TableCell cell2 = new TableCell();
                cell2.Text = LocRM.GetString("Approved");
                cell2.Width = Unit.Pixel(100);
                cell2.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cell2);

                TableCell cell3 = new TableCell();
                cell3.Text = LocRM.GetString("Registered");
                cell3.Width = Unit.Pixel(100);
                cell3.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cell3);

                TableCell cell4 = new TableCell();
                cell4.Text = LocRM.GetString("Cost");
                cell4.Width = Unit.Pixel(100);
                cell4.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cell4);

            }
            MainTable.Rows.Add(row);

            ProcessChildItems(result.Items, "group_", 0, true);
        }
Example #50
0
        /// <summary>
        /// Update Assigned To user for a case
        /// </summary>
        /// <param name="CustomerID">CustomerID</param>
        /// <param name="AssignedTo">ClientPersonnelID</param>
        public void SetCaseUser(int CustomerID, int AssignedTo)
        {
            string ProcName = System.Configuration.ConfigurationManager.AppSettings["UpdateCaseUser"].ToString();
            string[] ProcParm = new string[] { CustomerID.ToString(), AssignedTo.ToString() };
            ReportResult result = new ReportResult();

            CustomProcessingSoapClient sdk = new CustomProcessingSoapClient();

            AquariumCustomProcessing.SessionDetails sd = SDKHelper.GetSessionDetails<AquariumCustomProcessing.SessionDetails>("User");

            result = sdk.RunCustomProc(sd, ProcName, ProcParm);

            if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.Failed)
            {
                throw new System.ApplicationException("Error ID:" + result.ResultInfo.Errors[0].ResultCodeID + ", Description:" + result.ResultInfo.Errors[0].Description);
            }
        }