Exemple #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));
        }
Exemple #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));
        }
Exemple #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));
        }
Exemple #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));
        }
Exemple #5
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));
        }