Пример #1
0
        /// <summary>
        /// Displays the sent in session banks in a new UI
        /// </summary>
        /// <param name="banks"></param>
        public void DisplaySessionBanks(List <BasicBankInfo> banks)
        {
            NavigateToArgs args = new NavigateToArgs();

            args.Argument = banks;
            Parent.NavigateTo(SessionSummaryView.SessionBankBreakdown, args);
        }
Пример #2
0
        /// <summary>
        /// Calculate the actual cash received.
        /// </summary>
        /// <param name="m_editSummary"></param>
        public void CalculateActualCash(Summary summary)
        {
            NavigateToArgs args = new NavigateToArgs();

            args.Argument = summary;
            Parent.NavigateTo(SessionSummaryView.ActualCashCalculator, args);
        }
Пример #3
0
        /// <summary>
        /// Navigates to the SelectSessionCosts UI
        /// </summary>
        public void SelectSessionCosts(Summary summary)
        {
            NavigateToArgs args = new NavigateToArgs();

            args.Argument = summary;
            Parent.NavigateTo(SessionSummaryView.SelectSessionCosts, args);
        }
Пример #4
0
        /// <summary>
        /// Causes a session summary report to be generated and displayed
        /// </summary>
        /// <param name="date">The date of the session for the report.</param>
        /// <param name="session">The session number of the session for the report.</param>
        public void GenerateReport(DateTime date, short session)
        {
            NavigateToArgs args = new NavigateToArgs();
            ArrayList      list = new ArrayList();

            list.Add(date);
            list.Add(session);
            args.Argument = list;
            Parent.NavigateTo(SessionSummaryView.Report, args);
        }
Пример #5
0
        /// <summary>
        /// Displays the specified view.
        /// </summary>
        /// <param name="view">The view to display.</param>
        /// <exception cref="System.ArgumentException">view is
        /// invalid.</exception>
        public void NavigateTo(SessionSummaryView view, NavigateToArgs e)
        {
            switch (view)
            {
            case SessionSummaryView.About:
                AboutWindow aboutWin = new AboutWindow(Settings.UseAcceleration, Resources.SessionSummaryName,
                                                       EliteModule.GetVersion(Assembly.GetExecutingAssembly()),
                                                       EliteModule.GetCopyright(Assembly.GetExecutingAssembly()),
                                                       Resources.ModuleDescription);
                aboutWin.Owner = MainWindow;
                CurrentView    = aboutWin;
                aboutWin.ShowDialog();

                CurrentView = MainWindow;
                break;

            case SessionSummaryView.SessionCosts:
            {
                SessionCostsWindow sessionCostWin = new SessionCostsWindow(Settings.UseAcceleration);
                sessionCostWin.Owner       = MainWindow;
                sessionCostWin.DataContext = new SessionCostsViewModel(SessionCostsController);
                CurrentView = sessionCostWin;
                sessionCostWin.ShowDialog();

                ((IDisposable)sessionCostWin.DataContext).Dispose();
                CurrentView = MainWindow;
            }
            break;

            case SessionSummaryView.SelectSessionCosts:
            {
                SelectSessionCostsWindow sessionCostWin = new SelectSessionCostsWindow(Settings.UseAcceleration);
                sessionCostWin.Owner       = MainWindow;
                sessionCostWin.DataContext = new SelectSessionCostsViewModel(SessionCostsController, (Summary)e.Argument);
                CurrentView = sessionCostWin;
                sessionCostWin.ShowDialog();

                ((IDisposable)sessionCostWin.DataContext).Dispose();
                CurrentView = MainWindow;
            }
            break;

            case SessionSummaryView.Report:
            {
                if (m_reportWindow == null)
                {
                    m_reportWindow         = new SessionSummaryReportWindow();
                    m_reportWindow.Owner   = MainWindow;
                    m_reportWindow.Closed += ReportWindowClosed;
                    m_reportWindow.Show();
                }
                m_reportWindow.Focus();

                ArrayList args    = (ArrayList)e.Argument;
                DateTime  date    = (DateTime)args[0];
                short     session = (short)args[1];

                RefreshSessionSummaryReport(date, session);
                m_reportWindow.DisplayReport(SessionSummaryReport);
            }
            break;

            case SessionSummaryView.ActualCashCalculator:
            {
                var calcWin = new ActualCashCalculatorWindow(Settings.UseAcceleration);
                calcWin.Owner       = MainWindow;
                calcWin.DataContext = new ActualCashCalculatorViewModel(this, (Summary)e.Argument);
                CurrentView         = calcWin;
                calcWin.ShowDialog();

                var disposable = calcWin.DataContext as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }

                CurrentView = MainWindow;
            }
            break;

            case SessionSummaryView.SessionBankBreakdown:
            {
                var calcWin = new SessionBanksWindow(Settings.UseAcceleration);
                calcWin.Owner       = MainWindow;
                calcWin.DataContext = new SessionBanksViewModel(this, (List <BasicBankInfo>)e.Argument);
                CurrentView         = calcWin;
                calcWin.ShowDialog();

                var disposable = calcWin.DataContext as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }

                CurrentView = MainWindow;
            }
            break;

            default:
                throw new ArgumentException();
            }
        }
Пример #6
0
 /// <summary>
 /// Displays the specified view.
 /// </summary>
 /// <param name="view">The view to display.</param>
 /// <exception cref="System.ArgumentException">view is
 /// invalid.</exception>
 public void NavigateTo(SessionSummaryView view, NavigateToArgs e)
 {
 }