コード例 #1
0
 private void btnNext_Click(object sender, EventArgs e)
 {
     if ((sender as Button).Name == "btnNext")
     {
         if (pageIndex * 30 >= count)
         {
             MessageYyu.ShowMessage("已到达最底部");
             return;
         }
         Load_DataSource();
         //当前页加一
         pageIndex++;
     }
     else
     {
         if (pageIndex <= 1)
         {
             MessageYyu.ShowMessage("已到达第一页");
             return;
         }
         Load_DataSource();
         //当前页减一
         pageIndex--;
     }
 }
コード例 #2
0
ファイル: F_CookieInfo.cs プロジェクト: qzsysly/DontStarve
        //吐槽
        private void btnComplain_Click(object sender, EventArgs e)
        {
            F_SimplyReply fs = new F_SimplyReply();

            fs.Text  = "                          吐槽一下~~~~";
            fs.func += new Func <bool>(() =>
            {
                if (!string.IsNullOrEmpty(fs.txtContent.Text))
                {
                    bool result = icookcommentInfoService.AddEntity(new cookcommentinfo()
                    {
                        Guid_id = Guid.NewGuid(),
                        CookId  = current_cookie.Guid_id,
                        UserId  = F_Main.current_user.Guid_id,
                        Content = fs.txtContent.Text
                    });
                    if (result)
                    {
                        //显示提示
                        MessageYyu.ShowMessage("评论成功!");
                        fs.Close();
                        return(true);
                    }
                    MessageYyu.ShowMessage("评论失败,请重试");
                }
                return(false);
            });
            fs.ShowDialog();
            //刷新
            Load_cookie_comment();
        }
