Пример #1
0
        /// <summary>
        /// Retrieves a list of sessions
        /// </summary>
        /// <param name="sender">The source of the request</param>
        /// <param name="e">The argument passed in</param>
        private void DoRequestSessions(object sender, DoWorkEventArgs e)
        {
            EliteModule.SetThreadCulture(Parent.Settings);

            DateTime date = (DateTime)e.Argument;

            e.Result = SendRequestSessions(date);
        }
Пример #2
0
        /// <summary>
        /// Saves the session summary
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The work argument passed in.</param>
        private void DoRequestSetSummary(object sender, DoWorkEventArgs e)
        {
            EliteModule.SetThreadCulture(Parent.Settings);

            SetSessionSummary msg = new SetSessionSummary((Summary)e.Argument);

            msg.Send();

            if (msg.ReturnCode != ServerReturnCode.Success)
            {
                throw new SessionSummaryException(ServerErrorTranslator.GetReturnCodeMessage(msg.ReturnCode));
            }
        }
Пример #3
0
        /// <summary>
        /// Requests any pending increases for the session on the specified date to be applied.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The work argument passed in.</param>
        private void DoTriggerAcc2Increases(object sender, DoWorkEventArgs e)
        {
            EliteModule.SetThreadCulture(Parent.Settings);

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

            var spMsg = new GetSessionPlayedsMessage(date, date);

            spMsg.Send();
            if (spMsg.ReturnCode != ServerReturnCode.Success)
            {
                throw new SessionSummaryException(ServerErrorTranslator.GetReturnCodeMessage(spMsg.ReturnCode));
            }

            var sps = spMsg.Sessions;

            Games.Bingo.Model.SessionPlayed theSP = null;
            foreach (var sp in sps)
            {
                if (!sp.Overridden && sp.GamingSession == session)
                {
                    theSP = sp;
                    break;
                }
            }

            if (theSP == null)
            {
                throw new SessionSummaryException("Session identifier not found");
            }

            var accMsg = new TriggerAcc2AutoIncreasesRequest(date, theSP.SessionPlayedID, false, true);

            accMsg.Send();

            if (accMsg.ReturnCode != ServerReturnCode.Success)
            {
                throw new SessionSummaryException(ServerErrorTranslator.GetReturnCodeMessage(accMsg.ReturnCode));
            }

            e.Result = accMsg.IncreaseCount;
        }
Пример #4
0
        /// <summary>
        /// Retrieves a calculated summary.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The work argument passed in.</param>
        private void DoRequestCalcdSummary(object sender, DoWorkEventArgs e)
        {
            EliteModule.SetThreadCulture(Parent.Settings);

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

            GetCalculatedSessionSummary msgCalcd = new GetCalculatedSessionSummary(date, session);

            msgCalcd.Send();

            if (msgCalcd.ReturnCode != ServerReturnCode.Success)
            {
                throw new SessionSummaryException(ServerErrorTranslator.GetReturnCodeMessage(msgCalcd.ReturnCode));
            }

            e.Result = msgCalcd.Summary;
        }
Пример #5
0
        /// <summary>
        /// Retrieves a summary
        /// </summary>
        /// <param name="sender">The source of the event</param>
        /// <param name="e">The work argument passed in</param>
        private void DoRequestSummary(object sender, DoWorkEventArgs e)
        {
            EliteModule.SetThreadCulture(Parent.Settings);

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

            GetCalculatedSessionSummary msgCalcd = new GetCalculatedSessionSummary(date, session);

            msgCalcd.Send();

            if (msgCalcd.ReturnCode != ServerReturnCode.Success)
            {
                throw new SessionSummaryException(ServerErrorTranslator.GetReturnCodeMessage(msgCalcd.ReturnCode));
            }

            GetSavedSessionSummary msgSaved = new GetSavedSessionSummary(date, session, StaffMembers);

            msgSaved.Send();

            if (msgSaved.ReturnCode == ServerReturnCode.MissingTableEntry)
            {
                //swallow this return code there will be not data
            }
            else if (msgSaved.ReturnCode != ServerReturnCode.Success)
            {
                throw new SessionSummaryException(ServerErrorTranslator.GetReturnCodeMessage(msgSaved.ReturnCode));
            }

            ArrayList results = new ArrayList();

            results.Add(msgCalcd.Summary);
            results.Add(msgSaved.Summary);
            e.Result = results;
        }