Пример #1
0
        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);
        }
Пример #2
0
 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());
     }
 }
Пример #3
0
 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());
         }
     }
 }
Пример #4
0
 public List <Schedule> GetAllSchedules()
 {
     return(SerializerHelper.DeserializeObjectFormFile <List <Schedule> >(mConfigPath));
 }
Пример #5
0
        public static Monitor GetMonitorByType(MonitorType type)
        {
            List <Monitor> monitors = SerializerHelper.DeserializeObjectFormFile <List <Monitor> >(mConfig);

            return(monitors.Where(d => d.MonitorType == type).FirstOrDefault());
        }