コード例 #1
0
        //int systemType, string clientId, int userId
        public override async Task <ObservableCollection <Node> > GetTableSource(Dictionary <string, object> parameterDictionary)
        {
            try
            {
                var campaignListResult = await TrackService.GetCampaigns();

                if (campaignListResult != null)
                {
                    var campaignItems = new ObservableCollection <Node>();
                    foreach (var site in campaignListResult)
                    {
                        var node = new Node {
                            Id = site.Key, Title = site.Value
                        };
                        campaignItems.Add(node);
                    }
                    TableSource = campaignItems;
                }
            }
            catch (Exception ex)
            {
                ShowMessage.Show("查询数据表出错");
                LogHelper.LogMessage(MethodBase.GetCurrentMethod().DeclaringType, LogHelper.LogLevel, "Failed to GetTableSource", ex);
            }
            finally
            {
                if (LogHelper.LogLevel == LogLevelEnum.Debug || LogHelper.LogLevel == LogLevelEnum.Info)
                {
                    LogHelper.LogMessage(MethodBase.GetCurrentMethod().DeclaringType, LogHelper.LogLevel, "GetTableSource", null);
                }
            }

            return(TableSource);
        }