Example #1
0
        private void WriteReportLine(MaterialTrackingSummary materialTrackingSummary)
        {
            Grid          grid = new Grid();
            RowDefinition row  = new RowDefinition();

            grid.RowDefinitions.Add(row);

            ColumnDefinition columnDefinitionMA = new ColumnDefinition();

            columnDefinitionMA.Width = new GridLength(96 * 2, GridUnitType.Pixel);
            grid.ColumnDefinitions.Add(columnDefinitionMA);

            TextBlock textBlockMA = new TextBlock();

            textBlockMA.Text   = materialTrackingSummary.MasterAccessionNo;
            textBlockMA.Margin = new Thickness(2, 10, 2, 0);
            textBlockMA.HorizontalAlignment = HorizontalAlignment.Left;
            textBlockMA.TextAlignment       = TextAlignment.Right;
            Grid.SetColumn(textBlockMA, 0);
            Grid.SetRow(textBlockMA, 0);
            grid.Children.Add(textBlockMA);

            ColumnDefinition columnDefinitionCA = new ColumnDefinition();

            columnDefinitionCA.Width = new GridLength(96 * 2, GridUnitType.Pixel);
            grid.ColumnDefinitions.Add(columnDefinitionCA);

            TextBlock textBlockCA = new TextBlock();

            textBlockCA.Text   = materialTrackingSummary.ClientAccessionNo;
            textBlockCA.Margin = new Thickness(2, 10, 2, 0);
            textBlockCA.HorizontalAlignment = HorizontalAlignment.Left;
            textBlockCA.TextAlignment       = TextAlignment.Right;
            Grid.SetColumn(textBlockCA, 1);
            Grid.SetRow(textBlockCA, 0);
            grid.Children.Add(textBlockCA);

            int column = 2;

            foreach (MaterialTrackingSummaryColumn materialTrackingSummaryColumn in materialTrackingSummary.ColumnList)
            {
                ColumnDefinition columnDefinition = new ColumnDefinition();
                columnDefinition.Width = new GridLength(96 * 1, GridUnitType.Pixel);
                grid.ColumnDefinitions.Add(columnDefinition);

                TextBlock textBlock = new TextBlock();
                textBlock.Text   = materialTrackingSummaryColumn.Value.ToString();
                textBlock.Margin = new Thickness(2, 10, 2, 0);
                textBlock.HorizontalAlignment = HorizontalAlignment.Left;
                textBlock.TextAlignment       = TextAlignment.Right;
                Grid.SetColumn(textBlock, column);
                Grid.SetRow(textBlock, 0);
                grid.Children.Add(textBlock);
                column += 1;
            }

            this.m_ReportDocument.WriteRowContent(grid);
        }
