//int systemType, string clientId, int userId
        public override async Task<ObservableCollection<Node>> GetTableSource(Dictionary<string, object> parameterDictionary)
        {
            try
            {
                var campaignListResult = await TrackRealtimeService.GetCampaigns();
                if(campaignListResult != null)
                {
                    var campaignItems = new ObservableCollection<Node>();
                    foreach(var campaign in campaignListResult)
                    {
                        var node = new Node { Id = campaign.Key, Title = campaign.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;
        }
Exemplo n.º 2
0
        private ObservableCollection<Node> GetIncome()
        {
            var incomeItems = new ObservableCollection<Node>();
            var none = new Node { Id = "1", Title = "没有收入", IsSelected = false };
            incomeItems.Add(none);
            var lowest = new Node { Id = "2", Title = "人民币1000元以下", IsSelected = false };
            incomeItems.Add(lowest);

            for (int index = 3; index <= 12; index++)
            {
                var id = index.ToString();
                var minIncome = (index - 1) * 500;
                var maxIncome = index * 500 - 1;
                var title = "人民币" + minIncome + "-" + maxIncome + "元";
                var lower = new Node { Id = id, Title = title, IsSelected = false };
                incomeItems.Add(lower);
            }

            for (int index = 13; index <= 16; index++)
            {
                var id = index.ToString();
                var minIncome = (index - 7) * 1000;
                var maxIncome = (index - 6) * 1000 - 1;
                var title = "人民币" + minIncome + "-" + maxIncome + "元";
                var higher = new Node { Id = id, Title = title, IsSelected = false };
                incomeItems.Add(higher);
            }

            var higher1 = new Node { Id = "17", Title = "人民币10000-11999元", IsSelected = false };
            incomeItems.Add(higher1);

            var higher2 = new Node { Id = "18", Title = "人民币12000-14999元", IsSelected = false };
            incomeItems.Add(higher2);

            var higher3 = new Node { Id = "19", Title = "人民币15000-19999元", IsSelected = false };
            incomeItems.Add(higher3);

            var highest = new Node { Id = "20", Title = "人民币20000元以上", IsSelected = false };
            incomeItems.Add(highest);

            return incomeItems;
        }
Exemplo n.º 3
0
        private ObservableCollection<Node> GetMarriage()
        {
            var marriageItems = new ObservableCollection<Node>();
            var none = new Node { Id = "1", Title = "未婚", IsSelected = false };
            marriageItems.Add(none);
            var noChild = new Node { Id = "2", Title = "已婚无小孩", IsSelected = false };
            marriageItems.Add(noChild);
            var hasChild = new Node { Id = "3", Title = "已婚有小孩", IsSelected = false };
            marriageItems.Add(hasChild);
            var divorce = new Node { Id = "4", Title = "离异", IsSelected = false };
            marriageItems.Add(divorce);
            var other = new Node { Id = "5", Title = "其他", IsSelected = false };
            marriageItems.Add(other);

            return marriageItems;
        }
Exemplo n.º 4
0
        private ObservableCollection<Node> GetEduction()
        {
            var eductionItems = new ObservableCollection<Node>();
            var none = new Node { Id = "1", Title = "未受过正式教育", IsSelected = false };
            eductionItems.Add(none);
            var primary = new Node { Id = "2", Title = "小学", IsSelected = false };
            eductionItems.Add(primary);
            var junior = new Node { Id = "3", Title = "初中", IsSelected = false };
            eductionItems.Add(junior);
            var senior = new Node { Id = "4", Title = "高中", IsSelected = false };
            eductionItems.Add(senior);
            var technical = new Node { Id = "5", Title = "中专", IsSelected = false };
            eductionItems.Add(technical);
            var juniorCollege = new Node { Id = "6", Title = "专科", IsSelected = false };
            eductionItems.Add(juniorCollege);
            var college = new Node { Id = "7", Title = "本科", IsSelected = false };
            eductionItems.Add(college);
            var master = new Node { Id = "8", Title = "硕士", IsSelected = false };
            eductionItems.Add(master);
            var doctor = new Node { Id = "9", Title = "博士及其以上", IsSelected = false };
            eductionItems.Add(doctor);
            var refusal = new Node { Id = "10", Title = "拒绝回答", IsSelected = false };
            eductionItems.Add(refusal);

            return eductionItems;
        }
Exemplo n.º 5
0
        private ObservableCollection<Node> GetZone()
        {
            var zoneItems = new ObservableCollection<Node>();
            var beijing = new Node { Id = "1", Title = "北京", IsSelected = false };
            zoneItems.Add(beijing);
            var shanghai = new Node { Id = "2", Title = "上海", IsSelected = false };
            zoneItems.Add(shanghai);
            var chengdu = new Node { Id = "3", Title = "成都", IsSelected = false };
            zoneItems.Add(chengdu);
            var tianjin = new Node { Id = "4", Title = "天津", IsSelected = false };
            zoneItems.Add(tianjin);
            var guangzhou = new Node { Id = "5", Title = "广州", IsSelected = false };
            zoneItems.Add(guangzhou);
            var shenzhen = new Node { Id = "6", Title = "深圳", IsSelected = false };
            zoneItems.Add(shenzhen);
            var nanjing = new Node { Id = "7", Title = "南京", IsSelected = false };
            zoneItems.Add(nanjing);
            var hangzhou = new Node { Id = "8", Title = "杭州", IsSelected = false };
            zoneItems.Add(hangzhou);
            var wuhan = new Node { Id = "9", Title = "武汉", IsSelected = false };
            zoneItems.Add(wuhan);
            var shenyang = new Node { Id = "10", Title = "沈阳", IsSelected = false };
            zoneItems.Add(shenyang);

            return zoneItems;
        }
Exemplo n.º 6
0
        private ObservableCollection<Node> GetGender()
        {
            var genderItems = new ObservableCollection<Node>();
            var man = new Node { Id = "1", Title = "男", IsSelected = false };
            genderItems.Add(man);

            var woman = new Node { Id = "2", Title = "女", IsSelected = false };
            genderItems.Add(woman);
            return genderItems;
        }