Commit c2a61d9c authored by freecui's avatar freecui

创建首页功能的数据表

parent a00a176e
This diff is collapsed.
//
// GXFFunctionDB.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
#import "GXFFunction.h"
#import "GXFDisplayFunction.h"
@interface GXFFunctionDB : IBTObject
+ (GXFFunctionDB *)sharedInstance;
- (void)createTables;
//- (BOOL)functionTableCreate;
- (BOOL)displayFunctionTableCreate;
- (BOOL)insertFunction: (GXFFunction *)function ;
- (BOOL)updateFunctionHasPermissionWithId: (GXFFunction *)function;
- (BOOL)updateFunctionIsSelectedWithId: (GXFFunction *)function;
//返回全部有权限的function
- (NSArray *)functionsHasPermission;
//既有权限又被选择的
- (NSArray *)functionsHasPermissionAndIsSelected;
#pragma displayFunction
- (BOOL)insertDisplayFunction: (GXFDisplayFunction *)displayFunction;
@end
//
// GXFFunctionDB.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#define DATABASE_PATH [[NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) lastObject]stringByAppendingString:@"function.db"]
//#define DATABASE_PATH [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]stringByAppendingString:@"/weChat.db"]
//FMDB
//#define FMDBQuickCheck(SomeBool) { if (!(SomeBool)) { NSLog(@"Failure on line %d", __LINE__); abort(); } }
#import "GXFFunctionDB.h"
@interface GXFFunctionDB ()
@property (nonatomic, strong) FMDatabase *dataBase;
@end
@implementation GXFFunctionDB
+ (GXFFunctionDB *)sharedInstance {
static GXFFunctionDB *functionDb = nil;
static dispatch_once_t once;
dispatch_once(&once, ^{
functionDb = [[GXFFunctionDB alloc]init];
});
return functionDb;
}
- (BOOL)openDb {
// NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
NSString *path = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) lastObject];
NSString *dbPath = [path stringByAppendingString:@"function.db"];
self.dataBase = [FMDatabase databaseWithPath:dbPath];
CLog(@"dbPath = %@",dbPath);
BOOL isOpen = [_dataBase open];
if (!isOpen) {
NSLog(@"数据库打开失败");
}
return isOpen;
}
- (void)createTables {
if ([self openDb]) {
[self functionTableCreate];
[self displayFunctionTableCreate];
}
}
- (BOOL)functionTableCreate {
// if (![_dataBase open]) {
// [self openDb];
// }
//Id INTEGER NOT NULL PRIMARY KEY UNIQUE CONFLICT REPLACE
NSString *createTableSql = @"CREATE TABLE IF NOT EXISTS function (Id INTEGER PRIMARY KEY NOT NULL UNIQUE ,name VARCHAR,caption VARCHAR,hasPermission INTEGER,isSelected INTEGER) ";//CONFLICT REPLACE
BOOL work = [_dataBase executeUpdate:createTableSql];
return work;
}
- (BOOL)displayFunctionTableCreate {
if (![_dataBase open]) {
[self openDb];
}
NSString *createTableSql = @"CREATE TABLE IF NOT EXISTS displayFunction (Id INTEGER PRIMARY KEY AUTOINCREMENT,functionId INTEGER,functionName VARCHAR ,functionImgName VARCHAR,functionSmallImgName VARCHAR, isSelected INTEGER)";
BOOL work = [_dataBase executeUpdate:createTableSql];
return work;
}
//+(BOOL)checkTableCreatedInDb:(FMDatabase *)db
//{
// NSString *createTableSql = @"CREATE TABLE IF NOT EXISTS function (Id INTEGER PRIMARY KEY NOT NULL UNIQUE ,name VARCHAR,caption VARCHAR,hasPermission INTEGER,isSelected INTEGER) ";//CONFLICT REPLACE
// BOOL worked = [db executeUpdate:createTableSql];
// FMDBQuickCheck(worked);
// return worked;
//}
//插入数据:从最初的json文件读入时 没有任何权限跟所有的功能都没有选中
- (BOOL)insertFunction: (GXFFunction *)function {
// FMDatabase *db = [FMDatabase databaseWithPath:DATABASE_PATH];
// if (![db open]) {
// NSLog(@"数据库打开失败");
// return YES;
// };
// [GXFFunctionDB checkTableCreatedInDb:db];
NSString *inserSql = @"INSERT INTO function (Id,name,caption,hasPermission,isSelected) VALUES(?,?,?,?,?)";
BOOL work = [_dataBase executeUpdate:inserSql,@(function.Id),function.name,function.caption,@(function.hasPermission) ,@(function.isSelected)];//@(120),@"gg",@"fff",@(1),@(1)];
// [db close];
return work;
}
//更新权限
- (BOOL)updateFunctionHasPermissionWithId: (GXFFunction *)function{
BOOL work = [_dataBase executeUpdate:@"UPDATE function SET hasPermission = ? where Id = ?",function.hasPermission,function.Id];
return work;
}
//更新是否选中
- (BOOL)updateFunctionIsSelectedWithId: (GXFFunction *)function{
BOOL work = [_dataBase executeUpdate:@"UPDATE function SET isSelected = ? where Id = ?",function.isSelected,function.Id];
return work;
}
//返回全部有权限的function
- (NSArray *)functionsHasPermission {
NSMutableArray *muArr = [NSMutableArray array];
FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM function WHERE hasPermission = ?",[NSNumber numberWithBool:1]];
while ([rs next]) {
GXFFunction *function = [[GXFFunction alloc]init];
function.Id = [rs intForColumn:@"Id"];
[muArr addObject:function];
}
return muArr;
}
- (NSArray *)p_functionsIdPermission {
NSMutableArray *muArr = [NSMutableArray array];
FMResultSet *rs = [_dataBase executeQuery: @"SELECT Id FROM function WHERE hasPermission = ?",[NSNumber numberWithBool:1]];
while ([rs next]) {
NSInteger Id = [rs intForColumn:@"Id"];
[muArr addObject:@(Id)];
}
return muArr;
}
//既有权限又被选择的
- (NSArray *)functionsHasPermissionAndIsSelected{
NSMutableArray *muArr = [NSMutableArray array];
FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM function WHERE hasPermission = ?,isSelected = ?",[NSNumber numberWithBool:1],[NSNumber numberWithBool:1]];
while ([rs next]) {
GXFFunction *function = [[GXFFunction alloc]init];
function.Id = [rs intForColumn:@"Id"];
[muArr addObject:function];
}
return muArr;
}
- (NSArray *)p_functionsHasPermissionAndIsSelected{
NSMutableArray *muArr = [NSMutableArray array];
FMResultSet *rs = [_dataBase executeQuery: @"SELECT Id FROM function WHERE hasPermission = ?,isSelected = ?",[NSNumber numberWithBool:1],[NSNumber numberWithBool:1]];
while ([rs next]) {
NSInteger Id = [rs intForColumn:@"Id"];
[muArr addObject:@(Id)];
}
return muArr;
}
#pragma displayFunction
- (BOOL)insertDisplayFunction: (GXFDisplayFunction *)displayFunction {
NSString *inserSql = @"INSERT INTO displayFunction(functionId,functionName,functionImgName,functionSmallImgName) VALUES(?,?,?,?)";
BOOL work = [_dataBase executeUpdate:inserSql,@(displayFunction.functionId),displayFunction.functionName,displayFunction.functionImgName,displayFunction.functionSmallImgName];
return work;
}
- (GXFDisplayFunction *)selectDisplayFunctionByFunctionId: (NSInteger)functionId{
GXFDisplayFunction *displayFunction = [[GXFDisplayFunction alloc]init];
FMResultSet *rs = [_dataBase executeQuery:@"SELET * FROM displayFunction WHERE functionId = ? ",@(functionId)];
while ([rs next]) {
displayFunction.functionId = [rs intForColumn:@"functionId"];
displayFunction.functionName = [rs stringForColumn:@"functionName"];
displayFunction.functionImgName = [rs stringForColumn:@"functionImgName"];
displayFunction.functionSmallImgName = [rs stringForColumn:@"functionSmallImgName"];
break;
}
return displayFunction;
}
#pragma 有权限的displayfunctions
//待改正,最好的办法是两张表关联起来查找但是我还没做到
-(NSArray *)displayFunctionsHasPermission{
NSMutableArray *muArr = [NSMutableArray array];
NSArray *hasPermission = [self p_functionsIdPermission];
for (int count = 0; count < hasPermission.count; count ++) {
FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM displayFunction WHERE functionId = ?",[hasPermission[count] integerValue]];
while ([rs next]) {
GXFDisplayFunction *displayFunction = [[GXFDisplayFunction alloc]init];
displayFunction.functionId = [rs intForColumn:@"functionId"];
displayFunction.functionName = [rs stringForColumn:@"functionName"];
displayFunction.functionImgName = [rs stringForColumn:@"functionImgName"];
displayFunction.functionSmallImgName = [rs stringForColumn:@"functionSmallImgName"];
[muArr addObject:displayFunction];
}
}
return muArr;
}
@end
//
// GXFFunctionDBHelper.h
// XFFruit
//
// Created by freecui on 15/8/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFFunctionDBHelper : IBTObject
+ (instancetype)sharedInstance;
- (void)insertAllOriginFunctions;
- (void)insertAllOriginDisplayFunctions;
@end
//
// GXFFunctionDBHelper.m
// XFFruit
//
// Created by freecui on 15/8/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunctionDBHelper.h"
#import "GXFFunctionDB.h"
@interface GXFFunctionDBHelper ()
//@property (nonatomic, strong)GXFFunctionDB *functionDb;
@end
@implementation GXFFunctionDBHelper
+ (instancetype)sharedInstance{
static GXFFunctionDBHelper *dbHelper = nil;
static dispatch_once_t once;
dispatch_once(&once, ^{
dbHelper = [[GXFFunctionDBHelper alloc]init];
});
return dbHelper;
}
////开启一次就可以了
//- (void)openDb {
// self.functionDb = [GXFFunctionDB sharedInstance];
// [_functionDb functionTableCreate];
// [_functionDb displayFunctionTableCreate];
//}
- (void)insertAllOriginFunctions{
NSArray *functionsArr = [NSArray arrayWithArray:[self p_readJsonFile]];
for (int count = 0; count < functionsArr.count; count ++) {
GXFFunction *function = (GXFFunction *)functionsArr[count];
[[GXFFunctionDB sharedInstance] insertFunction:function];
}
}
//从读出的json文件返回GXFFunction数组
- (NSArray *)p_readJsonFile {
NSMutableArray *muArr = [NSMutableArray array];
NSString *path = [[NSBundle mainBundle] pathForResource:@"PermissionJson" ofType:nil];
NSData *jsonData = [NSData dataWithContentsOfFile:path options:NSDataReadingMappedIfSafe error:nil];
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:jsonData options: NSJSONReadingMutableContainers error:nil];
NSArray *childrenArr = dict[@"children"];
for (int i = 0; i < childrenArr.count; i ++) {
NSArray *permissionsArr = [childrenArr[i] objectForKey:@"permissions"];
for (int j = 0; j < permissionsArr.count; j++) {
NSMutableDictionary *muDict = [NSMutableDictionary dictionaryWithObjects:@[@(0),@(0)] forKeys:@[@"hasPermission",@"isSelected"]];
[muDict addEntriesFromDictionary:permissionsArr[j]];
GXFFunction *function = [[GXFFunction alloc]initWithDictionary:muDict];
[muArr addObject:function];
}
}
return muArr;
}
- (void)insertAllOriginDisplayFunctions{
NSArray *arr = [self p_createAllDisplayFunctions];
for (int count = 0; count < arr.count; count ++) {
GXFDisplayFunction *displayFunction = (GXFDisplayFunction *)arr[count];
[[GXFFunctionDB sharedInstance] insertDisplayFunction:displayFunction];
}
}
- (NSArray *)p_createAllDisplayFunctions{
NSArray *functionsId = @[@(500101),@(500102),@(500103),
@(500201),
@(500301),@(500302),@(500303),//"采购通知",
@(500401),@(500402),@(500403),@(500406),//"采购单"
@(500501),@(500502),@(500503),//"发运单"
@(500601),@(500602),@(500603),//"转运单"
@(500701),@(500702),@(500703),];//加工单
NSArray *functionsName = @[@"新建行情调研",@"查看行情调研", @"查看行情调研",
@"填写行情反馈",
@"新建采购通知",@"查看采购通知", @"查看采购通知",
@"新建采购单",@"查看采购单", @"查看采购单", @"审核采购单【供应商】",
@"新建发运单",@"查看发运单", @"查看发运单",
@"新增加工单",@"查看加工单", @"查看加工单",
@"新建转运单", @"查看转运单", @"查看转运单"];
NSArray *functionsImageName = @[@"create_surver",@"watch_surver", @"watch_surver",
@"create_surver_result",
@"create_needs",@"watch_needs", @"watch_needs",
@"create_purchase",@"watch_purchase", @"watch_purchase", @"review_purchase",
@"create_transport",@"watch_transort", @"watch_transort",
@"create_process",@"watch_process", @"watch_process",
@"新建转运单", @"查看转运单", @"查看转运单"];
//NSArray *functionsSmallImgName = @[];
if ((functionsId.count != functionsName.count) ||(functionsId.count != functionsImageName.count)||(functionsName.count != functionsImageName.count)) {
NSLog(@"展现功能界面:插入的数据不是一一对应的");
return nil;
}
NSMutableArray *muarr = [NSMutableArray array];
for (int count = 0; count < functionsId.count; count ++) {
GXFDisplayFunction *displayFunction = [[GXFDisplayFunction alloc]init];
displayFunction.functionId = [functionsId[count] integerValue];
displayFunction.functionName = functionsName[count];
displayFunction.functionImgName = functionsImageName[count];
//displayFunction.functionSmallImgName = fu
[muarr addObject:displayFunction];
}
return muarr;
}
@end
{
"id" : "50",
"name": "前台",
"type" : "mobileModule",
"children": [
{
"id" : "5001",
"name": "行情调研",
"type" : "mobileModule",
"permissions": [
{
"id" : "500101",
"name": "create",
"caption": "新建权"
},
{
"id" : "500102",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500103",
"name": "viewself",
"caption": "本人查看权"
}
]
},
{
"id" : "5002",
"name": "行情反馈",
"type" : "mobileModule",
"permissions": [
{
"id" : "500201",
"name": "create",
"caption": "新建权"
},
{
"id" : "500202",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500203",
"name": "viewself",
"caption": "本人查看权"
}
]
},
{
"id" : "5003",
"name": "采购通知",
"type" : "mobileModule",
"permissions": [
{
"id" : "500301",
"name": "create",
"caption": "新建权"
},
{
"id" : "500302",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500303",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500304",
"name": "accepttask",
"caption": "接受任务权"
},
{
"id" : "500305",
"name": "createpurchasebill",
"caption": "新建采购单权"
},
{
"id" : "500306",
"name": "finish",
"caption": "结束权"
}
]
},
{
"id" : "5004",
"name": "采购单",
"type" : "mobileModule",
"permissions": [
{
"id" : "500401",
"name": "create",
"caption": "新建权"
},
{
"id" : "500402",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500403",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500404",
"name": "viewvendor",
"caption": "供应商查看权"
},
{
"id" : "500405",
"name": "managerapprove",
"caption": "经理审批权"
},
{
"id" : "500406",
"name": "vendorapprove",
"caption": "供应商审批权"
},
{
"id" : "500407",
"name": "finish",
"caption": "结束权"
},
{
"id" : "500408",
"name": "abort",
"caption": "作废权"
}
]
},
{
"id" : "5005",
"name": "发运单",
"type" : "mobileModule",
"permissions": [
{
"id" : "500501",
"name": "create",
"caption": "新建权"
},
{
"id" : "500502",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500503",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500404",
"name": "finish",
"caption": "结束权"
},
{
"id" : "500505",
"name": "abort",
"caption": "作废权"
}
]
},
{
"id" : "5006",
"name": "转运单",
"type" : "mobileModule",
"permissions": [
{
"id" : "500601",
"name": "create",
"caption": "新建权"
},
{
"id" : "500602",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500603",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500604",
"name": "finish",
"caption": "结束权"
},
{
"id" : "500605",
"name": "abort",
"caption": "作废权"
}
]
},
{
"id" : "5007",
"name": "加工单",
"type" : "mobileModule",
"permissions": [
{
"id" : "500701",
"name": "create",
"caption": "新建权"
},
{
"id" : "500702",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500703",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500704",
"name": "finish",
"caption": "结束权"
},
{
"id" : "500705",
"name": "abort",
"caption": "作废权"
}
]
}
]
}
...@@ -147,7 +147,7 @@ static NSString *cellID = @"cell"; ...@@ -147,7 +147,7 @@ static NSString *cellID = @"cell";
- (void)p_contentToTableViewCell: (UITableViewCell *)cell andArray: (NSArray *)array { - (void)p_contentToTableViewCell: (UITableViewCell *)cell andArray: (NSArray *)array {
for (int count = 0; count < array.count; count ++) { for (int count = 0; count < array.count; count ++) {
GXFDisplayFunction *dFunction = (GXFDisplayFunction *)array[count]; GXFDisplayFunction *dFunction = (GXFDisplayFunction *)array[count];
cell.imageView.image = [UIImage imageNamed:dFunction.imgName]; cell.imageView.image = [UIImage imageNamed:dFunction.functionImgName];
cell.textLabel.text = dFunction.functionName; cell.textLabel.text = dFunction.functionName;
} }
} }
......
...@@ -67,7 +67,10 @@ static NSString *collectionCellID = @"collectionCell"; ...@@ -67,7 +67,10 @@ static NSString *collectionCellID = @"collectionCell";
[self setupSubviews]; [self setupSubviews];
} }
- (void)setupSubviews { - (void)setupSubviews {
[self setupRightBarBtn]; [self setupRightBarBtn];
[self setupTableView]; [self setupTableView];
...@@ -232,7 +235,7 @@ static NSString *collectionCellID = @"collectionCell"; ...@@ -232,7 +235,7 @@ static NSString *collectionCellID = @"collectionCell";
- (void)p_contentToTableViewCell: (UITableViewCell *)cell andArray: (NSArray *)array { - (void)p_contentToTableViewCell: (UITableViewCell *)cell andArray: (NSArray *)array {
for (int count = 0; count < array.count; count ++) { for (int count = 0; count < array.count; count ++) {
GXFDisplayFunction *dFunction = (GXFDisplayFunction *)array[count]; GXFDisplayFunction *dFunction = (GXFDisplayFunction *)array[count];
cell.imageView.image = [UIImage imageNamed:dFunction.imgName]; cell.imageView.image = [UIImage imageNamed:dFunction.functionSmallImgName];
cell.textLabel.text = dFunction.functionName; cell.textLabel.text = dFunction.functionName;
} }
} }
......
//
// GXFActions.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunction.h"
@implementation GXFFunction
@end
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
@interface GXFDisplayFunction : IBTObject @interface GXFDisplayFunction : IBTObject
@property (nonatomic, assign) NSInteger Id; // @property (nonatomic, assign) NSInteger Id; //
@property (nonatomic, assign) NSInteger functionId;
@property (nonatomic, copy) NSString *functionName; // @property (nonatomic, copy) NSString *functionName; //
@property (nonatomic, copy) NSString *imgName; // @property (nonatomic, copy) NSString *functionImgName; //
@property (nonatomic, copy) NSString *functionSmallImgName;
@property (nonatomic, assign) BOOL isSelected; //选中 @property (nonatomic, assign) BOOL isSelected; //选中
+ (instancetype)initClassWithDictionary: (NSDictionary *)dict; + (instancetype)initClassWithDictionary: (NSDictionary *)dict;
......
...@@ -18,7 +18,11 @@ ...@@ -18,7 +18,11 @@
if (!self) { if (!self) {
return nil; return nil;
} else { } else {
[self setValuesForKeysWithDictionary:dict]; self.Id = [dict[@"id"] integerValue];
self.functionName = dict[@"functionName"];
self.functionImgName = dict[@"imgName"];
self.isSelected = [dict[@"isSelected"] integerValue];
// [self setValuesForKeysWithDictionary:dict];
} }
return self; return self;
......
...@@ -11,9 +11,13 @@ ...@@ -11,9 +11,13 @@
@interface GXFFunction : IBTObject @interface GXFFunction : IBTObject
@property (nonatomic, assign) NSInteger Id; @property (nonatomic, assign) NSInteger Id;
@property (nonatomic, copy) NSString *name; //权限 @property (nonatomic, copy) NSString *name; //权限
@property (nonatomic, copy) NSString *captions; //权限的名称 @property (nonatomic, copy) NSString *caption; //权限的名称
@property (nonatomic, assign) BOOL hasPermission; @property (nonatomic, assign) BOOL hasPermission;
@property (nonatomic, assign) BOOL isSelected; @property (nonatomic, assign) BOOL isSelected;
//@property (nonatomic, assign) BOOL isPublic; 是否公共部分功能 //@property (nonatomic, assign) BOOL isPublic; 是否公共部分功能
+ (instancetype)initClassWithDictionary: (NSDictionary *)dict;
- (instancetype)initWithDictionary: (NSDictionary *)dict;
@end @end
//
// GXFActions.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunction.h"
@implementation GXFFunction
+ (instancetype)initClassWithDictionary:(NSDictionary *)dict {
return [self initClassWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict {
self = [super init];
if (!self) {
return nil;
} else {
self.Id = [dict[@"id"] integerValue];
self.name = dict[@"name"];
self.caption = dict[@"caption"];
self.hasPermission = [dict[@"hasPermission"] integerValue];
self.isSelected = [dict[@"isSelected"] integerValue];
// [self setValuesForKeysWithDictionary:dict];
return self;
}
}
@end
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
#import "ICRLoginViewController.h" #import "ICRLoginViewController.h"
#import "ICRLoginContentView.h" #import "ICRLoginContentView.h"
#import "GXFFunctionDB.h"
#import "GXFFunctionDBHelper.h"
#define LOGIN_CONTAINER_LEFT_MARGIN (20) #define LOGIN_CONTAINER_LEFT_MARGIN (20)
#define LOGIN_CONTAINER_HEIGHT (450) #define LOGIN_CONTAINER_HEIGHT (450)
...@@ -134,8 +137,18 @@ ...@@ -134,8 +137,18 @@
ICRAppViewControllerManager *mgr = ICRAppViewControllerManager *mgr =
[ICRAppViewControllerManager getAppViewControllerManager]; [ICRAppViewControllerManager getAppViewControllerManager];
[mgr openMainFrame]; [mgr openMainFrame];
#pragma 可以开新线程 ,待优化
//当登陆成功时就建立功能数据表
[[GXFFunctionDB sharedInstance]createTables];
//完成对初始化数据书库的操作
[[GXFFunctionDBHelper sharedInstance] insertAllOriginFunctions];
[[GXFFunctionDBHelper sharedInstance] insertAllOriginDisplayFunctions];
}; };
void(^fail)(id) = ^(id data) { void(^fail)(id) = ^(id data) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment