示例#1
0
        private void FillChart()
        {
            {
                Dictionary <string, int> medicineCount = bllMember.GetChartMostUsedMedicine(member);

                if (medicineCount.Count == 0)
                {
                    LabelControl labelControlNoMedicine = new LabelControl();
                    labelControlNoMedicine.Appearance.Font            = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    labelControlNoMedicine.Appearance.Options.UseFont = true;
                    labelControlNoMedicine.Location = new System.Drawing.Point(115, 121);
                    labelControlNoMedicine.Name     = "labelControlNoMedicine";
                    labelControlNoMedicine.Size     = new System.Drawing.Size(134, 18);
                    labelControlNoMedicine.TabIndex = 999;
                    labelControlNoMedicine.Text     = "İlaç bulunamadı...";
                    groupControl4.Controls.Add(labelControlNoMedicine);
                    chartControlMostUsedMedicine.Visible = false;
                }
                else
                {
                    chartControlMostUsedMedicine.Series["Series 1"].Points.Clear();
                    foreach (var item in medicineCount)
                    {
                        chartControlMostUsedMedicine.Series["Series 1"].Points.AddPoint(item.Key, item.Value);
                    }
                }
            }
            {
                Dictionary <string, int> hospitalCount = bllMember.GetChartMostVisitedHospital(member);

                if (hospitalCount.Count == 0)
                {
                    LabelControl labelControlNoMedicine = new LabelControl();
                    labelControlNoMedicine.Appearance.Font            = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    labelControlNoMedicine.Appearance.Options.UseFont = true;
                    labelControlNoMedicine.Location = new System.Drawing.Point(97, 121);
                    labelControlNoMedicine.Name     = "labelControlNoMedicine";
                    labelControlNoMedicine.Size     = new System.Drawing.Size(134, 18);
                    labelControlNoMedicine.TabIndex = 999;
                    labelControlNoMedicine.Text     = "Hastane bulunamadı...";
                    groupControl5.Controls.Add(labelControlNoMedicine);
                    chartControlMostVisitedHospital.Visible = false;
                }
                else
                {
                    chartControlMostVisitedHospital.Series["Series 1"].Points.Clear();
                    foreach (var item in hospitalCount)
                    {
                        chartControlMostVisitedHospital.Series["Series 1"].Points.AddPoint(item.Key, item.Value);
                    }
                }
            }
        }