Esempio n. 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            VM_WindowMain vm = new VM_WindowMain();

            Application.Current.MainWindow = vm.UIElement as Window;
            vm.Show();
            base.OnStartup(e);
        }
Esempio n. 2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            IOCContainer.InitAutofac();

            VM_WindowMain main = new VM_WindowMain();

            main.Show();

            base.OnStartup(e);
        }
Esempio n. 3
0
        public VM_PageMain(VM_WindowMain VM_WindowMain)
        {
            VM_FatherWindow = VM_WindowMain;
            //获取当前用户和权限
            var user        = db.HotelUser.OrderByDescending(t => t.id).FirstOrDefault();
            var levelPowers = db.HotelUserLevelPowers.SingleOrDefault(t => t.Level == user.Level);

            string[] s_menups   = levelPowers.MenuPowers.Split(',');
            var      menuPowers = TSqlHelp <HotelMenuPower> .SelectByModel(s_menups, "id");

            string[] s_tableps   = levelPowers.TablePowers.Split(',');
            var      tablePowers = TSqlHelp <HotelTablePower> .SelectByModel(s_tableps, "id");

            //根据menuPowers生成主页菜单
            for (int i = 0; i < menuPowers.Count(); i++)
            {
                CreateMainPageMenu(menuPowers[i], i);
            }
        }