Explorar o código

160810
modify offline import sql, rollback if execute return wrong.

Ray Zhang %!s(int64=9) %!d(string=hai) anos
pai
achega
ed09626604
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      RedAnt ERP Mobile/common/data_provider/iSalesDB.m

+ 8 - 0
RedAnt ERP Mobile/common/data_provider/iSalesDB.m

@@ -596,6 +596,8 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
 + (int) initializeDb {
     DebugLog (@"initializeDB");
     count_dbconn=0;
+    
+    
     //count_tmpdbconn=0;
     //    return false;
     //
@@ -624,6 +626,12 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
     
     sqlite3 *db = [self get_db];
     
+    
+//    int result= [iSalesDB AddExFunction:db];
+    
+//    [iSalesDB execSql:@"update model_price set price=decrypt(price);" db:db];
+    
+    
    // [self execSql:@"PRAGMA journal_mode = WAL;" db:db];
     
     NSString* create_model=@"CREATE TABLE IF NOT EXISTS model ( _id INTEGER, name VARCHAR(20,0), description VARCHAR(20,0), product_id INTEGER, color VARCHAR(20,0), legcolor VARCHAR(20,0), availability INTEGER, incoming_stock INTEGER, ETA DATE, demension VARCHAR(20,0), seat_height VARCHAR(20,0), material VARCHAR(20,0), box_dim VARCHAR(20,0), volume VARCHAR(20,0), weight VARCHAR(20,0), model_set VARCHAR(20,0), load_ability VARCHAR(20,0), default_category VARCHAR(20,0), category VARCHAR(100,0), fabric_content VARCHAR(20,0), assembling VARCHAR(20,0), made_in VARCHAR(20,0), special_remarks VARCHAR(20,0), stockUom integer, fashion VARCHAR(20,0), isnew integer, property_field VARCHAR(20,0), property_display VARCHAR(20,0), selector_field VARCHAR(20,0), selector_display VARCHAR(20,0), product_group VARCHAR(20,0), packaging VARCHAR(20,0), closeout integer ,best_seller integer,bundle_item text,alert VARCHAR(20,0),PRIMARY KEY(_id));";