Exemplo n.º 1
0
        public ResponseContext <bool> AddOrUpdateImage(ImgGalleryEntity request)
        {
            bool success = true;

            if (request.ImgId <= 0)
            {
                request.CreateTime = DateTime.Now;
                request.ModifyTime = DateTime.Now;
                success            = sysDal.IndertImageGallery(request);
            }
            else
            {
                request.ModifyTime = DateTime.Now;
                success            = sysDal.UpdateImageGallery(request);
            }

            if (success)
            {
                return(new ResponseContext <bool>(success));
            }
            else
            {
                return(new ResponseContext <bool>(false, ErrCodeEnum.InnerError, success));
            }
        }
Exemplo n.º 2
0
 public bool UpdateShortUrl(ImgGalleryEntity req)
 {
     using (var Db = GetDbConnection())
     {
         var sql = @"UPDATE dbo.gallery_ImgGallery
                        SET ShortUrl = @ShortUrl
                           , ModifyUserId = @ModifyUserId
                           , ModifyTime = @ModifyTime
                      WHERE ImgId = @ImgId";
         return(Db.Execute(sql, req) > 0);
     }
 }
Exemplo n.º 3
0
 public bool UpdateImageGallery(ImgGalleryEntity req)
 {
     using (var Db = GetDbConnection())
     {
         var sql = @"UPDATE dbo.gallery_ImgGallery
                        SET ImgName = @ImgName
                           , Remark = @Remark
                           , ModifyUserId = @ModifyUserId
                           , ModifyTime = @ModifyTime
                      WHERE ImgId = @ImgId";
         return(Db.Execute(sql, req) > 0);
     }
 }
Exemplo n.º 4
0
        public ResponseContext <bool> UpdateShortUrl(ImgGalleryEntity request)
        {
            DeleteLocalImage(request.ImgId);
            request.ModifyTime = DateTime.Now;
            bool success = sysDal.UpdateShortUrl(request);

            if (success)
            {
                return(new ResponseContext <bool>(success));
            }
            else
            {
                return(new ResponseContext <bool>(false, ErrCodeEnum.InnerError, success));
            }
        }
Exemplo n.º 5
0
 public bool IndertImageGallery(ImgGalleryEntity req)
 {
     using (var Db = GetDbConnection())
     {
         var sql = @"INSERT INTO dbo.gallery_ImgGallery
                            (ImgName
                            ,ShortUrl
                            ,Remark
                            ,CreateUserId
                            ,ModifyUserId
                            ,CreateTime
                            ,ModifyTime)
                      VALUES
                            (@ImgName
                            ,@ShortUrl
                            ,@Remark
                            ,@CreateUserId
                            ,@ModifyUserId
                            ,@CreateTime
                            ,@ModifyTime)";
         return(Db.Execute(sql, req) > 0);
     }
 }