public static FieldType GetFieldTypeBySQLServerTypeId(int typeId) { List <TypeMapping> mappings = SerializerHelper.DeserializeObjectFormFile <List <TypeMapping> >(Constant.SQLSERVER_TYPE_MAPPING_CONFIG); //Config<TypeMapping> config = new Config<TypeMapping>(); //List<TypeMapping> mappings = config.GetAll(); var type = mappings.FirstOrDefault(d => d.SQLServerTypeId == typeId); return(type == null ? FieldType.Text : (FieldType)type.ViewTypeId); }
public static List <Menu> GetMenus() { using (Config <Menu> config = new Config <Menu>(ActionType.Write)) { if (!config.IsExist()) { List <Menu> menus = SerializerHelper.DeserializeObjectFormFile <List <Menu> >(Constant.MENU_CONFIG_FILE); config.Create(menus); } return(config.GetAll()); } }
public static List <DatabaseType> GetDatabseTypes() { lock (mSyncroot) { using (Config <DatabaseType> config = new Config <DatabaseType>(ActionType.Write)) { if (!config.IsExist()) { List <DatabaseType> menus = SerializerHelper.DeserializeObjectFormFile <List <DatabaseType> >(Constant.DATABASE_CONFIG_FILE); config.Create(menus); } return(config.GetAll()); } } }
public List <Schedule> GetAllSchedules() { return(SerializerHelper.DeserializeObjectFormFile <List <Schedule> >(mConfigPath)); }
public static Monitor GetMonitorByType(MonitorType type) { List <Monitor> monitors = SerializerHelper.DeserializeObjectFormFile <List <Monitor> >(mConfig); return(monitors.Where(d => d.MonitorType == type).FirstOrDefault()); }