Exemplo n.º 1
0
        private void addConsultantCoachNoteOnThisAnchorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // the only function of the button here is to add a slot to type a con note
            StoryEditor theSE;

            if (!CheckForProperEditToken(out theSE))
            {
                return;
            }

            if (m_theLastButtonClicked != null)
            {
                Debug.Assert(theSE.LoggedOnMember != null);
                string strNote = StoryEditor.GetInitials(theSE.LoggedOnMember.Name) + ": Re: anc: ";
                strNote += m_theLastButtonClicked.Text;

                if (m_theLastButtonClicked.ToolTipText != m_theLastButtonClicked.Text)
                {
                    strNote += String.Format(" ({0})", m_theLastButtonClicked.ToolTipText);
                }

                strNote += ". ";

                theSE.SendNoteToCorrectPane(_ctrlVerse.VerseNumber, strNote);
            }
            else
            {
                MessageBox.Show("Right-click on one of the buttons to choose which one to add the comment to", Properties.Resources.IDS_Caption);
            }
        }
        public StringTransfer DoAddNote(string strNote)
        {
            // the only function of the button here is to add a slot to type a con note
            StoryEditor theSE;

            if (!CheckForProperEditToken(out theSE))
            {
                return(null);
            }

            // if we're not given anything to put in the box, at least put in the logged
            //  in member's initials and re
            if (String.IsNullOrEmpty(strNote) && (theSE.LoggedOnMember != null))
            {
                strNote = StoryEditor.GetInitials(theSE.LoggedOnMember.Name) + ": Re: ";
            }

            // if the coach tries to add a note in the consultant's pane, that should fail.
            // (but it's okay for a project facilitator to add one if they have a question
            //  for the consultant)
            if (!_theCNsDC.CheckAddNotePrivilege(theSE, theSE.LoggedOnMember.MemberType))
            {
                return(null);
            }

            StoryStageLogic.ProjectStages eCurState = theSE.theCurrentStory.ProjStage.ProjectStage;
            int round = 1;

            if (eCurState > StoryStageLogic.ProjectStages.eProjFacOnlineReview1WithConsultant)
            {
                round = 2;
                if (eCurState > StoryStageLogic.ProjectStages.eProjFacOnlineReview2WithConsultant)
                {
                    round = 3;
                }
            }

            ConsultNoteDataConverter cndc =
                _theCNsDC.Add(round, theSE.LoggedOnMember.MemberType, strNote);

            System.Diagnostics.Debug.Assert(cndc.Count == 1);

            theSE.ReInitConsultNotesPane(_theCNsDC);

            // return the StringTransfer we just created
            return(cndc[0]);
        }