コード例 #1
0
ファイル: FunnyBusiness.cs プロジェクト: hhy5277/JustSay
        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
ファイル: ConfessBusiness.cs プロジェクト: hhy5277/JustSay
        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));
        }