/// <summary> /// 新增文字素材 /// </summary> /// <param name="conn"></param> /// <param name="model"></param> /// <returns></returns> public bool AddWXMaterialText(WXMaterialTextModel model) { using (var conn = ProcessConnection.OpenConfiguration) { return(dal.AddWXMaterialText(conn, model)); } }
/// <summary> /// 新增文字素材 /// </summary> /// <param name="conn"></param> /// <param name="model"></param> /// <returns></returns> public bool AddWXMaterialText(SqlConnection conn, WXMaterialTextModel model) { #region SQL string sql = @" INSERT INTO [Configuration].[dbo].[WXMaterialText] ( [ObjectID],[ObjectType],[Content],[OriginalID] ) VALUES ( @ObjectID,@ObjectType,@Content, @OriginalID ); SELECT CAST(SCOPE_IDENTITY() as int);"; #endregion model.PKID = conn.Query <int>(sql, model).FirstOrDefault(); if (model.PKID > 0) { return(true); } else { return(false); } }