Exemplo n.º 1
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));
        }
Exemplo n.º 2
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));
        }