public JsonResult Guanzhu(int UserB)
        {
            //Guanzhu gz = new Guanzhu();
            //gz.UserA = (int)Session["userid"];
            //gz.UserB = UserB;
            //userManager.Guanzhu(gz);
            //int a = userManager.CountGuanzhu1(UserB).Count();
            //return a;
            tip     t      = null;
            int     userid = (int)Session["userid"];
            Guanzhu gz     = new Guanzhu();
            Guanzhu g      = new Guanzhu()
            {
                UserA = userid,
                UserB = UserB
            };

            dbContext.Guanzhu.Add(g);
            try
            {
                dbContext.SaveChanges();
            }
            catch (Exception e)
            {
                throw e;
            }
            t = new tip()
            {
                message = "关注成功",
                code    = 5
            };
            return(base.Json(t));
        }
        public int QuxiaoGuanzhu(int UserB)
        {
            Guanzhu gz    = new Guanzhu();
            int     UserA = (int)Session["userid"];

            userManager.QuxiaoGuanzhu(UserA, UserB);
            int a = userManager.CountGuanzhu1(UserB).Count();

            return(a);
        }
Beispiel #3
0
 //关注
 public void Guanzhu(Guanzhu us)
 {
     dbContext.Guanzhu.Add(us);
     dbContext.SaveChanges();
 }
Beispiel #4
0
 //关注
 public void Guanzhu(Guanzhu us)
 {
     iuser.Guanzhu(us);
 }