public int Delete <T>(T entity) { StringBuilder builder = DatabaseCommon.DeleteSql <T>(entity); DbParameter[] parameter = DatabaseCommon.GetParameter <T>(entity); return(DbHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), parameter)); }
public int Delete(string tableName, Hashtable ht, DbTransaction isOpenTrans) { StringBuilder builder = DatabaseCommon.DeleteSql(tableName, ht); DbParameter[] parameter = DatabaseCommon.GetParameter(ht); return(DbHelper.ExecuteNonQuery(isOpenTrans, CommandType.Text, builder.ToString(), parameter)); }
public int Delete <T>(T entity, DbTransaction isOpenTrans) { StringBuilder builder = DatabaseCommon.DeleteSql <T>(entity); DbParameter[] parameter = DatabaseCommon.GetParameter <T>(entity); return(DbHelper.ExecuteNonQuery(isOpenTrans, CommandType.Text, builder.ToString(), parameter.ToArray <DbParameter>())); }
public int Insert(string tableName, Hashtable ht, DbTransaction isOpenTrans) { object obj2 = 0; StringBuilder builder = DatabaseCommon.InsertSql(tableName, ht); DbParameter[] parameter = DatabaseCommon.GetParameter(ht); obj2 = DbHelper.ExecuteNonQuery(isOpenTrans, CommandType.Text, builder.ToString(), parameter); return(Convert.ToInt32(obj2)); }
public int Insert <T>(T entity, DbTransaction isOpenTrans) { object obj2 = 0; StringBuilder builder = DatabaseCommon.InsertSql <T>(entity); DbParameter[] parameter = DatabaseCommon.GetParameter <T>(entity); obj2 = DbHelper.ExecuteNonQuery(isOpenTrans, CommandType.Text, builder.ToString(), parameter); return(Convert.ToInt32(obj2)); }
public int Update(string tableName, Hashtable ht, string propertyName) { object obj2 = 0; StringBuilder builder = DatabaseCommon.UpdateSql(tableName, ht, propertyName); DbParameter[] parameter = DatabaseCommon.GetParameter(ht); obj2 = DbHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), parameter); return(Convert.ToInt32(obj2)); }
public int Update <T>(T entity) { object obj2 = 0; StringBuilder builder = DatabaseCommon.UpdateSql <T>(entity); DbParameter[] parameter = DatabaseCommon.GetParameter <T>(entity); obj2 = DbHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), parameter); return(Convert.ToInt32(obj2)); }