Ejemplo n.º 1
0
        private void GiveMontInfo(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
            {
                DataGridViewTextBoxCell cell = (DataGridViewTextBoxCell)monthMonth.Rows[e.RowIndex].Cells[e.ColumnIndex];
                if (cell.Value != null)
                {
                    Console.WriteLine(CurrentYear + " " + cell.Value);
                    List <Kid>            kids    = mc.GetVisitByYearAndMonth("" + cell.Value, CurrentYear);
                    List <GenericVisitor> generic = mc.GetGenericVisitByYearAndMonth("" + cell.Value, CurrentYear);


                    textBox8.Text = "" + (kids.Count + generic.Count);
                    textBox7.Text = "" + kids.Count;

                    int jenterReg = GetGirlsFromVisit(kids);
                    int gutterReg = GetBoysFromVisits(kids);

                    int anonyme = GetAnonymFromGeneric(generic);
                    int ukjent  = GetUnknownFromGeneric(generic);
                    int jente   = GetGirlsFromGeneric(generic);
                    int gutt    = GetBoysFromGenericList(generic);

                    textBox6.Text = "" + gutterReg;
                    textBox5.Text = "" + jenterReg;

                    textBox4.Text = "" + gutt;
                    textBox3.Text = "" + jente;
                    textBox2.Text = "" + ukjent;
                    textBox1.Text = "" + anonyme;

                    CreateBoyGirlChart(jenterReg, gutterReg, monthChart1);
                    CreateGenericChart(anonyme, ukjent, jente, gutt, monthChart2);
                    CreateRegistredVSGenericChart(kids.Count, anonyme, ukjent, jente, gutt, monthChart3);
                }
            }
        }