//
//  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 ;
- (GXFFunction *)functionSelectWithId: (NSInteger)Id;
- (BOOL)updateFunctionHasPermissionWithId: (GXFFunction *)function;
- (BOOL)updateFunctionIsSelectedWithId: (GXFFunction *)function;
- (NSArray *)originFunctions;
//返回全部有权限的function
- (NSArray *)functionsHasPermission;
//既有权限又被选择的
- (NSArray *)functionsHasPermissionAndIsSelected;

- (void)deleteTables;


#pragma displayFunction
- (BOOL)insertDisplayFunction: (GXFDisplayFunction *)displayFunction;
- (BOOL)updateDisplayFunctionIsSelectedWithId: (GXFDisplayFunction *)displayFunction;
-(NSArray *)displayFunctionsHasPermission;
//默认配置显示功能  初始配置为
- (NSArray *)defaultdisplayFunctions;
- (NSArray *)originDisplayFunctions;
- (NSArray *)isSelectedDisplayFunctions;
@end
