コード例 #1
0
        public bool addfollow([FromBody] JObject json)
        {
            string token = HttpContext.Current.Request.Headers["Authorization"].ToString();

            if (new Cook.BLL.users().addfollow(common.getIdByToken(token)))
            {
                //添加到about
                string[] info = new Cook.BLL.users().getuserinfo(token);

                Cook.Model.aboutMe_ model = new Cook.Model.aboutMe_();
                model.sourceId   = Convert.ToInt32(info[0]);
                model.sourceName = info[1];
                model.time       = json["time"].ToString();
                string id = json["id"].ToString();
                new Cook.BLL.follow_().addfoll(model, id);

                //改follow
                Cook.Model.follow_ collect = new Cook.Model.follow_();
                collect.id   = Convert.ToInt32(json["id"]);
                collect.time = json["time"].ToString();
                return(new Cook.BLL.follow_().add(collect, token));
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
ファイル: follow_.cs プロジェクト: liangzuan1983/cookServer
 public bool addfoll(Cook.Model.aboutMe_ model, string tableid)
 {
     try
     {
         return(new Cook.DAL.aboutMe_().addfollow(model, tableid));
     }
     catch (Exception)
     {
         return(false);
     }
 }
コード例 #3
0
        public bool discuss([FromBody] JObject json)
        {
            string token = HttpContext.Current.Request.Headers["Authorization"].ToString();

            string[] info = new Cook.BLL.users().getuserinfo(token);

            Cook.Model.aboutMe_ model = new Cook.Model.aboutMe_();
            model.sourceId   = Convert.ToInt32(info[0]);
            model.sourceName = info[1];
            model.time       = json["time"].ToString();
            model.targetId   = Convert.ToInt32(json["targetid"]);
            model.targetName = json["targetname"].ToString();
            model.content    = json["content"].ToString();
            string id = model.targetId.ToString();

            return(new Cook.BLL.discuss_().addDis(model, id));
        }
コード例 #4
0
ファイル: discuss_.cs プロジェクト: liangzuan1983/cookServer
 //tableid 教程id
 //添加对教程的评论
 public bool addDis(Cook.Model.aboutMe_ model, string tableid)
 {
     try
     {
         string authorid         = new Cook.DAL.course().getAuthorByid(tableid);
         Cook.Model.discuss_ dis = new Model.discuss_();
         dis.id      = model.sourceId;
         dis.content = model.content;
         dis.type    = "0";
         dis.time    = model.time;
         if (Add(dis, tableid))
         {
             return(new aboutMe_().addContent(model, authorid));
         }
         else
         {
             return(false);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
コード例 #5
0
ファイル: discuss_.cs プロジェクト: liangzuan1983/cookServer
 public bool addDis(Cook.Model.aboutMe_ model, string tableid)
 {
     return(new DAL.discuss_().addDis(model, tableid));
 }