本文整理汇总了C#中BrightPlatformEntities.FIGetDialogAnswers方法的典型用法代码示例。如果您正苦于以下问题:C# BrightPlatformEntities.FIGetDialogAnswers方法的具体用法?C# BrightPlatformEntities.FIGetDialogAnswers怎么用?C# BrightPlatformEntities.FIGetDialogAnswers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BrightPlatformEntities
的用法示例。
在下文中一共展示了BrightPlatformEntities.FIGetDialogAnswers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ___LoadDialogQuestionnaires
public void ___LoadDialogQuestionnaires()
{
m_AnswerBindingOnProgress = true;
m_HasMustSaveDefaultValues = false;
this.ResetToDefaultState();
this.BindDialogManagerData();
using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection))
{
m_oDialog = _efDbContext.dialogs.FirstOrDefault(i => i.subcampaign_id == SubCampaignId && i.is_active == true);
if (m_oDialog == null)
{
bbiEditDialog.Enabled = false;
NotificationDialog.Warning("Bright Sales", "There is no current dialog created for this customer's subcampaign.");
return;
}
_efDbContext.Detach(m_oDialog);
/**
* Populate each JSON questionnaire from dialog text to list object type.
*/
#region Code Logic
var CQList = new List<CampaignQuestionnaire>();
CampaignQuestionnaire oQuestionnaire = null;
List<string> cbdList = new List<string>();
DataBindings oBindings = null;
if (!string.IsNullOrEmpty(m_oDialog.dialog_text_json))
{
var jaDiag = JArray.Parse(m_oDialog.dialog_text_json);
jaDiag.ForEach(delegate(JToken jt)
{
/**
* [@jeff 06.08.2012]: https://brightvision.jira.com/browse/PLATFORM-1467
* added json converter to convert raw json to string, before unescaping.
*/
string _jsonData = ValidationUtility.StripJsonInvalidChars(JsonConvert.ToString(jt.ToString(Formatting.None)).Unescape());
oQuestionnaire = CampaignQuestionnaire.InstanciateWith(_jsonData);
if (oQuestionnaire != null)
{
CQList.Add(oQuestionnaire);
oBindings = oQuestionnaire.Form.Settings.DataBindings;
if (oBindings != null)
{
if (!string.IsNullOrEmpty(oBindings.questionlayout_id))
cbdList.Add(oBindings.questionlayout_id);
}
}
});
}
#endregion
/**
* Populate Answers to each questionnaire.
*/
#region Code Logic
int? campaign_id = CampaignId;
int? account_id = AccountId;
int? contact_id = SelectedContact == null || SelectedContact.id <= 0 ? (int?)null : SelectedContact.id;
int? dialog_id = m_oDialog.id;
List<int> answerIdList = new List<int>();
//get all dialog answers based on questionlayout_ids and other params
var listDialogAnswers = _efDbContext.FIGetDialogAnswers(
string.Join(",", cbdList.Distinct().ToArray()),
campaign_id,
account_id,
contact_id,
dialog_id
).ToList().Clone();
/*
* DAN: FIX for issue:
* https://brightvision.jira.com/browse/PLATFORM-2948
* https://brightvision.jira.com/browse/PLATFORM-2952
*/
//------------------------------------------------------------------------------------------------
((System.ComponentModel.ISupportInitialize)(this.groupControlDialog)).BeginInit();
this.groupControlDialog.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.layoutControlDialog)).BeginInit();
this.layoutControlDialog.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pnlDialogControls)).BeginInit();
this.pnlDialogControls.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.layoutControlMain)).BeginInit();
this.layoutControlMain.SuspendLayout();
this.SuspendLayout();
//------------------------------------------------------------------------------------------------
//layoutControlGroupQuestionnaire.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
//this.layoutControlQuestionnaire.Visible = false;
int rowcount = CQList.Count;
IsInitializingDialogComponents = true;
IsInitializedComponentsValid = false;
var a = from oquestion in CQList select oquestion.Form.Settings.DataBindings;
CTDialogAnswers dlgAnswer = null;
//.........这里部分代码省略.........
示例2: LoadDialogQuestionnaires
public void LoadDialogQuestionnaires(bool pDisposeQuestionnaire = false)
{
this.RunAssync(() => {
bool _ReloadContacts = false;
if (pDisposeQuestionnaire) {
m_BrightSalesProperty.CampaignBooking.Questionnaire.State = SelectionProperty.DialogEditorState.Empty;
this.DisposeGroupControls(layoutControlGroupQuestionnaire);
_ReloadContacts = true;
}
m_AnswerBindingOnProgress = true;
m_HasMustSaveDefaultValues = false;
this.ResetToDefaultState();
this.BindDialogManagerData(_ReloadContacts); //marker...
using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection)) {
/**
* get and set bindings.
*/
m_oDialog = _efDbContext.dialogs.FirstOrDefault(i => i.subcampaign_id == SubCampaignId && i.is_active == true);
if (m_oDialog == null) {
bbiEditDialog.Enabled = false;
NotificationDialog.Warning("Bright Sales", "There is no current dialog created for this customer's subcampaign.");
return;
}
_efDbContext.Detach(m_oDialog);
/**
* Populate each JSON questionnaire from dialog text to list object type.
*/
#region Code Logic
m_lstQuestionnaireDialog = new List<CampaignQuestionnaire>();
m_lstQuestionLayoutIds = new List<string>();
CampaignQuestionnaire _Questionnaire = null;
DataBindings _BindingData = null;
if (!string.IsNullOrEmpty(m_oDialog.dialog_text_json)) {
var jaDiag = JArray.Parse(m_oDialog.dialog_text_json);
jaDiag.ForEach(delegate(JToken jt) {
/**
* [@jeff 06.08.2012]: https://brightvision.jira.com/browse/PLATFORM-1467
* added json converter to convert raw json to string, before unescaping.
*/
string _jsonData = ValidationUtility.StripJsonInvalidChars(JsonConvert.ToString(jt.ToString(Formatting.None)).Unescape());
_Questionnaire = CampaignQuestionnaire.InstanciateWith(_jsonData);
if (_Questionnaire != null) {
m_lstQuestionnaireDialog.Add(_Questionnaire);
_BindingData = _Questionnaire.Form.Settings.DataBindings;
if (_BindingData != null) {
if (!string.IsNullOrEmpty(_BindingData.questionlayout_id))
m_lstQuestionLayoutIds.Add(_BindingData.questionlayout_id);
}
}
});
}
#endregion
int? _CampaignId = CampaignId;
int? _AccountId = AccountId;
int? _ContactId = SelectedContact == null || SelectedContact.id <= 0 ? (int?)null : SelectedContact.id;
int? _DialogId = m_oDialog.id;
/**
* create dialog if not yet been initialized.
* we only create dialog once, for the succeeding loads to be faster.
*/
if (m_BrightSalesProperty.CampaignBooking.Questionnaire.State == SelectionProperty.DialogEditorState.Empty) {
this.CreateQuestionnaire();
m_BrightSalesProperty.CampaignBooking.Questionnaire.State = SelectionProperty.DialogEditorState.Loaded;
}
/**
* get the list of answers.
*/
#region Code Logic
var _lstAnswers = _efDbContext.FIGetDialogAnswers(
string.Join(",", m_lstQuestionLayoutIds.Distinct().ToArray()),
_CampaignId,
_AccountId,
_ContactId,
_DialogId
).ToList().Clone();
IsInitializingDialogComponents = true;
IsInitializedComponentsValid = false;
List<int> _lstAnswerIds = new List<int>();
CTDialogAnswers _dlgAnswer = null;
for (int i = 0; i < m_lstQuestionnaireDialog.Count; ++i) {
_Questionnaire = m_lstQuestionnaireDialog[i];
_BindingData = _Questionnaire.Form.Settings.DataBindings;
/**
* if questionnaire is contact level and there are no contacts,
* just by pass saving.
*/
if (!_BindingData.account_level && m_BrightSalesProperty.CampaignBooking.ContactCount < 1)
continue;
if (_BindingData.account_level) {
//.........这里部分代码省略.........