/// <summary> /// Ends the current call, saving it if necessary. If askForSave is true, it will prompt the user before /// saving the call. /// </summary> /// <param name="askForSave"></param> public void TerminateCall(bool askForSave) { if (CurrentCall != null) { bool _needsSave = true; notesGrid.SaveNote(); if (askForSave) { if (MessageBox.Show(this, "Would you like to save the call in progress?", "Save Current Call", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { DeleteCurrentCall(); _needsSave = false; } } if (_needsSave) { CurrentCall.Save(); } btnLogCall.Text = "Log Call"; currentCallNode.NodeFont = new Font(tvwCall.Font, FontStyle.Regular); currentCallNode.ImageIndex = 0; currentCallNode.SelectedImageIndex = 0; } IsCallInProgress = false; btnHoldCall.Enabled = false; notesGrid.CurrentCall = null; }
public void TerminateCall() { if (CurrentCall != null) { ngDisplay.SaveNote(); CurrentCall.OnHoldSeconds = System.Convert.ToInt32(holdTime.TotalSeconds); CurrentCall.DurationSeconds = System.Convert.ToInt32(callTime.TotalSeconds); CurrentCall.talked_to_human = chkTalkedWithPerson.Checked; if (ctlStatusHandler._category != null) { CurrentCall.call_status = ctlStatusHandler._category.id; } CurrentCall.Save(); /* Additional data tabs not currently on this form * // Remove any additional info tabs that might still have information * * foreach (VerifyDataViewer vdv in additionalDataTabs) * { * if (!tbcNewCallData.TabPages.Contains(vdv)) * { * foreach (choice aChoice in vdv.DataViewer.Choices) * { * aChoice.Delete(); * } * } * } */ ActiveUser.LogAction(ActiveUser.ActionTypes.EndCall, LinkedClaim.id, CurrentCall.id, ""); } ShowNewCallControls(true, true); CurrentCall = null; ctlDataVerification.Initialize(); mainQuestionViewer.ClearAllCategories(); /* Additional data tabs not currently on this form * additionalDataTabs.Clear(); */ callTimer.Stop(); onHold = false; UpdateHoldTimerLabel(); /* Additional data tabs not currently on this form * foreach (TabPage aTab in tbcNewCallData.TabPages) * { * if (aTab is VerifyDataViewer) * { * tbcNewCallData.TabPages.Remove(aTab); * aTab.Dispose(); * } * } */ Minimize(); lblHoldTime.Text = "0:00:00"; lblCallTime.Text = "0:00:00"; }