/// <summary>
 ///     Handles the Click event of the btnClear control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
 private void btnClear_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         DGCaseDataInfo.CancelEdit();
         BindGrid();
     }
     catch (Exception commonException)
     {
         _logger.Error("Error occurred while btnClear_Click(): " + commonException.ToString());
     }
 }
        /// <summary>
        /// Handles the Click event of the btnUpdate control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                isEditDone = true;
                DGCaseDataInfo.CancelEdit();
                var    selectedCallData = DGCaseDataInfo.SelectedItem as EmailCaseData;
                string key   = selectedCallData.Key;
                string value = selectedCallData.Value;
                if (CurrentData.ContainsKey(key))
                {
                    string originalValue = CurrentData[key].ToString();
                    if (value != originalValue)
                    {
                        KeyValueCollection caseData = new KeyValueCollection();
                        caseData.Add(key, value);
                        InteractionService interactionService = new InteractionService();
                        Pointel.Interactions.Core.Common.OutputValues result = interactionService.UpdateCaseDataProperties(interactionId, EmailDataContext.GetInstance().ProxyClientID, caseData);
                        if (result.MessageCode == "200")
                        {
                            CurrentData[key] = value;
                        }
                        caseData.Clear();
                    }
                }
                else
                {
                    KeyValueCollection caseData = new KeyValueCollection();
                    caseData.Add(key, value);
                    InteractionService interactionService = new InteractionService();
                    Pointel.Interactions.Core.Common.OutputValues result = interactionService.AddCaseDataProperties(interactionId, EmailDataContext.GetInstance().ProxyClientID, caseData);
                    if (result.MessageCode == "200")
                    {
                        CurrentData.Add(key, value);
                    }
                    caseData.Clear();
                }
                editingValue = editingKey = null;

                //  BindGrid();
            }
            catch (Exception commonException)
            {
                logger.Error("Error ocurred as " + commonException.Message);
            }
        }
 /// <summary>
 /// Handles the Click event of the btnCancel control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         isEditDone = true;
         DGCaseDataInfo.CancelEdit();
         var selectedCallData = DGCaseDataInfo.SelectedItem as EmailCaseData;
         if (CurrentData.ContainsKey(editingKey))
         {
             CurrentData[editingKey] = editingValue;
             selectedCallData.Value  = editingValue;
             editingValue            = editingKey = null;
             DGCaseDataInfo.UpdateLayout();
         }
     }
     catch (Exception ex)
     {
         logger.Error("Error occurred as " + ex.Message);
     }
 }