Ejemplo n.º 1
0
        public object GetQueryNumOfCourse(String classId)
        {
            var query = new BmobQuery();

            query.Limit(300);
            query.WhereEqualTo("classId", classId);
            var        query1   = new BmobQuery();
            HttpCookie cookie1  = HttpContext.Current.Request.Cookies["CurrentCourse"];
            String     Id       = cookie1["CourseId"];
            int        courseId = int.Parse(Id);

            query1.WhereEqualTo("courseId", courseId);
            query = query.And(query1);
            query.OrderByDescending("totalNum");
            var future = Bmob.FindTaskAsync <Feedback>("Feedback", query);

            try
            {
                feedbackList = future.Result.results;
                foreach (var f in feedbackList)     //由于BmobModel中有BmobInt类型不能直接显示到页面中,所以需要对字段的类型进行处理,变为相对应的ViewModel格式。
                {
                    Feedback_View feedback_view = new Feedback_View();
                    feedback_view.objectId = f.objectId;
                    feedback_view.username = f.username;
                    feedback_view.nickname = f.nickname;
                    feedback_view.totalNum = f.totalNum.Get();
                    fList.Add(feedback_view);
                }
                return(ResultToJson.toJson(fList));
            }
            catch
            {
                return("获取失败");
            }
        }
Ejemplo n.º 2
0
        public IList <TB_TechniqueLog> FindLogInvertedUpdateData(int limit)
        {
            BmobQuery query = new BmobQuery();

            query.OrderByDescending("updatedAt");
            return(FindByQuery(query, limit));
        }
Ejemplo n.º 3
0
    /// <summary>
    /// 读取金币记录
    /// </summary>
    public void loadJinBI()
    {
        this.Items.Clear();
        BmobQuery query = new BmobQuery();

        query.WhereEqualTo("jieShouUserId", JYCaoZuo.getCaoZuo().user.userId);
        query.OrderByDescending("createdAt");
        query.Limit(50);
        bmob.Find <message>("message", query, (resp, exception) =>
        {
            if (exception != null)
            {
                JYCaoZuo.getCaoZuo().showMessagem("查询异常" + exception.Message);

                return;
            }
            JYCaoZuo.getCaoZuo().showMessagem("查 结果" + resp);
            this.page.Dispatcher.BeginInvoke(delegate
            {
                foreach (message li in resp.results)
                {
                    JYJinBiJiLuMode mode = new JYJinBiJiLuMode();
                    mode.MessgeType      = li.messgeType;
                    mode.SendUserId      = li.sendUserId;
                    mode.JieShouUserId   = li.jieShouUserId;
                    mode.Title           = li.title;
                    mode.Content         = li.content;
                    mode.CreatTime       = li.createdAt;
                    mode.objiectId       = li.objectId;
                    // liShiJiLu li = resp.results[0];
                    this.Items.Add(mode);
                }
            });
        });
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 寻找数据根据条件
    /// </summary>
    private IEnumerator FindByCondition(string score, Action action = null)
    {
        BmobQuery query = new BmobQuery();

        //设置最多返回20条记录
        query.Limit(20);
//        //条件 大于500的
//        query.WhereGreaterThan(score, 500);
        //降序排列
        query.OrderByDescending(score);

        bool isFindOver = false;

        GameStart.instance.StartCoroutine(BmobManager.Instance.ConditionFind <BmobTab_RankingList>(query, BmobTab_RankingList.TABLENAME,
                                                                                                   (List <BmobTab_RankingList> list, bool isOver) =>
        {
            mPlayerInfoList = list;
            isFindOver      = true;
            Debug.Log("找到了数据");
        }));
        while (!isFindOver)
        {
            yield return(new WaitForSeconds(0.1f));
        }
        if (action != null)
        {
            action();
        }
        if (mPlayerInfoList == null)
        {
            mPlayerInfoList = new List <BmobTab_RankingList>();
        }
    }
Ejemplo n.º 5
0
    /// <summary>
    /// 寻找数据根据条件
    /// </summary>
    private IEnumerator FindByCondition()
    {
        BmobQuery query = new BmobQuery();

        query.WhereGreaterThan("PlayerScore", 500);
        query.OrderByDescending("PlayerScore");
        bool isFindOver = false;

        StartCoroutine(BmobManager.Instance.ConditionFind <BmobTab_RankingList>(query, BmobTab_RankingList.TABLENAME,
                                                                                (List <BmobTab_RankingList> list, bool isOver) =>
        {
            mPlayerInfoList = list;
            isFindOver      = isOver;
        }));


        while (!isFindOver)
        {
            Debug.Log("list is null");
            yield return(0);
        }
        if (isFindOver)
        {
            for (int i = 0; i < mPlayerInfoList.Count; i++)
            {
//                Debug.Log(mPlayerInfoList[i].objectId + "  " + mPlayerInfoList[i].id + "  " + mPlayerInfoList[i].playerName + "  " + mPlayerInfoList[i].score);
            }
        }
    }
Ejemplo n.º 6
0
        public IList <TB_TechniqueLog> FindByMissionID(string missionID, bool SortDatedesc = true)
        {
            BmobQuery query = new BmobQuery();

            query.WhereEqualTo("MissionID", missionID);
            query.OrderByDescending("Date");
            return(FindByQuery(query));
        }
Ejemplo n.º 7
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);
                }
            });
        });
    }
