Beispiel #1
0
        public void ActualInitialisation(Grid centralGrid, ComboBox weekComboBox)
        {
            _weekGrid      = centralGrid;
            _weekComboBox  = weekComboBox;
            _actionHandler = ActionHandler.GetInstance();
            _dbAccess      = DBAccess.GetInstance();

            _weekGrid.MouseLeave += _actionHandler.WeekGrid_MouseLeave;

            PrepareWeekComboBox(_weekComboBox, Period.Year);
            _crrntlChosenWeek = (byte)(_weekComboBox.SelectedIndex + 1);

            //Creating "Day" variables and theirs representation in GUI.
            string[] plan   = new string[QnttOfQrtsInWeek];
            string[] report = new string[QnttOfQrtsInWeek];
            TakeSelectedWeekDataFromDB(plan, report);
            for (byte i = 0; i < 7; i++)
            {
                StackPanel dayStackPanel = new StackPanel();
                _weekGrid.Children.Add(dayStackPanel);
                Grid.SetColumn(dayStackPanel, i);
                _days[i] = new Day(dayStackPanel, _daysNames[i], plan.Skip(i * 96).Take(96).ToArray(),
                                   report.Skip(i * 96).Take(96).ToArray(), i);
            }
        }
        public Quarter(StackPanel quarterArea, Activity plannedActivity, Activity realActivity, QuarterIdentifier identifier)
        {
            _quarterArea = quarterArea;

            _plnnActvtRctng       = new Rectangle();
            _realActvtRctng       = new Rectangle();
            _realActvtRctng.Width = 30;
            PlannedActivity       = plannedActivity;
            RealActivity          = realActivity;
            _quarterArea.Children.Add(_plnnActvtRctng);
            _quarterArea.Children.Add(_realActvtRctng);

            Identifier = identifier;

            _actionHandler = ActionHandler.GetInstance();


            SetStandardFrame();
            _plnnActvtRctng.MouseLeftButtonDown += _quarterRectangle_MouseLeftButtonDown;
            _plnnActvtRctng.MouseEnter          += _quarterRectangle_MouseEnter;
        }
Beispiel #3
0
        public MainWindow()
        {
            InitializeComponent();

            ActionHandler     actionHandler     = ActionHandler.GetInstance();
            ActivitiesManager activitiesManager = ActivitiesManager.GetInstance();

            _week     = Week.GetInstance();
            _dbAccess = DBAccess.GetInstance();

            activitiesManager.Start(ActivitiesPanel, actionHandler, _week);
            actionHandler.Start(activitiesManager);
            _week.ActualInitialisation(WeekGrid, WeekComboBox);

            StatsBtn.Click += actionHandler.StatsBtn_Click;
            WeekComboBox.SelectionChanged += actionHandler.WeekComboBox_SelectionChanged;
            PlanningRB.Checked            += actionHandler.PlanningRB_Checked;
            ReportingRB.Checked           += actionHandler.ReportingRB_Checked;
            AddActivityBtn.Click          += actionHandler.AddActivityBtn_Click;
            RemoveActivityBtn.Click       += actionHandler.RemoveActivityBtn_Click;
            MouseLeftButtonDown           += actionHandler.Window_MouseLeftButtonDown;
            MouseLeftButtonUp             += actionHandler.Window_MouseLeftButtonUp;
        }