Example #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--;
     }
 }
Example #2
0
        //吐槽
        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();
        }
Example #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);
            }
        }
Example #4
0
        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] + "  ";
            }
        }
Example #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("留言成功!");
 }
Example #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("审核已通过!");
     }
 }
Example #7
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("你可能已添加该好友,请检查后重试");
     }
 }
Example #8
0
        /// <summary>
        /// 显示窗体
        /// </summary>
        /// <param name="message">消息</param>
        /// <param name="captical">标题,默认:小提示</param>
        /// <param name="wait_time">关闭时间</param>
        public static void ShowMessage(string message, string captical = "小提示", int wait_time = 2000)
        {
            if (fp == null)
            {
                fp = new MessageYyu();    //此句完美解决窗体不显示问题(Show无效)
            }
            //显示
            fp.Location        = new Point(MousePosition.X - 40, MousePosition.Y - 190);
            fp.lbCaptical.Text = captical;
            fp.lbMessage.Text  = message;
            fp.Show();
            //定时关闭
            Timer t = new Timer();

            t.Interval = wait_time;
            t.Tick    += new EventHandler((a, b) =>
            {
                fp.Hide();
                t.Enabled = false;
            });
            t.Enabled = true;
        }
Example #9
0
 //添加好友
 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("你可能已添加该好友,请重试");
     }
 }
Example #10
0
        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("密码错误!");
        }
Example #11
0
 private void skinLabel4_Click(object sender, EventArgs e)
 {
     MessageYyu.ShowMessage("假装有个二维码");
 }
Example #12
0
 private void skinLabel3_Click(object sender, EventArgs e)
 {
     MessageYyu.ShowMessage("假装唤起了微信");
 }