示例#1
0
 // 删
 public bool Delete(W_Resources resources)
 {
     using (SqlHelper helper = WechatDataBaseHelper.Create())
     {
         int rows = helper.ExecuteNonQuery("delete from [W_Resources] where RID=@RID", new SqlParameter("@RID", resources.RID));
         return rows > 0;
     }
 }
示例#2
0
 // 改
 public bool Update(W_Resources resources)
 {
     using (SqlHelper helper = WechatDataBaseHelper.Create())
     {
         int rows = helper.ExecuteNonQuery("update [W_Resources] set CataID=@CataID,RContent=@RContent,RURL=@RURL,RHURL=@RHURL,RType=@RType,RTitle=@RTitle,RDescription=@RDescription,MediaID=@MediaID,CreateTime=@CreateTime,IsDelete=@IsDelete where RID=@RID", new SqlParameter("@RID", resources.RID), new SqlParameter("@CataID", resources.CataID), new SqlParameter("@RContent", resources.RContent), new SqlParameter("@RURL", resources.RURL), new SqlParameter("@RHURL", resources.RHURL), new SqlParameter("@RType", resources.RType), new SqlParameter("@RTitle", resources.RTitle), new SqlParameter("@RDescription", resources.RDescription), new SqlParameter("@MediaID", resources.MediaID), new SqlParameter("@CreateTime", resources.CreateTime), new SqlParameter("@IsDelete", resources.IsDelete));
         return rows > 0;
     }
 }
示例#3
0
 // 增
 public bool Add(W_Resources resources)
 {
     using (SqlHelper helper = WechatDataBaseHelper.Create())
     {
         int rows = helper.ExecuteNonQuery("insert into [W_Resources] values (@RID,@CataID,@RContent,@RURL,@RHURL,@RType,@RTitle,@RDescription,@MediaID,@CreateTime,@IsDelete)", new SqlParameter("@RID", resources.RID), new SqlParameter("@CataID", resources.CataID), new SqlParameter("@RContent", resources.RContent), new SqlParameter("@RURL", resources.RURL), new SqlParameter("@RHURL", resources.RHURL), new SqlParameter("@RType", resources.RType), new SqlParameter("@RTitle", resources.RTitle), new SqlParameter("@RDescription", resources.RDescription), new SqlParameter("@MediaID", resources.MediaID), new SqlParameter("@CreateTime", resources.CreateTime), new SqlParameter("@IsDelete", resources.IsDelete));
         return rows > 0;
     }
 }
 private void DoResources(W_Resources resources)
 {
     if (resources.RType == "text")
     {
         this.Response = new TextResult()
         {
             Content = resources.RContent
         };
     }
     else if (resources.RType == "image")
     {
         this.Response = new ImageResult()
         {
             MediaId = resources.MediaID
         };
     }
     else if (resources.RType == "voice")
     {
         this.Response = new VoiceResult()
         {
             MediaId = resources.MediaID
         };
     }
     else if (resources.RType == "video")
     {
         this.Response = new VideoResult()
         {
             Description = resources.RDescription,
             MediaId = resources.MediaID,
             Title = resources.RTitle
         };
     }
     else if (resources.RType == "music")
     {
         this.Response = new MusicResult()
         {
             Description = resources.RDescription,
             HQMusicUrl = resources.RHURL,
             MusicURL = resources.RURL,
             ThumbMediaId = resources.MediaID,
             Title = resources.RTitle
         };
     }
 }
示例#5
0
 // 改
 public bool Update(W_Resources resources)
 {
     return new W_ResourcesDAL().Update(resources);
 }
示例#6
0
 // 删
 public bool Delete(W_Resources resources)
 {
     return new W_ResourcesDAL().Delete(resources);
 }
示例#7
0
 // 增
 public bool Add(W_Resources resources)
 {
     return new W_ResourcesDAL().Add(resources);
 }