/// <summary>
        /// SubmitCommand execution method
        /// </summary>
        /// <param name="param"></param>
        private void SubmitCommandMethod(object param)
        {
            foreach (VoterInfo info in PresentationMeetingVoterInfo)
            {
                if (info.VoteType == VoteType.MODIFY)
                {
                    if (info.VoterPFVMeasure == null || info.VoterBuyRange == null || info.VoterSellRange == null)
                    {
                        Prompt.ShowDialog("'Modify' Vote input has not been supplemented with valid P/FV Measure, Buy and Sell Range for one or more voting members");
                        return;
                    }
                }
                if (info.Name.ToLower() == UserSession.SessionManager.SESSION.UserName && info.PostMeetingFlag == false)
                {
                    VoterInfo postMeetingVoterInfo = PresentationMeetingVoterInfo
                                                     .Where(record => record.Name.ToLower() == UserSession.SessionManager.SESSION.UserName && record.PostMeetingFlag == true)
                                                     .FirstOrDefault();

                    if (postMeetingVoterInfo != null)
                    {
                        postMeetingVoterInfo.VoteType        = info.VoteType;
                        postMeetingVoterInfo.VoterPFVMeasure = info.VoterPFVMeasure;
                        postMeetingVoterInfo.VoterBuyRange   = info.VoterBuyRange;
                        postMeetingVoterInfo.VoterSellRange  = info.VoterSellRange;
                    }
                }
            }
            if (dbInteractivity != null)
            {
                BusyIndicatorNotification(true, "Updating Pre-Meeting Voting Information");
                dbInteractivity.UpdatePreMeetingVoteDetails(UserSession.SessionManager.SESSION.UserName, PresentationMeetingVoterInfo
                                                            , UpdatePreMeetingVoteDetailsCallbackMethod);
            }
        }
        /// <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);
            }
        }
Beispiel #3
0
        public ActionResult VoterLogin(VoterInfo model)
        {
            var dataItem = db.VoterInfoes.FirstOrDefault(x => x.VoterId == model.VoterId && x.VFirstName == model.VFirstName && x.VLastName == model.VLastName);

            if (dataItem != null)
            {
                var DBModel = new LogUpdate();
                DBModel.Date       = DateTime.Today.ToString("G");
                DBModel.Who        = !String.IsNullOrEmpty((string)Session["userName"]) ? (string)Session["UserName"] : (string)Session["userRole"];
                DBModel.Access     = "UCVoterLogin";
                DBModel.Actual_SQL = "Select * from VoterInfo where VoterID and Last Name and First name match search";
                DBModel.TableName  = "VoterInfo";
                db.LogUpdates.Add(DBModel);
                db.SaveChanges();

                Session["voterName"] = dataItem.VFirstName;
                Session["voterID"]   = dataItem.VoterId;

                return(RedirectToAction("Index", "VoterContactInfoes", new { search = (int)Session["voterID"] }));
            }
            else
            {
                ModelState.AddModelError("", "Invalid login information");
                return(View());
            }
        }
        public Task <bool> Handle(AddVotersCommand data, CancellationToken token)
        {
            VoterInfo obj = _mapper.Map <VoterInfo>(data);

            _context.VoterInfo.Add(obj);
            _context.SaveChanges();
            return(Task.FromResult(true));
        }
Beispiel #5
0
        /// <summary>
        /// cbFinalVoteType SelectionChanged EventHandler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">SelectionChangedEventArgs</param>
        private void cbFinalVoteType_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
        {
            RadComboBox voteComboBox = sender as RadComboBox;

            if (voteComboBox == null)
            {
                return;
            }
            VoterInfo voterInfo = voteComboBox.DataContext as VoterInfo;

            DataContextViewModelPresentationDecisionEntry.RaiseUpdateFinalVoteType(voterInfo);
        }
        public Task <bool> Handle(RemoveVoterInfoCommand data, CancellationToken token)
        {
            //Do not need these lines of mapping.
            //VoterInfo obj = _mapper.Map<VoterInfo>(data);
            VoterInfo obj = _context.VoterInfo.FirstOrDefault(x => x.VoterId == data.VoterId);

            if (obj != null)
            {
                _context.VoterInfo.Remove(obj);
                _context.SaveChanges();
            }
            return(Task.FromResult(true));
        }
        /// <summary>
        /// Raise final vote type update
        /// </summary>
        /// <param name="voterInfo">VoterInfo object</param>
        public void RaiseUpdateFinalVoteType(VoterInfo voterInfo)
        {
            if (voterInfo == null)
            {
                return;
            }
            RaisePropertyChanged(() => this.SelectedPresentationOverviewInfo);

            if (voterInfo.VoteType == VoteType.AGREE)
            {
                VoterInfo bindedItem = PresentationPostMeetingVoterInfo.Where(record => record.VoterID == voterInfo.VoterID).FirstOrDefault();
                bindedItem.VoterPFVMeasure = SelectedPresentationOverviewInfo.SecurityPFVMeasure;
                bindedItem.VoterBuyRange   = SelectedPresentationOverviewInfo.SecurityBuyRange;
                bindedItem.VoterSellRange  = SelectedPresentationOverviewInfo.SecuritySellRange;

                RaisePropertyChanged(() => this.PresentationPostMeetingVoterInfo);
            }
            else if (voterInfo.VoteType == VoteType.MODIFY)
            {
                VoterInfo origItem = PresentationVoterInfo.Where(record => record.VoterID == voterInfo.VoterID).FirstOrDefault();
                if (origItem == null)
                {
                    return;
                }
                if (origItem.VoteType != VoteType.MODIFY)
                {
                    return;
                }
                VoterInfo bindedItem = PresentationPostMeetingVoterInfo.Where(record => record.VoterID == voterInfo.VoterID).FirstOrDefault();
                if (bindedItem == null)
                {
                    return;
                }
                bindedItem.VoterPFVMeasure = origItem.VoterPFVMeasure;
                bindedItem.VoterBuyRange   = origItem.VoterBuyRange;
                bindedItem.VoterSellRange  = origItem.VoterSellRange;

                RaisePropertyChanged(() => this.PresentationPostMeetingVoterInfo);
            }
            else if (voterInfo.VoteType == VoteType.ABSTAIN)
            {
                VoterInfo bindedItem = PresentationPostMeetingVoterInfo.Where(record => record.VoterID == voterInfo.VoterID).FirstOrDefault();
                bindedItem.VoterPFVMeasure = null;
                bindedItem.VoterBuyRange   = null;
                bindedItem.VoterSellRange  = null;

                RaisePropertyChanged(() => this.PresentationPostMeetingVoterInfo);
            }
        }
 public void AddVoterInfo(VoterInfo data)
 {
     _context.VoterInfo.Add(data);
     _context.SaveChanges();
 }
 public void UpdateVoterInfo(VoterInfo data)
 {
     _context.VoterInfo.Update(data);
     _context.SaveChanges();
 }
 public IActionResult UpdateVoterInfo(VoterInfo data)
 {
     _repo.UpdateVoterInfo(data);
     return(Ok());
 }
        public IActionResult GetVoterInfoByVoterId(int VoterId)
        {
            VoterInfo result = _repo.GetVoterByVoterId(VoterId);

            return(Ok(result));
        }
 public IActionResult AddVoterInfo(VoterInfo data)
 {
     _repo.AddVoterInfo(data);
     return(Ok());
 }