コード例 #1
0
        public MultipleCategoriesCompare()
        {
            InitializeComponent();

            MonthData    = new Dictionary <string, Dictionary <DateTime, decimal> >();
            _dataContext = new AccountingDataContext();
            var generalCategoryHandler = new GeneralCategoryHandler(_dataContext);

            _monthService = new MonthService(_dataContext);
            CategoryNames = generalCategoryHandler.GetAllCategoryNames().ToList();
        }
コード例 #2
0
        /// <summary>
        ///     Sets up the infrastructure and connects the controls on the form
        ///     with the properties when the form loads
        /// </summary>
        /// <param name="sender">Standard sender object</param>
        /// <param name="e">Standard event arg object</param>
        private void DataChartUI_Load(object sender, EventArgs e)
        {
            // Sets the end date property to the date now
            EndDate = DateTime.Now;

            // The standard start date is a year before the end date
            StartDate = EndDate.Subtract(new TimeSpan(365, 0, 0, 0));

            // Sets the display of the date time pickers to the value of the corresponding property
            dtpStartMonth.Value = StartDate;
            dtpEndMonth.Value   = EndDate;

            // Gets the category names
            CategoryNames = _generalCategoryHandler.GetAllCategoryNames();

            // Sets the data bindings of the controls -excluding the chart
            SetupDataBindings();

            // Gets the data for the current range selected
            SetupDataSource();

            // Connects the data to the chart
            ShowDataOnChart();
        }