private void LoadDuLieuBaoCao()
        {
            this.dataResult = new BioNetModel.rptBaoCaoTongHop();
            this.dataResult = BioNetBLL.BioNet_Bus.GetBaoCaoTongHopTrungTam(dllNgay.tungay.Value, dllNgay.denngay.Value);
            List <ObjectChartReport> lstGioiTinh = new List <ObjectChartReport>();
            List <ObjectChartReport> lstGoiBenh  = new List <ObjectChartReport>();
            List <ObjectChartReport> lstPPS      = new List <ObjectChartReport>();

            if (this.dataResult != null)
            {
                this.txtTongPhieu.Text = this.dataResult.SoLuongMau.ToString();
                this.txtThuLai.Text    = this.dataResult.goiBenh.slThuLai.ToString();
                this.txtThuMoi.Text    = (this.dataResult.SoLuongMau - this.dataResult.goiBenh.slThuLai).ToString();
                ObjectChartReport doituong = new ObjectChartReport {
                    Name = "Nam", Values = this.dataResult.gioiTinh.GTNam
                };
                lstGioiTinh.Add(doituong);
                doituong = new ObjectChartReport {
                    Name = "Nữ", Values = this.dataResult.gioiTinh.GTNu
                };
                lstGioiTinh.Add(doituong);
                doituong = new ObjectChartReport {
                    Name = "N/a", Values = this.dataResult.gioiTinh.GTNa
                };
                lstGioiTinh.Add(doituong);
                this.ChartGioiTinh.DataSource = lstGioiTinh;



                ObjectChartReport goiXN = new ObjectChartReport {
                    Name = "2Bệnh", Values = this.dataResult.goiBenh.sl2Benh
                };
                lstGoiBenh.Add(goiXN);
                goiXN = new ObjectChartReport {
                    Name = "3Bệnh", Values = this.dataResult.goiBenh.sl3Benh
                };
                lstGoiBenh.Add(goiXN);
                goiXN = new ObjectChartReport {
                    Name = "5Bệnh", Values = this.dataResult.goiBenh.sl5Benh
                };
                lstGoiBenh.Add(goiXN);
                goiXN = new ObjectChartReport {
                    Name = "Thu lại", Values = this.dataResult.goiBenh.slThuLai
                };
                lstGoiBenh.Add(goiXN);
                this.ChartGoiXN.DataSource = lstGoiBenh;

                ObjectChartReport PPS = new ObjectChartReport {
                    Name = "Sinh thường", Values = this.dataResult.phuongPhapSinh.SinhThuong
                };
                lstPPS.Add(PPS);
                PPS = new ObjectChartReport {
                    Name = "Sinh mổ", Values = this.dataResult.phuongPhapSinh.SinhMo
                };
                lstPPS.Add(PPS);
                PPS = new ObjectChartReport {
                    Name = "N/a", Values = this.dataResult.phuongPhapSinh.SinhNa
                };
                lstPPS.Add(PPS);

                this.ChartPPSinh.DataSource = lstPPS;
                this.ChartKQ.Series.Clear();

                Series NguyCoCao  = new Series("Nguy cơ cao", ViewType.SideBySideStackedBar);
                Series NguyCoThap = new Series("Nguy cơ thấp", ViewType.SideBySideStackedBar);
                Series TongSl     = new Series("Số lượng", ViewType.Area);
                //NguyCoCao.View.Color = Color.Crimson;
                //NguyCoThap.View.Color = Color.DeepSkyBlue;
                NguyCoThap.Label.TextPattern = "{V:#,#} ({V:0.00%})";
                NguyCoCao.Label.TextPattern  = "{V:#,#} ({V:0.00%})";
                this.ChartKQ.Series.Clear();
                // Add points to them
                //   TongSl.Points.Add(new SeriesPoint("G6PD", this.dataResult.g6PD.G6PDTong));
                //   TongSl.Points.Add(new SeriesPoint("CH", this.dataResult.cH.CHTong));
                //   TongSl.Points.Add(new SeriesPoint("CAH", this.dataResult.cAH.CAHTong));
                //   TongSl.Points.Add(new SeriesPoint("PKU", this.dataResult.pKU.PKUTong));
                //   TongSl.Points.Add(new SeriesPoint("GAL", this.dataResult.gAL.GALTong));

                NguyCoCao.Points.Add(new SeriesPoint("G6PD", this.dataResult.g6PD.G6PDNguyCo));
                NguyCoCao.Points.Add(new SeriesPoint("CH", this.dataResult.cH.CHNguyCo));
                NguyCoCao.Points.Add(new SeriesPoint("CAH", this.dataResult.cAH.CAHNguyCo));
                NguyCoCao.Points.Add(new SeriesPoint("PKU", this.dataResult.pKU.PKUNguyCo));
                NguyCoCao.Points.Add(new SeriesPoint("GAL", this.dataResult.gAL.GALNguyCo));

                NguyCoThap.Points.Add(new SeriesPoint("G6PD", this.dataResult.g6PD.G6PDBinhThuong));
                NguyCoThap.Points.Add(new SeriesPoint("CH", this.dataResult.cH.CHBinhThuong));
                NguyCoThap.Points.Add(new SeriesPoint("CAH", this.dataResult.cAH.CAHBinhThuong));
                NguyCoThap.Points.Add(new SeriesPoint("PKU", this.dataResult.pKU.PKUBinhThuong));
                NguyCoThap.Points.Add(new SeriesPoint("GAL", this.dataResult.gAL.GALBinhThuong));
                Series NguyCoCao_Test  = new Series("Nguy cơ cao", ViewType.Line);
                Series NguyCoThap_Test = new Series("Nguy cơ thấp", ViewType.SideBySideStackedBar);
                //NguyCoCao.View.Color = Color.Crimson;
                //NguyCoThap.View.Color = Color.DeepSkyBlue;
                NguyCoThap.Label.TextPattern = "{VP:#,#} mẫu";//"{V:#,#} ({V:0.00%})";
                NguyCoCao.LabelsVisibility   = DevExpress.Utils.DefaultBoolean.True;
                NguyCoThap.LabelsVisibility  = DevExpress.Utils.DefaultBoolean.True;
                NguyCoCao.Label.TextPattern  = "{VP:#,#} mẫu";//"{V:#,#} ({V:0.00%})";
                // TongSl.Label.TextPattern = "{VP:#,#}";
                this.ChartKQ.Series.Clear();
                // Add points to them

                this.ChartKQ.Series.Add(NguyCoThap);
                this.ChartKQ.Series.Add(NguyCoCao);
                //   this.ChartKQ.Series.Add(TongSl);
                //this.chartKQ2.Series.Add(NguyCoThap);
                //this.chartKQ2.Series.Add(NguyCoCao);
                // Add all series to the chart.
                //ChartKQ.Series.AddRange
                //    (new Series[] { NguyCoThap, NguyCoCao });
            }
        }
