本文整理汇总了C#中BrightPlatformEntities.FIUpdateContactTitles方法的典型用法代码示例。如果您正苦于以下问题:C# BrightPlatformEntities.FIUpdateContactTitles方法的具体用法?C# BrightPlatformEntities.FIUpdateContactTitles怎么用?C# BrightPlatformEntities.FIUpdateContactTitles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BrightPlatformEntities
的用法示例。
在下文中一共展示了BrightPlatformEntities.FIUpdateContactTitles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetReportPageBaseData
private void GetReportPageBaseData()
{
m_IsEmpty = false;
if (this.gridView1.DataRowCount == null || this.gridView1.DataRowCount < 1) {
BrightVision.Common.UI.NotificationDialog.Information("Reports", "No data to preview.");
m_IsEmpty = true;
return;
}
using (BrightPlatformEntities _efDbModel = new BrightPlatformEntities(m_DatabaseConnection) { CommandTimeout = 0 }) {
m_eftConfigData = _efDbModel.view_configuration.FirstOrDefault(i => i.id == m_ViewConfigId);
m_eftSubCampaign = _efDbModel.subcampaigns.FirstOrDefault(i => i.id == m_eftConfigData.subcampaign_id);
m_eftCampaign = _efDbModel.campaigns.FirstOrDefault(i => i.id == m_eftSubCampaign.campaign_id);
m_eftCustomer = _efDbModel.customers.FirstOrDefault(i => i.id == m_eftCampaign.customer_id);
_efDbModel.Detach(m_eftConfigData);
_efDbModel.Detach(m_eftSubCampaign);
_efDbModel.Detach(m_eftCampaign);
_efDbModel.Detach(m_eftCustomer);
_efDbModel.FIUpdateContactTitles();
/**
* if send email, get data for sub_campaign_account_list and final_list.
*/
if (m_CallingEnvironment == eCallingEnvironment.BrightSales_SendEmail && m_AccountId > 0) {
m_eftFinalList = _efDbModel.final_lists.FirstOrDefault(i => i.sub_campaign_id == m_eftSubCampaign.id);
if (m_eftFinalList != null) {
_efDbModel.Detach(m_eftFinalList);
m_eftSubCampaignAccountList = _efDbModel.sub_campaign_account_lists.FirstOrDefault(i =>
i.final_list_id == m_eftFinalList.id &&
i.account_id == m_AccountId
);
_efDbModel.Detach(m_eftSubCampaignAccountList);
}
}
}
if (m_eftConfigData == null || m_eftConfigData.report_layout_config == null) {
WaitDialog.Close();
if (m_IsWebPortalCall)
throw new Exception("No layout available for the selected view.");
BrightVision.Common.UI.NotificationDialog.Information("Reports", "No layout available for this view.");
return;
}
if (string.IsNullOrEmpty(m_eftConfigData.report_data_config)) {
WaitDialog.Close();
if (m_IsWebPortalCall)
throw new Exception("No parameter layout has been set for this report.");
BrightVision.Common.UI.NotificationDialog.Information("Reports", "No parameter layout has been set for this report.");
return;
}
m_ReportPageTemplateProperty = SerializeUtility.DeserializeFromXml<TemplateProperty>(m_eftConfigData.report_data_config);
m_ReportPageDataSet = this.GetReportDataSet(m_ReportPageTemplateProperty);
/**
* if has sort info, then apply.
*/
#region Sorting Logic
if (!string.IsNullOrEmpty(m_GridSortInfo)) {
string sortExpression = this.GetSortExpression(gridView1);
if (!string.IsNullOrEmpty(sortExpression)) {
string[] _SortInfoCollection = sortExpression.Split(';');
ReportDataSet _rdsTemporary = (ReportDataSet)m_ReportPageDataSet.Clone();
DataSet _dsSortedData = new DataSet();
Dictionary<string, List<string>> _TableSortRules = new Dictionary<string, List<string>>();
/**
* group all sort rules by table.
*/
foreach (string _SortInfo in _SortInfoCollection) {
string[] _item = _SortInfo.Split('|');
string _FieldNameInfo = this.GetTableFieldName(_item[0].ToString());
if (!string.IsNullOrEmpty(_FieldNameInfo)) {
string[] _val = _FieldNameInfo.Split('|');
string _TableName = _val[0];
string _FieldName = _val[1];
/**
* create new table sort rule.
* else, update existing table sort rule.
*
* format:
* <column_name1>|<sort_rule1>;<column_name2>|<sort_rule2>; and so on ...
*
* this would later be processed by splitting the sort rules by semicolon(;),
* then split by bar(|).
*/
string _ColumnName = m_ReportPageDataSet.Tables[_TableName].Columns[_FieldName].ColumnName;
string _SortOrder = _item[1].ToString();
if (!_TableSortRules.ContainsKey(_TableName))
_TableSortRules.Add(_TableName, new List<string>());
_TableSortRules[_TableName].Add(string.Format("{0} {1}", _ColumnName, _SortOrder));
}
}
//.........这里部分代码省略.........
示例2: btnLoad_Click
private void btnLoad_Click(object sender, EventArgs e)
{
if (worker.IsBusy) {
worker.CancelAsync();
return;
}
WaitDialog.Show("Generating report pages ...");
using (BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection) { CommandTimeout = 0 }) {
_efDbContext.FIUpdateContactTitles();
}
if (m_ViewConfigId < 1) {
string val = (string)ccbeSubcampaign.EditValue;
if (!string.IsNullOrEmpty(val)) {
List<int> subcampaign_ids = new List<int>();
var strVals = val.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
strVals.ForEach(delegate(string x) {
subcampaign_ids.Add(int.Parse(x));
});
this.ClearPages();
this.GenerateReportPages(subcampaign_ids.ToArray());
worker.RunWorkerAsync();
}
}
else {
List<int> subcampaign_ids = new List<int>();
subcampaign_ids.Add(m_efoViewConfig.subcampaign_id);
this.ClearPages();
this.GenerateReportPages(subcampaign_ids.ToArray(), m_efoViewConfig.id);
worker.RunWorkerAsync();
}
WaitDialog.Close();
}