コード例 #3
0
        private void btnShare_Click(object sender, EventArgs e)
        {
            //检查
            //.................
            //取值
            saysayinfo entity = new saysayinfo();

            entity.Guid_id         = Guid.NewGuid();
            entity.UserId          = F_Main.current_user.Guid_id;
            entity.Content         = txtContent.Text;
            entity.Subtime         = Common.CommonHelper.GetCurrentDateStamp();
            entity.IsAllUserCanSee = cbIsPublic.Checked;
            if (pic.Image != null)
            {
                entity.Pic = Common.CommonHelper.PicToBytes(pic.Image);
            }
            if (isaysayInfoService.AddEntity(entity))
            {
                MessageYyu.ShowMessage("添加成功", "提示");
                DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                MessageBox.Show("添加失败", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
コード例 #4
0
ファイル: F_OneDayOneCate.cs プロジェクト: qzsysly/DontStarve
        private void F_OneDayOneCate_Load(object sender, EventArgs e)
        {
            //加载背景图
            this.SkinBack = Image.FromFile("imgpng/taco.png");

            //数据库加载数据
            long currentStamp = Common.CommonHelper.GetCurrentDateStamp(DateTime.Today);
            var  entity       = ieverydayrecommendInfoService.LoadEntities(er => er.RecommendTime == currentStamp).FirstOrDefault();

            if (entity == null)
            {
                MessageYyu.ShowMessage("今天小编还没更新推荐呢~\r\n先看一下最近更新的吧~~亲", "", 5000);    //这里不知道为什么不能使用MessageBox.show(),使用了就显示不出来窗体了。
                entity = ieverydayrecommendInfoService.LoadEntities(er => er.RecommendTime == 1488988800).FirstOrDefault();
            }
            this.Tag = entity.cookinfo; //存实例
            if (entity.cookinfo.pic != null)
            {
                pic.Image = Common.CommonHelper.BytesToPic(entity.cookinfo.pic);
            }
            lbName.Text       = entity.cookinfo.Name;
            lbReason.Text     = entity.Reason;
            lbOurRatings.Text = "推荐指数:";
            for (int i = 0; i < Convert.ToInt16(entity.OurRatings); i++)
            {
                lbOurRatings.Text += "★";
            }
            var cates = entity.cookinfo.categoryinfo.Select(c => c.Name).ToArray();

            lbCategory.Text = "分类:";
            for (int i = 0; i < cates.Length; i++)
            {
                lbCategory.Text += cates[i] + "  ";
            }
        }
コード例 #5
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     ileavenoteInfoService.AddEntity(new Model.leavenoteinfo()
     {
         Context = txtContent.Text,
         Subtime = Common.CommonHelper.GetCurrentDateStamp(),
         UserId  = F_Main.current_user.Guid_id
     });
     MessageYyu.ShowMessage("留言成功!");
 }
コード例 #6
0
 //审核通过
 private void toolItem_pass_Click(object sender, EventArgs e)
 {
     if (dgvCookie.SelectedRows.Count > 0)
     {
         var cookie = dgvCookie.SelectedRows[0].DataBoundItem as Model.cookinfo;
         cookie.DelFlag = false; //删除标志
         icookieInfoService.EditEntity(cookie);
         MessageYyu.ShowMessage("审核已通过!");
     }
 }
コード例 #7
0
ファイル: F_Login.cs プロジェクト: qzsysly/DontStarve
 private void btnLogin_Click(object sender, EventArgs e)
 {
     F_Main.current_user = iuserInfoService.Login(txtName.Text, Common.HashHelper.GetMD5(txtPwd.Text));
     if (F_Main.current_user != null)
     {
         this.DialogResult = DialogResult.OK;
     }
     else
     {
         MessageYyu.ShowMessage("帐号或密码错误");
         System.Threading.Thread.Sleep(2000);
     }
 }
コード例 #8
0
 //加好友
 private void lbStrangerName_Click(object sender, EventArgs e)
 {
     try
     {
         ifriendInfoService.AddEntity(new friendinfo()
         {
             FriendId = (Guid)lbStrangerName.Tag,
             UserId   = F_Main.current_user.Guid_id,
             SubTime  = Common.CommonHelper.GetCurrentDateStamp()
         });
         MessageYyu.ShowMessage("添加好友成功");
     }
     catch
     {
         MessageYyu.ShowMessage("你可能已添加该好友,请检查后重试");
     }
 }
コード例 #9
0
ファイル: F_Friend.cs プロジェクト: qzsysly/DontStarve
 //添加好友
 private void lbSearchFriendList_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         if (lbSearchFriendList.SelectedItems.Count > 0)
         {
             var s = lbSearchFriendList.SelectedItems[0] as SkinListBoxItem;
             ifriendInfoService.AddEntity(new friendinfo()
             {
                 FriendId = (Guid)s.Tag,
                 UserId   = F_Main.current_user.Guid_id,
                 SubTime  = Common.CommonHelper.GetCurrentDateStamp()
             });
             MessageBoxEx.Show("添加成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             Async_LoadFriend(); //刷新好友列表
         }
     }
     catch
     {
         MessageYyu.ShowMessage("你可能已添加该好友,请重试");
     }
 }
コード例 #10
0
ファイル: F_AdminLogin.cs プロジェクト: qzsysly/DontStarve
        private IService.IUserInfoService iuserInfoService = new Service.UserInfoService();//(IService.IUserInfoService)Common.SpringIocHelper.GetObject("iuserInfoService");

        private void btnLogin_Click(object sender, EventArgs e)
        {
            F_Main.current_user = iuserInfoService.Login(txtName.Text, Common.HashHelper.GetMD5(txtPwd.Text));
            //判断账号密码是否正确
            if (F_Main.current_user != null)
            {
                //判断是否具有 管理权限
                if (F_Main.current_user.roleinfo.Count > 0)
                {
                    this.Visible = false;
                    F_AdminMain f_am = new F_AdminMain();
                    f_am.ShowDialog();
                    return;
                }
                else
                {
                    MessageYyu.ShowMessage("抱歉您尚没有此操作的权限", "警告");
                    return;
                }
            }
            MessageYyu.ShowMessage("密码错误!");
        }
コード例 #11
0
 private void skinLabel4_Click(object sender, EventArgs e)
 {
     MessageYyu.ShowMessage("假装有个二维码");
 }
コード例 #12
0
 private void skinLabel3_Click(object sender, EventArgs e)
 {
     MessageYyu.ShowMessage("假装唤起了微信");
 }