Exemplo n.º 2
0
        private void rptBaocaoTrungTamSoBo_ParametersRequestBeforeShow(object sender, DevExpress.XtraReports.Parameters.ParametersRequestEventArgs e)
        {
            this.lst = this.DataSource as List <BioNetModel.rptBaoCaoTongHop>;
            this.lst = this.DataSource as List <BioNetModel.rptBaoCaoTongHop>;
            if (this.lst.Count > 0)
            {
                List <ObjectChartReport>     lstGioiTinh = new List <ObjectChartReport>();
                BioNetModel.rptBaoCaoTongHop data        = this.lst[0];
                ObjectChartReport            doituong    = new ObjectChartReport {
                    Name = "Nam", Values = this.lst[0].gioiTinh.GTNam
                };
                lstGioiTinh.Add(doituong);
                doituong = new ObjectChartReport {
                    Name = "Nữ", Values = this.lst[0].gioiTinh.GTNu
                };
                lstGioiTinh.Add(doituong);
                doituong = new ObjectChartReport {
                    Name = "N/a", Values = this.lst[0].gioiTinh.GTNa
                };
                lstGioiTinh.Add(doituong);
                this.ChartGioiTinh.DataSource = lstGioiTinh;
                Series seriesGioiTinh = new Series("Chart Gioi Tinh", ViewType.Pie);
                seriesGioiTinh.ArgumentDataMember = "Name";
                //series1.LegendText = "Name";
                seriesGioiTinh.ValueDataMembers.AddRange(new string[] { "Values" });
                ChartGioiTinh.Series.Add(seriesGioiTinh);
                seriesGioiTinh.Label.TextPattern = "{A}: {VP:p0}";

                List <ObjectChartReport> lstGoiBenh = new List <ObjectChartReport>();
                ObjectChartReport        goiXN      = new ObjectChartReport {
                    Name = "2Bệnh", Values = this.lst[0].goiBenh.sl2Benh
                };
                lstGoiBenh.Add(goiXN);
                goiXN = new ObjectChartReport {
                    Name = "3Bệnh", Values = this.lst[0].goiBenh.sl3Benh
                };
                lstGoiBenh.Add(goiXN);
                goiXN = new ObjectChartReport {
                    Name = "5Bệnh", Values = this.lst[0].goiBenh.sl5Benh
                };
                lstGoiBenh.Add(goiXN);
                this.ChartGoiXN.DataSource = lstGoiBenh;
                Series seriesGoiXN = new Series("Chart Gói Xét Nghiệm", ViewType.Doughnut);
                seriesGoiXN.ArgumentDataMember = "Name";
                //series1.LegendText = "Name";
                seriesGoiXN.ValueDataMembers.AddRange(new string[] { "Values" });
                ChartGoiXN.Series.Add(seriesGoiXN);
                seriesGoiXN.Label.TextPattern = "{A}: {VP:p0}";

                List <ObjectChartReport> lstPPS = new List <ObjectChartReport>();
                ObjectChartReport        PPS    = new ObjectChartReport {
                    Name = "Sinh thường", Values = this.lst[0].phuongPhapSinh.SinhThuong
                };
                lstPPS.Add(PPS);
                PPS = new ObjectChartReport {
                    Name = "Sinh mổ", Values = this.lst[0].phuongPhapSinh.SinhMo
                };
                lstPPS.Add(PPS);
                PPS = new ObjectChartReport {
                    Name = "N/a", Values = this.lst[0].phuongPhapSinh.SinhNa
                };
                lstPPS.Add(PPS);
                this.ChartPPSinh.DataSource = lstPPS;
                Series seriesPPS = new Series("Chart Phương pháp sinh", ViewType.Doughnut);
                seriesPPS.ArgumentDataMember = "Name";
                //series1.LegendText = "Name";
                seriesPPS.ValueDataMembers.AddRange(new string[] { "Values" });
                ChartPPSinh.Series.Add(seriesPPS);
                seriesPPS.Label.TextPattern = "{A}: {VP:p0}";

                Series NguyCoCao  = new Series("Nguy cơ cao", ViewType.SideBySideFullStackedBar);
                Series NguyCoThap = new Series("Nguy cơ thấp", ViewType.SideBySideFullStackedBar);
                //NguyCoCao.View.Color = Color.RosyBrown;
                //NguyCoThap.View.Color = Color.CadetBlue;
                NguyCoThap.Label.TextPattern = "{ VP: p0}";
                NguyCoCao.Label.TextPattern  = "{ VP: p0}";
                this.ChartKQ.Series.Clear();
                // Add points to them
                NguyCoCao.Points.Add(new SeriesPoint("G6PD", this.lst[0].g6PD.G6PDNguyCo));
                NguyCoCao.Points.Add(new SeriesPoint("CH", this.lst[0].cH.CHNguyCo));
                NguyCoCao.Points.Add(new SeriesPoint("CAH", this.lst[0].cAH.CAHNguyCo));
                NguyCoCao.Points.Add(new SeriesPoint("PKU", this.lst[0].pKU.PKUNguyCo));
                NguyCoCao.Points.Add(new SeriesPoint("GAL", this.lst[0].gAL.GALNguyCo));

                NguyCoThap.Points.Add(new SeriesPoint("G6PD", this.lst[0].g6PD.G6PDBinhThuong));
                NguyCoThap.Points.Add(new SeriesPoint("CH", this.lst[0].cH.CHBinhThuong));
                NguyCoThap.Points.Add(new SeriesPoint("CAH", this.lst[0].cAH.CAHBinhThuong));
                NguyCoThap.Points.Add(new SeriesPoint("PKU", this.lst[0].pKU.PKUBinhThuong));
                NguyCoThap.Points.Add(new SeriesPoint("GAL", this.lst[0].gAL.GALBinhThuong));


                // Add all series to the chart.
                ChartKQ.Series.AddRange
                    (new Series[] { NguyCoCao, NguyCoThap });
            }
        }