public void InitializeNewCall()
        {
            IsCallInProgress = true;

            btnHoldCall.Enabled = true;

            btnLogCall.Text = "End Call";

            CurrentCall               = new call();
            CurrentCall.created_on    = DateTime.Now;
            CurrentCall.claim_id      = Claim.id;
            CurrentCall.OnHoldSeconds = 0;
            CurrentCall.operatordata  = ActiveUser.UserObject.username;
            CurrentCall.updated_on    = DateTime.Now;
            CurrentCall.Save();
            currentCallNode                    = new CallTreeCallNode(CurrentCall);
            currentCallNode.ImageIndex         = 5;
            currentCallNode.SelectedImageIndex = 5;

            // Initialize CallTreeView
            foreach (question q in Questions)
            {
                if (String.IsNullOrEmpty(q.required_answer))
                {
                    AddQuestionToTree(q, (TreeNode)currentCallNode);
                }
            }
            _numQuestionsAnswered = 0;
            tvwCall.Nodes.Add(currentCallNode);
            currentCallNode.NodeFont = new Font(tvwCall.Font, FontStyle.Bold);
            currentCallNode.Expand();
            currentCallNode.EnsureVisible();

            notesGrid.CurrentCall = CurrentCall;
        }
 public CallManager()
 {
     _IsCallInProgress    = false;
     _IsCallOnHold        = false;
     OnHoldIsDrawn        = false;
     currentChoiceIsDirty = false;
     currentCallNode      = null;
     currentQuestionNode  = null;
     onHoldStarted        = DateTime.MinValue;
     _questions           = new List <question>();
     _pastCalls           = new List <call>();
     InitializeComponent();
     this.tvwCall.LineColor = SystemColors.GrayText;
     this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
 }
        private void AddCallToTree(call call, TreeNode parentNode)
        {
            // Add Call Node
            CallTreeCallNode callNode = new CallTreeCallNode(call);

            callNode.ImageIndex         = 0;
            callNode.SelectedImageIndex = 0;

            parentNode.Nodes.Add(callNode);

            List <CallQuestion> callQuestions = call.GetCallQuestions();

            foreach (CallQuestion cq in callQuestions)
            {
                if (cq.IsAnswered)
                {
                    AddQuestionToTree(cq, callNode);
                }
            }
        }