Пример #1
0
        private void Button0_Click(object sender, RoutedEventArgs e)
        {
            int index           = int.Parse(((Button)e.Source).Uid);
            int selcetedEntries = Convert.ToInt16(GridCursorDays.GetValue(Grid.ColumnProperty));

            switch (index)
            {
            case 0:
                if (Convert.ToInt16(GridCursorType.GetValue(Grid.ColumnProperty)) == index)
                {
                    return;
                }
                GridCursorType.SetValue(Grid.ColumnProperty, index);
                if (selcetedEntries == 2)
                {
                    CreateWeightGraph(7);
                }
                if (selcetedEntries == 3)
                {
                    CreateWeightGraph(14);
                }
                if (selcetedEntries == 4)
                {
                    CreateWeightGraph(30);
                }
                break;

            case 1:
                if (Convert.ToInt16(GridCursorType.GetValue(Grid.ColumnProperty)) == index)
                {
                    return;
                }
                GridCursorType.SetValue(Grid.ColumnProperty, index);
                if (selcetedEntries == 2)
                {
                    CreateCaloriesGraph(7);
                }
                if (selcetedEntries == 3)
                {
                    CreateCaloriesGraph(14);
                }
                if (selcetedEntries == 4)
                {
                    CreateCaloriesGraph(30);
                }
                break;
            }
        }
Пример #2
0
        private void Button4_Click(object sender, RoutedEventArgs e)
        {
            int numberOfEntries = int.Parse(((Button)e.Source).Uid);

            switch (numberOfEntries)
            {
            case 7:
                if (Convert.ToInt16(GridCursorDays.GetValue(Grid.ColumnProperty)) == 2)
                {
                    return;
                }
                GridCursorDays.SetValue(Grid.ColumnProperty, 2);
                break;

            case 14:
                if (Convert.ToInt16(GridCursorDays.GetValue(Grid.ColumnProperty)) == 3)
                {
                    return;
                }
                GridCursorDays.SetValue(Grid.ColumnProperty, 3);
                break;

            case 30:
                if (Convert.ToInt16(GridCursorDays.GetValue(Grid.ColumnProperty)) == 4)
                {
                    return;
                }
                GridCursorDays.SetValue(Grid.ColumnProperty, 4);
                break;
            }

            //Rausfinden ob Kalorien oder Gewicht ausgewählt ist
            if (Convert.ToInt16(GridCursorType.GetValue(Grid.ColumnProperty)) == 1)
            {
                CreateCaloriesGraph(numberOfEntries);
            }
            else
            {
                CreateWeightGraph(numberOfEntries);
            }
        }