Beispiel #1
0
        public static string[][] GetHibernateDM()
        {
            HibernateUtils hibernate = HibernateUtils.GetInstance();

            string[][]     array    = new string[2][];
            SoftwareConfig expanded = hibernate.FindEntityById <SoftwareConfig>("xzdmExpanded");
            SoftwareConfig selected = hibernate.FindEntityById <SoftwareConfig>("xzdmSelected");

            if (expanded == null)
            {
                array[0] = new string[0];
            }
            else
            {
                array[0] = expanded.Value.Split('、');
                //删除数据库中的,因为每次关闭软件会重新保存
                hibernate.DeleteEntity(expanded);
            }
            if (selected == null)
            {
                array[1] = new string[0];
            }
            else
            {
                array[1] = selected.Value.Split('、');
                hibernate.DeleteEntity(selected);
            }

            return(array);
        }
Beispiel #2
0
        public static SoftwareConfig FindConfig(string key)
        {
            SoftwareConfig config = hibernateUtils.FindEntityById <SoftwareConfig>(key);

            if (config == null)
            {
                return(null);
            }
            else
            {
                return(config);
            }
        }