コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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>()));
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        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));
        }
コード例 #6
0
        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));
        }
コード例 #7
0
        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));
        }