/// <summary> /// JQResource 添加操作返回主键的编号 /// </summary> /// <param name="jqresource">JQResource实体类</param> /// <returns>执行成功返回true,否则为false</returns> public int AddByIdentity(JQResourceModel jqresource) { return dataAccess.AddByIdentity(jqresource); }
/// <summary> /// JQResource修改操作 /// </summary> /// <param name="jQRId">景区资源表Id</param> /// <param name="updateModel">要修改JQResource实体类</param> /// <returns>执行成功返回true,否则为false</returns> public bool Update(int jQRId,JQResourceModel updateModel) { return dataAccess.Update(jQRId,updateModel); }
/// <summary> ///JQResource 添加操作 /// </summary> /// <param name="jqresource">JQResource实体类</param> /// <returns>执行成功返回true,否则为false</returns> public bool Add(JQResourceModel jqresource) { return dataAccess.Add(jqresource); }
/// <summary> /// 获取实体列表 /// </summary> /// <param name="showFields">显示字段</param> /// <param name="reader">IDataReader</param> /// <returns>返回JQResource实体列表</returns> public static List<JQResourceModel> GetList(List<JQResourceFields> showFields, IDataReader reader) { List< JQResourceModel> list = new List< JQResourceModel>(); while ( reader.Read() ) { JQResourceModel jqresource= new JQResourceModel(); if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, JQResourceFields.JQRId)) && reader["JQRId"] !=DBNull.Value) { jqresource.JQRId = Convert.ToInt32(reader["JQRId"]); } if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, JQResourceFields.JQRScenicId)) && reader["JQRScenicId"] !=DBNull.Value) { jqresource.JQRScenicId = reader["JQRScenicId"].ToString(); } if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, JQResourceFields.JQRScenicName)) && reader["JQRScenicName"] !=DBNull.Value) { jqresource.JQRScenicName = reader["JQRScenicName"].ToString(); } if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, JQResourceFields.JQRScenicDecribe)) && reader["JQRScenicDecribe"] !=DBNull.Value) { jqresource.JQRScenicDecribe = reader["JQRScenicDecribe"].ToString(); } if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, JQResourceFields.JQRPrincipal)) && reader["JQRPrincipal"] !=DBNull.Value) { jqresource.JQRPrincipal = reader["JQRPrincipal"].ToString(); } if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, JQResourceFields.JQRAddress)) && reader["JQRAddress"] !=DBNull.Value) { jqresource.JQRAddress = reader["JQRAddress"].ToString(); } if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, JQResourceFields.JQRTelephone)) && reader["JQRTelephone"] !=DBNull.Value) { jqresource.JQRTelephone = reader["JQRTelephone"].ToString(); } if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, JQResourceFields.JQREmail)) && reader["JQREmail"] !=DBNull.Value) { jqresource.JQREmail = reader["JQREmail"].ToString(); } if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, JQResourceFields.JQRRowValid)) && reader["JQRRowValid"] !=DBNull.Value) { jqresource.JQRRowValid = Convert.ToByte(reader["JQRRowValid"]); } if ( (( showFields == null || showFields.Count == 0 ) || IsExistField(showFields, JQResourceFields.JQRCreateTime)) && reader["JQRCreateTime"] !=DBNull.Value) { jqresource.JQRCreateTime = Convert.ToDateTime(reader["JQRCreateTime"]); } list.Add(jqresource); } reader.Close(); return list; }
/// <summary> /// JQResource 添加操作返回主键的编号 /// </summary> /// <param name="jqresource">JQResource实体类</param> /// <param name="transaction">事务</param> /// <returns>执行成功返回true,否则为false</returns> public int AddByIdentity(JQResourceModel jqresource,DbTransaction transaction) { string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:JQResource表增加操作/File:JQResourceAccess.cs/Fun:AddByIdentity*/"; StringBuilder sql = new StringBuilder(); sql.Append(sqlDescription); sql.Append("insert ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[JQResource] (JQRScenicId,JQRScenicName,JQRScenicDecribe,JQRPrincipal,JQRAddress,JQRTelephone,JQREmail,JQRRowValid,JQRCreateTime) values(@JQRScenicId,@JQRScenicName,@JQRScenicDecribe,@JQRPrincipal,@JQRAddress,@JQRTelephone,@JQREmail,@JQRRowValid,@JQRCreateTime)"); SqlParameterWrapperCollection Collection = new SqlParameterWrapperCollection(); Collection.Add(new SqlParameterWrapper("@JQRScenicId", jqresource.JQRScenicId,SqlDbType.NVarChar)); Collection.Add(new SqlParameterWrapper("@JQRScenicName", jqresource.JQRScenicName,SqlDbType.NVarChar)); Collection.Add(new SqlParameterWrapper("@JQRScenicDecribe", jqresource.JQRScenicDecribe,SqlDbType.NVarChar)); Collection.Add(new SqlParameterWrapper("@JQRPrincipal", jqresource.JQRPrincipal,SqlDbType.NVarChar)); Collection.Add(new SqlParameterWrapper("@JQRAddress", jqresource.JQRAddress,SqlDbType.NVarChar)); Collection.Add(new SqlParameterWrapper("@JQRTelephone", jqresource.JQRTelephone,SqlDbType.NVarChar)); Collection.Add(new SqlParameterWrapper("@JQREmail", jqresource.JQREmail,SqlDbType.NVarChar)); Collection.Add(new SqlParameterWrapper("@JQRRowValid", jqresource.JQRRowValid,SqlDbType.TinyInt)); Collection.Add(new SqlParameterWrapper("@JQRCreateTime", jqresource.JQRCreateTime,SqlDbType.DateTime)); return SqlHelper.ExecuteIdentity(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig),sql.ToString(),Collection,transaction); }
/// <summary> /// JQResource修改操作 /// </summary> /// <param name="jQRId">景区资源表Id</param> /// <param name="updateModel">要修改JQResource实体类</param> /// <param name="transaction">事务</param> /// <returns>执行成功返回true,否则为false</returns> public bool Update(int jQRId,JQResourceModel updateModel,DbTransaction transaction) { string sqlDescription = "/*" + DatabaseManager.SqlDescription + "/Author:TCSmartFrameWork自动生成/For:JQResource表更新操作/File:JQResourceAccess.cs/Fun:Update*/"; StringBuilder sql = new StringBuilder(); sql.Append(sqlDescription); sql.Append("update ["+ DatabaseManager.Db_JQEBookingDataBase+"].[dbo].[JQResource] set JQRScenicDecribe=@JQRScenicDecribe,JQRPrincipal=@JQRPrincipal,JQRAddress=@JQRAddress,JQRTelephone=@JQRTelephone,JQREmail=@JQREmail,JQRRowValid=@JQRRowValid,JQRCreateTime=@JQRCreateTime where JQRId=@JQRId"); SqlParameterWrapperCollection Collection = new SqlParameterWrapperCollection(); Collection.Add(new SqlParameterWrapper("@JQRScenicDecribe", updateModel.JQRScenicDecribe,SqlDbType.NVarChar)); Collection.Add(new SqlParameterWrapper("@JQRPrincipal", updateModel.JQRPrincipal,SqlDbType.NVarChar)); Collection.Add(new SqlParameterWrapper("@JQRAddress", updateModel.JQRAddress,SqlDbType.NVarChar)); Collection.Add(new SqlParameterWrapper("@JQRTelephone", updateModel.JQRTelephone,SqlDbType.NVarChar)); Collection.Add(new SqlParameterWrapper("@JQREmail", updateModel.JQREmail,SqlDbType.NVarChar)); Collection.Add(new SqlParameterWrapper("@JQRRowValid", updateModel.JQRRowValid,SqlDbType.TinyInt)); Collection.Add(new SqlParameterWrapper("@JQRCreateTime", updateModel.JQRCreateTime,SqlDbType.DateTime)); Collection.Add(new SqlParameterWrapper("@JQRId", jQRId,SqlDbType.Int)); return SqlHelper.ExecuteNonQuery(DatabaseFactory.GetWriteDatabase(DatabaseManager.Db_JQEBookingConfig),sql.ToString(),Collection,transaction) > 0; }