/// <summary> /// Reloads the unique identifier. /// </summary> /// <param name="isrejectCallDisplayed">if set to <c>true</c> [is reject call displayed].</param> public void ReloadUI(bool isrejectCallDisplayed) { if (!isrejectCallDisplayed && !_dataContext.SwitchName.ToLower().Contains("nortel"))// request redirect not supported in Nortel1000 { if (_configContainer.AllKeys.Contains("voice.enable.call-notify-reject") && _configContainer.GetValue("voice.enable.call-notify-reject").ToLower().Equals("true") && _configContainer.AllKeys.Contains("voice.enable.call-notify-accept") && _configContainer.GetAsString("voice.enable.call-notify-accept").ToLower().Equals("true")) { btnRight.Visibility = System.Windows.Visibility.Visible; btnRight.Content = "_Reject"; btnRight.Style = (Style)FindResource("RejectButton"); btnLeft.Visibility = System.Windows.Visibility.Visible; btnLeft.Content = "_Accept"; btnLeft.Style = (Style)FindResource("CallButton"); } else if (_configContainer.AllKeys.Contains("voice.enable.call-notify-accept") && _configContainer.GetAsString("voice.enable.call-notify-accept").ToLower().Equals("true")) { btnLeft.Visibility = System.Windows.Visibility.Collapsed; btnRight.Content = "_Accept"; btnRight.Style = (Style)FindResource("CallButton"); btnRight.Visibility = System.Windows.Visibility.Visible; } else if (_configContainer.AllKeys.Contains("voice.enable.call-notify-reject") && _configContainer.GetValue("voice.enable.call-notify-reject").ToLower().Equals("true")) { btnLeft.Visibility = System.Windows.Visibility.Collapsed; btnRight.Content = "_Reject"; btnRight.Style = (Style)FindResource("RejectButton"); btnRight.Visibility = System.Windows.Visibility.Visible; } else { btnLeft.Visibility = System.Windows.Visibility.Collapsed; btnRight.Visibility = System.Windows.Visibility.Collapsed; } } else { if (((_configContainer.AllKeys.Contains("voice.enable.call-notify-accept") && _configContainer.GetAsString("voice.enable.call-notify-accept").ToLower().Equals("true")))) { btnLeft.Visibility = System.Windows.Visibility.Collapsed; btnRight.Content = "_Accept"; btnRight.Style = (Style)FindResource("CallButton"); btnRight.Visibility = System.Windows.Visibility.Visible; } else { btnLeft.Visibility = System.Windows.Visibility.Hidden; btnRight.Visibility = System.Windows.Visibility.Hidden; } } }
/// <summary> /// Prepares the user data. /// </summary> private void PrepareUserData() { string finalDateTime = string.Empty; try { _updateUserEventData.Clear(); if (_datacontext.userAttachData.ContainsKey("GSW_RECORD_HANDLE")) { if (!_updateUserEventData.ContainsKey("GSW_RECORD_HANDLE")) { _updateUserEventData.Add("GSW_RECORD_HANDLE", Convert.ToInt32(_datacontext.userAttachData["GSW_RECORD_HANDLE"])); } else { _logger.Debug("PrepareUserData : GSW_RECORD_HANDLE is null"); } } if (_datacontext.userAttachData.ContainsKey("GSW_APPLICATION_ID")) { if (!_updateUserEventData.ContainsKey("GSW_APPLICATION_ID")) { _updateUserEventData.Add("GSW_APPLICATION_ID", Convert.ToInt32(_datacontext.userAttachData["GSW_APPLICATION_ID"])); } else { _logger.Debug("PrepareUserData : GSW_APPLICATION_ID is null"); } } if (_datacontext.userAttachData.ContainsKey("GSW_CAMPAIGN_NAME")) { if (!_updateUserEventData.ContainsKey("GSW_CAMPAIGN_NAME")) { _updateUserEventData.Add("GSW_CAMPAIGN_NAME", Convert.ToInt32(_datacontext.userAttachData["GSW_CAMPAIGN_NAME"])); } else { _logger.Debug("PrepareUserData : GSW_CAMPAIGN_NAME is null"); } } if (chkbxPersonalCallback.IsChecked == true) { if (!_updateUserEventData.ContainsKey("PHSPCB")) { _updateUserEventData.Add("PHSPCB", "1"); } } else { if (!_updateUserEventData.ContainsKey("PHSPCB")) { _updateUserEventData.Add("PHSPCB", "0"); } } if (!_updateUserEventData.ContainsKey("GSW_CALLBACK_TYPE")) { _updateUserEventData.Add("GSW_CALLBACK_TYPE", "Campaign"); } if (_datacontext.userAttachData.ContainsKey("GSW_CALLING_LIST")) { if (!_updateUserEventData.ContainsKey("GSW_CALLING_LIST")) { _updateUserEventData.Add("GSW_CALLING_LIST", Convert.ToInt32(_datacontext.userAttachData["GSW_CALLING_LIST"])); } else { _logger.Debug("PrepareUserData : GSW_CALLING_LIST is null"); } } if (chkbxRescheduleCall.IsChecked == true) { DateTime dt = new DateTime(); dt = Convert.ToDateTime(dpRescheduledate.Text); DateTime dtTime = new DateTime(); dtTime = Convert.ToDateTime(dpRescheduletime.Text); if (_configContainer.AllKeys.Contains("voice.ocs.time-format") && !string.IsNullOrEmpty(_configContainer.GetAsString("voice.ocs.time-format"))) { try { finalDateTime = dt.Date.ToShortDateString() + " " + dtTime.ToString(_configContainer.GetAsString("voice.ocs.time-format"), CultureInfo.InstalledUICulture); } catch (Exception generalException) { _logger.Error("Error occurred while converting time in the given format : " + _configContainer.GetAsString("voice.ocs.time-format") + " : " + generalException.ToString()); finalDateTime = dt.Date.ToShortDateString() + " " + dtTime.ToString("HH:mm", CultureInfo.InstalledUICulture); } } if (!_updateUserEventData.ContainsKey("GSW_DATE_TIME")) { _updateUserEventData.Add("GSW_DATE_TIME", finalDateTime); } if (!_updateUserEventData.ContainsKey("GSW_AGENT_REQ_TYPE")) { _updateUserEventData.Add("GSW_AGENT_REQ_TYPE", "RecordReschedule"); } } if (!string.IsNullOrEmpty(cmbCallResult.Text.Trim()) && cmbCallResult.SelectedIndex >= 0) { if (!_updateUserEventData.ContainsKey("GSW_CALL_RESULT")) { _updateUserEventData.Add("GSW_CALL_RESULT", Convert.ToInt32(cmbCallResult.SelectedValue.ToString())); } } if (_datacontext.userAttachData.ContainsKey("GSW_PHONE")) { if (!_updateUserEventData.ContainsKey("GSW_PHONE")) { _updateUserEventData.Add("GSW_PHONE", _datacontext.userAttachData["GSW_PHONE"].ToString()); } } if (!_updateUserEventData.ContainsKey("GSW_AGENT_REQ_TYPE")) { _updateUserEventData.Add("GSW_AGENT_REQ_TYPE", "UpdateCallCompletionStats"); } var soft = new SoftPhone(); OutputValues output = soft.UpdateOCSCallData(_updateUserEventData); if (output.MessageCode == "200") { _logger.Info("OCS Call Data Updated Successfully...."); } SendRecordProcessed(_updateUserEventData); } catch (Exception generalException) { _logger.Error("Error occurred in PrepareUserData() : " + generalException.ToString()); } }