Example #2
0
        private void WriteTotalLine(MaterialTrackingSummary materialTrackingSummaryTotal)
        {
            Grid          grid = new Grid();
            RowDefinition row  = new RowDefinition();

            grid.RowDefinitions.Add(row);

            ColumnDefinition column1 = new ColumnDefinition();

            column1.Width = new GridLength(96 * 2, GridUnitType.Pixel);
            grid.ColumnDefinitions.Add(column1);

            TextBlock text1 = new TextBlock();

            text1.Text   = "Total";
            text1.Margin = new Thickness(2, 10, 2, 0);
            text1.HorizontalAlignment = HorizontalAlignment.Left;
            Grid.SetColumn(text1, 0);
            Grid.SetRow(text1, 0);
            grid.Children.Add(text1);

            ColumnDefinition column2 = new ColumnDefinition();

            column2.Width = new GridLength(96 * 2, GridUnitType.Pixel);
            grid.ColumnDefinitions.Add(column2);

            int column = 2;

            foreach (MaterialTrackingSummaryColumn materialTrackingSummaryColumn in materialTrackingSummaryTotal.ColumnList)
            {
                ColumnDefinition columnDefinition = new ColumnDefinition();
                columnDefinition.Width = new GridLength(96 * 1, GridUnitType.Pixel);
                grid.ColumnDefinitions.Add(columnDefinition);

                TextBlock textBlock = new TextBlock();
                textBlock.Text   = materialTrackingSummaryColumn.Value.ToString();
                textBlock.Margin = new Thickness(2, 10, 2, 0);
                textBlock.HorizontalAlignment = HorizontalAlignment.Left;
                textBlock.TextAlignment       = TextAlignment.Right;
                Grid.SetColumn(textBlock, column);
                Grid.SetRow(textBlock, 0);
                grid.Children.Add(textBlock);
                column += 1;
            }

            this.m_ReportDocument.WriteRowContent(grid);
        }
        public MaterialTrackingBatchSummary(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch,
			YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection materialTrackingLogViewCollection)
        {
            this.m_MaterialTrackingBatch = materialTrackingBatch;
            this.m_MaterialTrackingLogViewCollection = materialTrackingLogViewCollection;

            YellowstonePathology.Document.Xps.PlainHeader header = new YellowstonePathology.Document.Xps.PlainHeader("Yellowstone Pathology Institute - Material Distribution Report");
            YellowstonePathology.Document.Xps.NoFooter footer = new YellowstonePathology.Document.Xps.NoFooter();

            this.m_ReportDocument = new YellowstonePathology.Document.Xps.ReportDocument(header, footer);

            int totalMaterialCount = 0;

            MaterialTrackingSummaryCollection materialTrackingSummaryCollection = new MaterialTrackingSummaryCollection();

            List<string> materialTypeList = this.m_MaterialTrackingLogViewCollection.GetDistinctMaterialTypes();
            List<string> masterAccessionNoList = this.m_MaterialTrackingLogViewCollection.GetMasterAccessionNoList();

            foreach (string masterAccessionNo in masterAccessionNoList)
            {
                MaterialTrackingSummary materialTrackingSummary = new MaterialTrackingSummary(masterAccessionNo, false);

                foreach (string materialType in materialTypeList)
                {
                    int materialCount = this.m_MaterialTrackingLogViewCollection.GetMaterialCount(masterAccessionNo, materialType);
                    MaterialTrackingSummaryColumn materialTrackingSummaryColumn = new MaterialTrackingSummaryColumn(materialType, materialCount);
                    materialTrackingSummary.ColumnList.Add(materialTrackingSummaryColumn);
                    totalMaterialCount += materialCount;
                }
                materialTrackingSummaryCollection.Add(materialTrackingSummary);
            }

            this.WriteHeadingsGrid(materialTypeList);
            foreach (MaterialTrackingSummary materialTrackingSummary in materialTrackingSummaryCollection)
            {
                this.WriteReportLine(materialTrackingSummary);
            }

            if (materialTrackingSummaryCollection.Count > 0)
            {
                materialTrackingSummaryCollection.SetTotals();
                this.WriteTotalLine(materialTrackingSummaryCollection[materialTrackingSummaryCollection.Count - 1]);
            }
        }
        public MaterialTrackingBatchSummary(YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch,
                                            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogViewCollection materialTrackingLogViewCollection)
        {
            this.m_MaterialTrackingBatch             = materialTrackingBatch;
            this.m_MaterialTrackingLogViewCollection = materialTrackingLogViewCollection;

            YellowstonePathology.Document.Xps.PlainHeader header = new YellowstonePathology.Document.Xps.PlainHeader("Yellowstone Pathology Institute - Material Distribution Report");
            YellowstonePathology.Document.Xps.NoFooter    footer = new YellowstonePathology.Document.Xps.NoFooter();

            this.m_ReportDocument = new YellowstonePathology.Document.Xps.ReportDocument(header, footer);

            int totalMaterialCount = 0;

            MaterialTrackingSummaryCollection materialTrackingSummaryCollection = new MaterialTrackingSummaryCollection();

            List <string> materialTypeList      = this.m_MaterialTrackingLogViewCollection.GetDistinctMaterialTypes();
            List <string> masterAccessionNoList = this.m_MaterialTrackingLogViewCollection.GetMasterAccessionNoList();

            foreach (string masterAccessionNo in masterAccessionNoList)
            {
                MaterialTrackingSummary materialTrackingSummary = new MaterialTrackingSummary(masterAccessionNo, false);

                foreach (string materialType in materialTypeList)
                {
                    int materialCount = this.m_MaterialTrackingLogViewCollection.GetMaterialCount(masterAccessionNo, materialType);
                    MaterialTrackingSummaryColumn materialTrackingSummaryColumn = new MaterialTrackingSummaryColumn(materialType, materialCount);
                    materialTrackingSummary.ColumnList.Add(materialTrackingSummaryColumn);
                    totalMaterialCount += materialCount;
                }
                materialTrackingSummaryCollection.Add(materialTrackingSummary);
            }

            this.WriteHeadingsGrid(materialTypeList);
            foreach (MaterialTrackingSummary materialTrackingSummary in materialTrackingSummaryCollection)
            {
                this.WriteReportLine(materialTrackingSummary);
            }

            if (materialTrackingSummaryCollection.Count > 0)
            {
                materialTrackingSummaryCollection.SetTotals();
                this.WriteTotalLine(materialTrackingSummaryCollection[materialTrackingSummaryCollection.Count - 1]);
            }
        }
        private void WriteTotalLine(MaterialTrackingSummary materialTrackingSummaryTotal)
        {
            Grid grid = new Grid();
            RowDefinition row = new RowDefinition();
            grid.RowDefinitions.Add(row);

            ColumnDefinition column1 = new ColumnDefinition();
            column1.Width = new GridLength(96 * 2, GridUnitType.Pixel);
            grid.ColumnDefinitions.Add(column1);

            TextBlock text1 = new TextBlock();
            text1.Text = "Total";
            text1.Margin = new Thickness(2, 10, 2, 0);
            text1.HorizontalAlignment = HorizontalAlignment.Left;
            Grid.SetColumn(text1, 0);
            Grid.SetRow(text1, 0);
            grid.Children.Add(text1);

            int column = 1;
            foreach (MaterialTrackingSummaryColumn materialTrackingSummaryColumn in materialTrackingSummaryTotal.ColumnList)
            {
                ColumnDefinition columnDefinition = new ColumnDefinition();
                columnDefinition.Width = new GridLength(96 * 1, GridUnitType.Pixel);
                grid.ColumnDefinitions.Add(columnDefinition);

                TextBlock textBlock = new TextBlock();
                textBlock.Text = materialTrackingSummaryColumn.Value.ToString();
                textBlock.Margin = new Thickness(2, 10, 2, 0);
                textBlock.HorizontalAlignment = HorizontalAlignment.Left;
                textBlock.TextAlignment = TextAlignment.Right;
                Grid.SetColumn(textBlock, column);
                Grid.SetRow(textBlock, 0);
                grid.Children.Add(textBlock);
                column += 1;
            }

            this.m_ReportDocument.WriteRowContent(grid);
        }