private void DGCaseDataInfo_BeginningEdit(object sender, Microsoft.Windows.Controls.DataGridBeginningEditEventArgs e)
 {
     try
     {
         var selectedCaseData = DGCaseDataInfo.SelectedItem as ChatCaseData;
         if (selectedCaseData != null)
         {
             //if (_chatDataContext.IsChatEnabledModifyCaseData)
             //{
             //    e.Cancel = false;
             //    return;
             //}
             //else if (chatUtil.NotifyCaseData.Count(p => p.Key == selectedCallData.Key.ToString()) > 0)
             //{
             //    e.Cancel = false;
             //    return;
             //}
             //else
             //{
             //    e.Cancel = true;
             //}
             if (_chatDataContext.LoadCaseDataFilterKeys != null && _chatDataContext.LoadCaseDataFilterKeys.Count > 0)
             {
                 //if (!string.IsNullOrEmpty(selectedCaseData.Value.ToString()))
                 //{
                 if (_chatDataContext
                     .LoadCaseDataFilterKeys.Any(
                         x =>
                         x.ToString().Trim().ToLower() ==
                         selectedCaseData.Key.ToString().Trim().ToLower()) && (((string)ConfigContainer.Instance().GetValue("chat.enable.modify-case-data")).ToLower().Equals("true")))
                 {
                     e.Cancel = false;
                     return;
                 }
                 if (_chatDataContext
                     .LoadCaseDataKeys.Any(
                         x =>
                         x.ToString().Trim().ToLower() ==
                         selectedCaseData.Key.ToString().Trim().ToLower()) && (((string)ConfigContainer.Instance().GetValue("chat.enable.modify-case-data")).ToLower().Equals("true")))
                 {
                     e.Cancel = false;
                     return;
                 }
                 else
                 {
                     e.Cancel = true;
                 }
                 //}
             }
             else
             {
                 e.Cancel = true;
             }
         }
     }
     catch (Exception _generalException)
     {
         _logger.Error("Error occurred as DGCaseDataInfo_BeginningEdit() : " + _generalException.ToString());
     }
 }
예제 #2
0
        /// <summary>
        ///     Handles the BeginningEdit event of the DGAttachData control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">
        ///     The <see cref="Microsoft.Windows.Controls.DataGridBeginningEditEventArgs" /> instance containing the
        ///     event data.
        /// </param>
        private void DGAttachData_BeginningEdit(object sender, Microsoft.Windows.Controls.DataGridBeginningEditEventArgs e)
        {
            var selectedCallData = e.Row.Item as CallData;

            if (selectedCallData != null)
            {
                if (selectedCallData.Value.StartsWith("http") || selectedCallData.Value.StartsWith("www"))
                {
                    e.Cancel = true;
                    if (_configContainer.AllKeys.Contains("voice.enable.attach-data-popup-url") && ((string)_configContainer.GetValue("voice.enable.attach-data-popup-url")).ToLower().Equals("true"))
                    {
                        string urlString = selectedCallData.Value.Contains("http") ? selectedCallData.Value : "http://" + selectedCallData.Value;
                        Uri    uriResult;
                        if (Uri.TryCreate(urlString, UriKind.Absolute, out uriResult) &&
                            (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps))
                        {
                            Process.Start(uriResult.AbsoluteUri);
                        }
                    }
                }

                //Code added - hide the editable option in above key in call data datagrid
                //Smoorthy - 07-11-2013
                else if (_configContainer.AllKeys.Contains("VoiceAttachDataKey") &&
                         _configContainer.GetValue("VoiceAttachDataKey") != null)
                {
                    //ANI CallID CallType ConnID OtherDN ThisDN
                    //if (!string.IsNullOrEmpty(selectedCallData.Value))
                    //{
                    if (_isCaseDataManualBeginEdit)
                    {
                        e.Cancel = false;
                        _isCaseDataManualBeginEdit = false;
                    }
                    else if (((List <string>)_configContainer.GetValue("VoiceAttachDataKey")).Any(
                                 x =>
                                 Regex.Replace(x, @"\s+", "").ToString().Trim().ToLower() == selectedCallData.Key.ToString().Trim().ToLower()) &&
                             (_configContainer.AllKeys.Contains("voice.enable.modify-case-data") && ((string)_configContainer.GetValue("voice.enable.modify-case-data")).ToLower().Equals("true")))
                    {
                        e.Cancel = false;
                    }
                    else
                    {
                        e.Cancel = true;
                    }
                    //}
                }
                else
                {
                    e.Cancel = true;
                }
                //End
            }
        }
        /// <summary>
        /// Handles the BeginningEdit event of the DGCaseDataInfo control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Microsoft.Windows.Controls.DataGridBeginningEditEventArgs"/> instance containing the event data.</param>
        private void DGCaseDataInfo_BeginningEdit(object sender, Microsoft.Windows.Controls.DataGridBeginningEditEventArgs e)
        {
            var selectedCallData = DGCaseDataInfo.SelectedItem as EmailCaseData;

            if (selectedCallData != null)
            {
                List <string> emailCaseData = new List <string>();
                if (ConfigContainer.Instance().AllKeys.Contains("EmailAttachDataKey") && ConfigContainer.Instance().GetValue("EmailAttachDataKey") != null)
                {
                    emailCaseData = (List <string>)(ConfigContainer.Instance().GetValue("EmailAttachDataKey"));
                }

                if (ConfigContainer.Instance().AllKeys.Contains("email.enable.modify-case-data") && ((string)ConfigContainer.Instance().GetValue("email.enable.modify-case-data")).ToLower().Equals("true") && emailCaseData != null && emailCaseData.Contains(selectedCallData.Key))
                {
                    editingKey   = selectedCallData.Key;
                    editingValue = selectedCallData.Value;
                    e.Cancel     = false;
                    return;
                }
            }
            e.Cancel = true;
        }
예제 #4
0
        public void OnBeginningEdit(object sender, Microsoft.Windows.Controls.DataGridBeginningEditEventArgs e)
        {
            string code   = ((System.Data.DataRowView)(e.Row.Item)).Row["SHAPE_CODE"].ToString();
            string column = e.Column.SortMemberPath;

            try
            {
                if (ProductWeightSelectedItem != null)
                {
                    switch (column)
                    {
                    case "VAL1":
                        if (!ProductWeightSelectedItem["HEAD1"].IsNotNullOrEmpty())
                        {
                            e.Cancel = true;
                        }
                        break;

                    case "VAL2":
                        if (!ProductWeightSelectedItem["HEAD2"].IsNotNullOrEmpty())
                        {
                            e.Cancel = true;
                        }
                        break;

                    case "VAL3":
                        if (!ProductWeightSelectedItem["HEAD3"].IsNotNullOrEmpty())
                        {
                            e.Cancel = true;
                        }
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
예제 #5
0
 protected override void OnBeginningEdit(Microsoft.Windows.Controls.DataGridBeginningEditEventArgs e)
 {
     Logging.Client.DebugFormat("OnBeginningEdit(Row.Item.Type = {0})", e.Row.Item.GetType().Name);
     Logging.Client.DebugFormat("    continueEdit={0}, isNewItem={1}", continueEdit, isNewItemForContinueEdit);
     base.OnBeginningEdit(e);
 }
 private void DGAttachData_BeginningEdit(object sender, Microsoft.Windows.Controls.DataGridBeginningEditEventArgs e)
 {
 }