Example #1
0
        /**********  事件处理方法 **************/
        /// <summary>
        /// 关注时候的操作
        /// </summary>
        private void Subscribe()
        {
            if (IsExistUser())
                return;
            UserInOrOut userInorOutModel = GetUserInModel();

            UserInfoBll userBll = new UserInfoBll();
            UserInfo user = userBll.GetUserInfo(userInorOutModel.userId);
            userInorOutModel.userName = user.nickname;

            UserInOrOutBll userInOrOutBll = new UserInOrOutBll();
            userInOrOutBll.Add(userInorOutModel);

            user = new UserInfo();
            user = userBll.GetUserInfo(userInorOutModel.userId);
            userBll.Add(user);
        }
Example #2
0
        /// <summary>
        /// 取消关注的方法
        /// </summary>
        private void UnSubscribe()
        {
            UserInOrOut userInorOutModel = GetUserOutModel();

            UserInfo user = new UserInfo();
            user.openid = userInorOutModel.userId;

            UserInfoBll userBll = new UserInfoBll();
            DataTable userTable = userBll.GetUserTable(user);

            userInorOutModel.userName = userTable.Rows[0]["nickname"].ToString();
            userInorOutModel.groupID = userTable.Rows[0]["groupId"].ToString();
            userInorOutModel.groupName = userTable.Rows[0]["groupName"].ToString();
            UserInOrOutBll userInOrOutBll = new UserInOrOutBll();
            userInOrOutBll.Add(userInorOutModel);

            user = new UserInfo();
            user.openid = userInorOutModel.userId;
            userBll.Del(user);
        }
Example #3
0
 /****** 获取用户关注、退出关注的信息model **************/
 private bool IsExistUser()
 {
     UserInfo user = new UserInfo();
     var root = doc.DocumentElement;
     user.openid = root.SelectSingleNode("FromUserName").InnerText;
     UserInfoBll userBll = new UserInfoBll();
     return userBll.IsExist(user);
 }