/// <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; }
/// <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; }