Example #1
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);
                }
            });
        });
    }
Example #2
0
 /// <summary>
 /// 单利模式
 /// </summary>
 /// <returns></returns>
 public static JYCaoZuo getCaoZuo()
 {
     if (caoZuo == null)
     {
         caoZuo = new JYCaoZuo();
     }
     return(caoZuo);
 }
Example #3
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);
                }
            });
        });
    }
Example #4
0
        // 构造函数
        public MainPage()
        {
            InitializeComponent();


            string bmobId = "2bf438a29c5411c813e6e50a1aedfd0c";

            JYCaoZuo.getCaoZuo().page = this;
            JYCaoZuo.getCaoZuo().init(bmobId);


            // 用于本地化 ApplicationBar 的示例代码
            //BuildLocalizedApplicationBar();
            string daiMa = "int i = 0;while(i<100){ i = i+1;write(i);}";

            //使用方法
            //1语义分析
            LexicalAnalysis la = new LexicalAnalysis();

            string        outStr  = la.Analyze(daiMa);
            List <object> errList = la.errlist;

            Debug.WriteLine(outStr);


            Analysis ciFaFenXi = new Analysis();

            //判断语义是否有误
            if (ciFaFenXi.syntaxAalysis(la))
            {
            }
            else
            {
                Debug.WriteLine(ciFaFenXi.errInfo.ToString());
            }
            //2 执行算法
            MidCode m0 = new MidCode(ciFaFenXi);

            m0.Scan();
            Interpret runner = new Interpret();

            runner.GetRun(m0.c);
            //得到结果
            string jieGuo = runner.jieGuo;

            Debug.WriteLine(jieGuo);

            m0.clear();
        }
Example #5
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //执行结果
            //使用方法
            //1语义分析

            string daiMa = txtForDaiMa.Text;

            JYCaoZuo.getCaoZuo().addaoZuo("点击了执行代码:" + daiMa);
            LexicalAnalysis la = new LexicalAnalysis();

            string        outStr  = la.Analyze(daiMa);
            List <object> errList = la.errlist;

            Debug.WriteLine(outStr);


            Analysis ciFaFenXi = new Analysis();

            //判断语义是否有误
            if (ciFaFenXi.syntaxAalysis(la))
            {
            }
            else
            {
                txtForJieGuo.Text = ciFaFenXi.errInfo.ToString() + "\n" + outStr;
                Debug.WriteLine(ciFaFenXi.errInfo.ToString());
                return;
            }
            //2 执行算法
            MidCode m0 = new MidCode(ciFaFenXi);

            m0.Scan();
            Interpret runner = new Interpret();

            runner.GetRun(m0.c);
            //得到结果
            string jieGuo = runner.jieGuo;

            Debug.WriteLine(jieGuo);
            txtForJieGuo.Text = jieGuo + "\n" + outStr;

            m0.clear();
            JYCaoZuo.getCaoZuo().addaoZuo("点击了执行代码:" + daiMa + ",结果:" + txtForJieGuo.Text);
        }
Example #6
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            JYCaoZuo.getCaoZuo().addaoZuo("点击了建议回馈");
            //建议回馈
            if (txtContent.Text.Length < 6)
            {
                MessageBox.Show("您的建议太过简短,不能说明详细的问题,请多写点哦。");
                return;
            }
            //建议回馈
            if (txtForQQ.Text.Length < 6)
            {
                MessageBox.Show("您的联系方式可能不正确,将会导致我们得知您的反馈却无法反馈,请填写联系您的信息。");
                return;
            }

            JYCaoZuo.getCaoZuo().addJianYI(txtContent.Text, txtForQQ.Text);
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            JYCaoZuo.getCaoZuo().addaoZuo("任务评价页面 评价");

            if (txtForHuiFu.Text.Length < 3)
            {
                MessageBox.Show("评价内容太短啦");
                return;
            }

            if (JYCaoZuo.getCaoZuo().user.isJinYan == 1)
            {
                MessageBox.Show("您已被禁言!");
                JYCaoZuo.getCaoZuo().addaoZuo("任务评价页面 评价--被禁言");
                return;
            }

            RenWuHuiFu re = new RenWuHuiFu();

            re.renWuId      = renWuid;
            re.huiFuContet  = txtForHuiFu.Text;
            re.huiFuNiCheng = JYCaoZuo.getCaoZuo().user.niCheng;
            re.huiFuUserId  = JYCaoZuo.getCaoZuo().user.userId;
            re.isJinYan     = JYCaoZuo.getCaoZuo().user.isJinYan;
            re.zhiChi       = 0;

            BmobWindowsPhone bmob = JYCaoZuo.getCaoZuo().bmob;

            bmob.Create("RenWuHuiFu", re, (respon, exc) => {
                if (exc != null)
                {
                    return;
                }
                JYCaoZuo.getCaoZuo().showMessagemBox("回复成功,您的评论等待审核通过就能出现在评论列表。");
                this.Dispatcher.BeginInvoke(delegate {
                    freashData();
                });
            });
        }
        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
                {
                    //无人评论
                }
            });
        }
Example #9
0
 private void ApplicationBarMenuItem_Click_2(object sender, EventArgs e)
 {
     //给我建议
     JYCaoZuo.getCaoZuo().addaoZuo("给我建议");
     this.NavigationService.Navigate(new Uri("/JYJianYiPage.xaml", UriKind.Relative));
 }
Example #10
0
 private void ApplicationBarIconButton_Click_2(object sender, EventArgs e)
 {
     //交流区
     JYCaoZuo.getCaoZuo().addaoZuo("交流区");
     this.NavigationService.Navigate(new Uri("/shangJin/JYRenWuPingJiaPage.xaml?renWuid=代码交流", UriKind.Relative));
 }
Example #11
0
 public MainViewModel()
 {
     bmob            = JYCaoZuo.getCaoZuo().bmob;
     this.Items      = new ObservableCollection <JYJinBiJiLuMode>();
     itemsForDuiHuan = new ObservableCollection <JYDuiHuanJiLuModel>();
 }