コード例 #1
0
        public void InterventionStatisticMapperAdultWATestCount()
        {
            Statistic.setOperationID("operation4");
            InterventionStatisticMapper ism = new InterventionStatisticMapper();
            List <String> complaints        = new List <String>();

            complaints = ism.getListComplaint();
            String firstComplaint = complaints[0];

            ism.getInterventionAdultWithoutAmublanceCount(firstComplaint);
            List <int> interventionAdultList = new List <int>();

            interventionAdultList = ism.getInterventionAdultWithoutAmublanceList();
            Assert.AreEqual(interventionAdultList.Count, ism.getInterventionAdultWithoutAmublanceList().Count);
            ism.clearInterventionAdultWACountList();
            Assert.AreEqual(0, ism.getInterventionAdultWithoutAmublanceList().Count);

            ism.getInterventionAdultWithoutAmublanceCount("TESTING_NULL");
            interventionAdultList = ism.getInterventionAdultWithoutAmublanceList();
            Assert.AreEqual(0, interventionAdultList[0]);
        }
コード例 #2
0
        private void GenerateInterventionWithoutAmbulance(int row, String complaint)
        {
            //generating table for Children without ambulance services
            ism.getInterventionChildrenWithoutAmublanceCount(complaint);

            foreach (int count in ism.getInterventionChildrenWithoutAmublanceList())
            {
                Border border = new Border();
                border.BorderThickness = new Thickness(0, 0, 1, 1);
                border.BorderBrush     = new SolidColorBrush(Colors.Black);
                TextBlock tb = new TextBlock();
                tb.FontWeight          = FontWeights.Black;
                tb.Height              = 40;
                tb.FontSize            = 12;
                tb.Margin              = new Thickness(3, 0, 0, 0);
                tb.VerticalAlignment   = VerticalAlignment.Center;
                tb.HorizontalAlignment = HorizontalAlignment.Center;
                tb.Text = count.ToString();
                countWithoutAmbulance  += int.Parse(tb.Text.ToString());
                totalChildrenHoriCount += int.Parse(tb.Text.ToString());
                border.Child            = tb;
                ComplaintGrid.Children.Add(border);
                Grid.SetColumn(border, 1);
                Grid.SetRow(border, row);
            }
            ism.clearInterventionChildrenWACountList();

            //generating table for Adult without ambulance services
            ism.getInterventionAdultWithoutAmublanceCount(complaint);

            foreach (int count in ism.getInterventionAdultWithoutAmublanceList())
            {
                Border border = new Border();
                border.BorderThickness = new Thickness(0, 0, 1, 1);
                border.BorderBrush     = new SolidColorBrush(Colors.Black);
                TextBlock tb = new TextBlock();
                tb.FontWeight          = FontWeights.Black;
                tb.Height              = 40;
                tb.FontSize            = 12;
                tb.Margin              = new Thickness(3, 0, 0, 0);
                tb.VerticalAlignment   = VerticalAlignment.Center;
                tb.HorizontalAlignment = HorizontalAlignment.Center;
                tb.Text = count.ToString();
                countWithoutAmbulance += int.Parse(tb.Text.ToString());
                totalAdultHoriCount   += int.Parse(tb.Text.ToString());
                border.Child           = tb;
                ComplaintGrid.Children.Add(border);
                Grid.SetColumn(border, 2);
                Grid.SetRow(border, row);
            }
            ism.clearInterventionAdultWACountList();


            //generating total table for without amublance services
            Border totalBorder = new Border();

            totalBorder.BorderThickness = new Thickness(0, 0, 1, 1);
            totalBorder.BorderBrush     = new SolidColorBrush(Colors.Black);
            TextBlock totalTb = new TextBlock();

            totalTb.FontWeight          = FontWeights.Black;
            totalTb.Height              = 40;
            totalTb.FontSize            = 12;
            totalTb.Margin              = new Thickness(3, 0, 0, 0);
            totalTb.VerticalAlignment   = VerticalAlignment.Center;
            totalTb.HorizontalAlignment = HorizontalAlignment.Center;
            totalTb.Text      = countWithoutAmbulance.ToString();
            totalBorder.Child = totalTb;
            ComplaintGrid.Children.Add(totalBorder);
            Grid.SetColumn(totalBorder, 3);
            Grid.SetRow(totalBorder, row);
        }