Esempio n. 1
0
        /// <summary>
        /// 同意添加好友
        /// </summary>
        /// <returns></returns>
        public JsonResult AddFriend()
        {
            RequestUser();
            if (resultData.res == 500)
            {
                return(Json(resultData));
            }
            int      userid         = us.ID;
            string   loginid        = us.LoginID;
            int      friendsid      = int.Parse(GetParams("friendsid"));
            string   name           = GetParams("name");
            int      friendtypeid   = int.Parse(GetParams("friendtypeid"));
            int      friendgroupsid = int.Parse(GetParams("friendgroupsid"));
            string   notes          = GetParams("notes");
            int      status         = 0;
            DateTime time           = DateTime.Now.AddDays(7);
            bool     flag           = ub.AddFirend(userid, friendsid, name, friendtypeid, friendgroupsid, status, time, notes);

            if (!flag)
            {
                resultData.res = 500;
                resultData.msg = "同意添加好友失败";
            }
            bool s = ub.EditFirends(userid, friendsid);

            if (!s)
            {
                resultData.res = 500;
                resultData.msg = "同意添加好友失败";
            }
            int    messagestypeid = 1;
            string msg            = "您的好友申请已通过";

            Chat.SendMsgSystem(userid, loginid, friendsid, msg, messagestypeid);
            resultData.msg = "同意添加好友成功";
            return(Json(resultData));
        }