예제 #1
0
        public override Funny Add(Funny entity)
        {
            if (HotConfig.IsReviewFunny == 1)
            {
                entity.Status = 0;
            }
            else
            {
                entity.Status = 3;
            }
            Member userInfo = MemberBusiness.GetUserInfo();

            entity.ShowName = userInfo.ShowName;
            entity.MemberID = userInfo.ID;
            entity.Time     = DateTime.Now;
            if (HttpContext.Current.Request.Files.Count > 0)
            {
                HttpPostedFile img = HttpContext.Current.Request.Files[0];
                entity.ImgUrl = ImageProccess.CompressImageProccess(img.InputStream, HttpContext.Current.Server.MapPath("~"), "www.justsay.cn|爱情点滴");
            }
            entity.Time = DateTime.Now;
            IMemberBusiness iMember = new MemberBusiness(db);

            iMember.AwardScore(10);
            return(base.Add(entity));
        }
예제 #2
0
        public override Confess Add(Confess entity)
        {
            if (HttpContext.Current.Request.Files.Count > 0)
            {
                HttpPostedFile img = HttpContext.Current.Request.Files[0];
                entity.ImgUrl = ImageProccess.CompressImageProccess(img.InputStream, HttpContext.Current.Server.MapPath("~"), UIConfig.WaterMark);
            }
            Member userInfo = MemberBusiness.GetUserInfo();

            entity.ShowName = userInfo.ShowName;
            entity.MemberID = userInfo.ID;
            entity.Time     = DateTime.Now;
            return(base.Add(entity));
        }
예제 #3
0
        public override Relation Add(Relation entity)
        {
            if (string.IsNullOrEmpty(entity.ToPhone))
            {
                entity.ToPhone = "";
            }
            if (string.IsNullOrEmpty(entity.FromPhone))
            {
                entity.FromPhone = "";
            }
            Member userInfo = MemberBusiness.GetUserInfo();

            entity.ShowName = userInfo.ShowName;
            entity.MemberID = userInfo.ID;
            entity.Time     = DateTime.Now;
            return(base.Add(entity));
        }
예제 #4
0
        public override Comment Add(Comment entity)
        {
            entity.Time = DateTime.Now;
            Member userInfo = MemberBusiness.GetUserInfo();

            entity.ShowName = userInfo.ShowName;
            entity.MemberID = userInfo.ID;
            IFunnyBusiness iFunny = new FunnyBusiness(db);

            entity.Funny = iFunny.GetDetail(entity.FunnyID);
            entity.Funny.CommentCount += 1;

            IMemberBusiness iMember = new MemberBusiness(db);

            iMember.AwardScore(2);
            return(base.Add(entity));
        }
예제 #5
0
        /// <summary>
        /// 优先从cookie中取到数据
        /// </summary>
        /// <returns></returns>
        public static Member GetUserInfo()
        {
            string showname;//显示名
            string email;
            Member member = new Member();

            if ((member.ID = CookieHelper.VerifyUser(out showname, out email)) > 0)
            {
                member.Email    = email;
                member.ShowName = showname;
            }
            else
            {
                IMemberBusiness iMember = new MemberBusiness(new JustSayEntities());
                member.ID = Convert.ToInt32(HttpContext.Current.User.Identity.Name);
                member    = iMember.GetDetail(member.ID);
            }
            return(member);
        }
예제 #6
0
        public override Message Add(Message entity)
        {
            Member userInfo = MemberBusiness.GetUserInfo();

            entity.FromName = userInfo.ShowName;
            entity.FromID   = userInfo.ID;
            entity.Time     = DateTime.Now;
            IMemberBusiness iMember = new MemberBusiness(db);

            if (HotConfig.IsControlMessage == 1)
            {
                iMember.UpdataPostTime();
            }
            //To
            entity.Member1 = iMember.GetDetail(entity.ToID);
            entity.Member1.MessageCount += 1;
            entity.IsNew = true;
            return(base.Add(entity));
        }