コード例 #1
0
 /// <summary>
 /// SubmitCommand validation method
 /// </summary>
 /// <param name="param"></param>
 /// <returns>True/False</returns>
 private bool SubmitCommandValidationMethod(object param)
 {
     if (UserSession.SessionManager.SESSION == null ||
         SelectedPresentationOverviewInfo == null ||
         PresentationPreMeetingVoterInfo == null)
     {
         return(false);
     }
     if (SelectedPresentationOverviewInfo.StatusType != StatusType.READY_FOR_VOTING)
     {
         if (!UserSession.SessionManager.SESSION.Roles.Contains(MemberGroups.IC_ADMIN))
         {
             return(false);
         }
     }
     else
     {
         if (!(PresentationPreMeetingVoterInfo.Any(record => record.Name.ToLower() == UserSession.SessionManager.SESSION.UserName.ToLower()) ||
               (SelectedPresentationOverviewInfo.Presenter.ToLower() == UserSession.SessionManager.SESSION.UserName.ToLower()) ||
               UserSession.SessionManager.SESSION.Roles.Contains(MemberGroups.IC_ADMIN)))
         {
             return(false);
         }
     }
     return(true);
 }
コード例 #2
0
        /// <summary>
        /// RetrievePresentationVoterData callback method
        /// </summary>
        /// <param name="result">List of VoterInfo</param>
        private void RetrievePresentationVoterDataCallbackMethod(List <VoterInfo> result)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (result != null)
                {
                    Logging.LogMethodParameter(logger, methodNamespace, result, 1);
                    PresentationVoterInfo           = ListUtils.GetDeepCopy <VoterInfo>(result);
                    PresentationPreMeetingVoterInfo = result
                                                      .Where(record => record.PostMeetingFlag == false && record.Name.ToLower() != SelectedPresentationOverviewInfo.Presenter.ToLower())
                                                      .OrderBy(record => record.Name).ToList();
                    PresentationPostMeetingVoterInfo = result
                                                       .Where(record => record.PostMeetingFlag == true && record.Name.ToLower() != SelectedPresentationOverviewInfo.Presenter.ToLower())
                                                       .OrderBy(record => record.Name).ToList();

                    foreach (VoterInfo postMeetingVoterInfo in PresentationPostMeetingVoterInfo)
                    {
                        if (postMeetingVoterInfo.VoteType == null)
                        {
                            VoterInfo preMeetingVoterInfo = PresentationPreMeetingVoterInfo
                                                            .Where(record => record.Name == postMeetingVoterInfo.Name).FirstOrDefault();
                            if (preMeetingVoterInfo != null)
                            {
                                postMeetingVoterInfo.VoteType            = preMeetingVoterInfo.VoteType;
                                postMeetingVoterInfo.VoterPFVMeasure     = preMeetingVoterInfo.VoterPFVMeasure;
                                postMeetingVoterInfo.VoterBuyRange       = preMeetingVoterInfo.VoterBuyRange;
                                postMeetingVoterInfo.VoterSellRange      = preMeetingVoterInfo.VoterSellRange;
                                postMeetingVoterInfo.VoterRecommendation = preMeetingVoterInfo.VoterRecommendation;
                            }
                        }
                    }
                    isSecurityHeld = SelectedPresentationOverviewInfo.CurrentHoldings.ToLower() == "yes";

                    if (dbInteractivity != null)
                    {
                        BusyIndicatorNotification(true, "Retrieve current P/FV Measure values related to presented security...");
                        dbInteractivity.RetrieveCurrentPFVMeasures(PFVTypeInfo, SelectedPresentationOverviewInfo.SecurityTicker
                                                                   , RetrieveCurrentPFVMeasuresCallbackMethod);
                    }
                }
                else
                {
                    Logging.LogMethodParameterNull(logger, methodNamespace, 1);
                    BusyIndicatorNotification();
                }
            }
            catch (Exception ex)
            {
                Prompt.ShowDialog("Message: " + ex.Message + "\nStackTrace: " + Logging.StackTraceToString(ex), "Exception", MessageBoxButton.OK);
                Logging.LogException(logger, ex);
                BusyIndicatorNotification();
            }
            finally
            {
                Logging.LogEndMethod(logger, methodNamespace);
            }
        }
