コード例 #1
0
    public void loadDuiHuanList()
    {
        this.itemsForDuiHuan.Clear();
        BmobQuery query = new BmobQuery();

        query.OrderByDescending("createdAt");
        query.WhereEqualTo("duiHuanType", 1);
        BmobQuery query2 = new BmobQuery();

        query2.WhereEqualTo("duiHuanType", 0);
        query.Or(query2);
        // query.WhereEqualTo("duiHuan", JYCaoZuo.getCaoZuo().user.userId);
        query.Limit(10);
        bmob.Find <duiHuan>("duiHuan", query, (resp, exception) =>
        {
            if (exception != null)
            {
                JYCaoZuo.getCaoZuo().showMessagem("查询异常" + exception.Message);

                return;
            }
            JYCaoZuo.getCaoZuo().showMessagem("查 结果" + resp);
            this.page.Dispatcher.BeginInvoke(delegate
            {
                foreach (duiHuan li in resp.results)
                {
                    JYDuiHuanJiLuModel duicell = new JYDuiHuanJiLuModel();
                    try
                    {
                        duicell.userId = li.userId;
                        duicell.name   = "*" + li.shiMing.Substring(1, li.shiMing.Length - 1);
                        duicell.qq     = li.qq;

                        string type = "无";
                        if (li.duiHuanType == 0)
                        {
                            type = "等待发货";
                        }
                        if (li.duiHuanType == 1)
                        {
                            type = "已发货";
                        }

                        duicell.content = int.Parse(li.jinE) / 10.0 + "元" + "(" + type + "--" + li.createdAt + ")";

                        duicell.likeNumber = "+" + li.likeNumber;
                        duicell.objictId   = li.objectId;
                    }
                    catch { }
                    this.itemsForDuiHuan.Add(duicell);
                }
            });
        });
    }