public List <Views.chef> chef()
        {
            List <Views.chef> chef = new Cook.BLL.users().GetChefList();

            chef.Reverse();
            return(chef);
        }
Beispiel #2
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);
            }
        }
 public bool setInfo([FromBody] JObject json)
 {
     try
     {
         string[] skill = new string[1] {
             json["skill"].ToString()
         };
         string[] honor = new string[1] {
             json["honor"].ToString()
         };
         Cook.Model.users model = new Cook.Model.users();
         model.name      = json["name"].ToString();
         model.sex       = json["sex"].ToString();
         model.skill     = skill;
         model.honor     = honor;
         model.introdice = json["introdice"].ToString();
         model.email     = json["Email"].ToString();
         model.address   = json["address"].ToString();
         string         token = HttpContext.Current.Request.Headers["Authorization"].ToString();
         Cook.BLL.users user  = new Cook.BLL.users();
         return(user.setinfo(model, token));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Beispiel #4
0
 public List <Views.trends> trends(string pageIndex)
 {
     try
     {
         string         token = HttpContext.Current.Request.Headers["Authorization"].ToString();
         Cook.BLL.users user  = new Cook.BLL.users();
         return(user.GetTrends(new Cook.BLL.load().GetIdByToken(token), Convert.ToInt32(pageIndex), token));
     }
     catch (Exception) {
         return(new List <Views.trends>());
     }
 }
 public Views.user userinfo(int id)
 {
     try
     {
         Cook.BLL.users user = new Cook.BLL.users();
         return(user.GetUser(id.ToString()));
     }
     catch (Exception)
     {
         return(null);
     }
 }
 public Views.user userinfo()
 {
     try
     {
         string         token = HttpContext.Current.Request.Headers["Authorization"].ToString();
         Cook.BLL.users user  = new Cook.BLL.users();
         return(user.GetUser(common.getIdByToken(token)));
     }
     catch (Exception)
     {
         return(null);
     }
 }
Beispiel #7
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));
        }