コード例 #3
0
        /// <summary>
        /// RetrievePresentationVoterData Callback Method
        /// </summary>
        /// <param name="result">List of VoterInfo</param>
        private void RetrievePresentationVoterDataCallbackMethod(List <VoterInfo> result)
        {
            string methodNamespace = String.Format("{0}.{1}", GetType().FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name);

            Logging.LogBeginMethod(logger, methodNamespace);
            try
            {
                if (result != null)
                {
                    Logging.LogMethodParameter(logger, methodNamespace, result, 1);

                    PresentationMeetingVoterInfo    = result;
                    PresentationPreMeetingVoterInfo = result.Where(record => record.PostMeetingFlag == false).OrderBy(record => record.Name).ToList();

                    if (UserSession.SessionManager.SESSION.Roles.Contains(MemberGroups.IC_ADMIN))
                    {
                        PresentationMeetingVoterInfo = PresentationMeetingVoterInfo
                                                       .Where(record => record.Name.ToLower() != SelectedPresentationOverviewInfo.Presenter.ToLower()).ToList();
                        PresentationPreMeetingVoterInfo = PresentationPreMeetingVoterInfo
                                                          .Where(record => record.Name.ToLower() != SelectedPresentationOverviewInfo.Presenter.ToLower()).ToList();
                        IsVoterEnabled = true;
                        IsVoteEnabled  = false;
                    }

                    if (result.Any(record => record.Name.ToLower() == UserSession.SessionManager.SESSION.UserName))
                    {
                        SelectedPresentationPreMeetingVoterInfo = result
                                                                  .Where(record => record.Name.ToLower() == UserSession.SessionManager.SESSION.UserName).FirstOrDefault();
                        IsVoterEnabled = false;
                    }
                    if (UserSession.SessionManager.SESSION.UserName == SelectedPresentationOverviewInfo.Presenter)
                    {
                        IsVoterEnabled = false;
                        IsVoteEnabled  = false;
                    }
                    if (!UserSession.SessionManager.SESSION.Roles.Contains(MemberGroups.IC_ADMIN) &&
                        !UserSession.SessionManager.SESSION.Roles.Contains(MemberGroups.IC_CHIEF_EXECUTIVE) &&
                        !UserSession.SessionManager.SESSION.Roles.Contains(MemberGroups.IC_VOTING_MEMBER))
                    {
                        IsVoterEnabled = false;
                        IsVoteEnabled  = false;
                    }
                    if (!UserSession.SessionManager.SESSION.Roles.Contains(MemberGroups.IC_ADMIN) &&
                        !UserSession.SessionManager.SESSION.Roles.Contains(MemberGroups.IC_VOTING_MEMBER) &&
                        !UserSession.SessionManager.SESSION.Roles.Contains(MemberGroups.IC_NON_VOTING_MEMBER) &&
                        !UserSession.SessionManager.SESSION.Roles.Contains(MemberGroups.IC_CHIEF_EXECUTIVE))
                    {
                        IsBlogEnabled = false;
                    }
                    if (UserSession.SessionManager.SESSION.Roles.Contains(MemberGroups.IC_NON_VOTING_MEMBER))
                    {
                        SelectedPresentationPreMeetingVoterInfo = result
                                                                  .Where(record => record.Name.ToLower() == SelectedPresentationOverviewInfo.Presenter).FirstOrDefault();
                    }
                    if (!(UserSession.SessionManager.SESSION.Roles.Contains(MemberGroups.IC_ADMIN) ||
                          SelectedPresentationOverviewInfo.StatusType == StatusType.READY_FOR_VOTING))
                    {
                        IsVoterEnabled = false;
                        IsVoteEnabled  = false;
                        IsBlogEnabled  = false;
                    }
                    RaisePropertyChanged(() => this.SubmitCommand);
                }
                else
                {
                    Logging.LogMethodParameterNull(logger, methodNamespace, 1);
                }
            }
            catch (Exception ex)
            {
                Prompt.ShowDialog("Message: " + ex.Message + "\nStackTrace: " + Logging.StackTraceToString(ex), "Exception", MessageBoxButton.OK);
                Logging.LogException(logger, ex);
            }
            finally
            {
                Logging.LogEndMethod(logger, methodNamespace);
                BusyIndicatorNotification();
            }
        }