Ejemplo n.º 8
0
        public void freashData()
        {
            itemsForShangJin.Clear();
            BmobWindowsPhone bmob = JYCaoZuo.getCaoZuo().bmob;


            BmobQuery que = new BmobQuery();

            que.WhereEqualTo("isJinYan", 0);
            que.WhereEqualTo("renWuId", renWuid);
            que.OrderByDescending("createdAt");
            //   que.Skip(3);
            que.Limit(40);
            bmob.Find <RenWuHuiFu>("RenWuHuiFu", que, (respon, exc) => {
                if (exc != null)
                {
                    //    JYCaoZuo.getCaoZuo().showMessagemBox("回复出错");
                    return;
                }
                if (respon.results.Count > 0)
                {
                    this.Dispatcher.BeginInvoke(delegate {
                        foreach (RenWuHuiFu re in respon.results)
                        {
                            HuiFuMode mo = new HuiFuMode();
                            mo.NiCheng   = re.huiFuNiCheng;
                            mo.Content   = re.huiFuContet;
                            mo.UserId    = re.huiFuUserId;
                            itemsForShangJin.Add(mo);
                        }
                    });
                }
                else
                {
                    //无人评论
                }
            });
        }
Ejemplo n.º 9
0
    /// <summary>
    /// Ranks the data.
    /// </summary>
    void RankData()
    {
        //设置获取表的属性
        BmobQuery queryData = new BmobQuery();

        queryData.OrderByDescending("coin");
        queryData.Limit(10);

        //获取对应的表的内容
        Bmob.Find <BmobGameObject>(TABLENAME, queryData,
                                   (response, exception) => {
            if (exception != null)
            {
                print("数据列表获取失败" + exception);

                return;
            }

            print("数据列表获取成功");

            List <BmobGameObject> list = response.results;

            foreach (var data in list)
            {
                print(data);

                //生成数据列表
                GameObject rankDataUI              = Instantiate(rankDataPrefab);
                rankDataUI.transform.parent        = rankDataParent;
                rankDataUI.transform.localRotation = rankDataPrefab.transform.localRotation;
                rankDataUI.transform.localScale    = Vector3.one;
                rankDataUI.GetComponent <RankDataAttr>().userNmaeText.text = data.userName;
                rankDataUI.GetComponent <RankDataAttr>().coinText.text     = data.coin.ToString();
            }
        }
                                   );
    }
Ejemplo n.º 10
0
    //---------------------------------------------------------

    /// <summary>
    /// 查询排名数据
    /// </summary>
    public static void DownloadRankList()
    {
        //bmobQuery用于查询相关
        BmobQuery bmobQuery = new BmobQuery();

        //以分数来从高到低排序
        bmobQuery.OrderByDescending("score");
        //只查询前七名
        bmobQuery.Limit(7);

        bmobUnity.Find <Rank>("RankTable", bmobQuery, (resp, exception) =>
        {
            if (exception != null)
            {
                print("查询失败,失败原因为:" + exception.Message);
                return;
            }
            GameData.rankList = resp.results;

            LoadingNetwork.isDoneLoading = true;

            Debug.Log("查询完毕");
        });
    }