public void OnSetAccent(string cmdPrm)
        {
            try
            {
                var tmpAccent = ThemeManager.Accents.FirstOrDefault(x => x.Name == cmdPrm);
                var tmpTheme  = ThemeManager.DetectAppStyle().Item1;

                ThemeManager.ChangeAppStyle(System.Windows.Application.Current, tmpAccent, tmpTheme);
            }
            catch
            {
                _dialogs.DisplayErrorDialog("Unable To update the application's accent color", string.Empty);
                return;
            }
        }
        public void OnLogon()
        {
            //if (string.IsNullOrEmpty(UserName))
            //{
            //    _dialogs.DisplayErrorDialog("Username is Required", string.Empty);
            //    return;
            //}

            //if (string.IsNullOrEmpty(Password))
            //{
            //    _dialogs.DisplayErrorDialog("Password is Required", string.Empty);
            //    return;
            //}

            IsLoading(true);
            //Attempt logon
            var res = _service.Login(LogonReq);

            IsLoading(false);

            if (res.Success)
            {
            }
            else
            {
                _dialogs.DisplayErrorDialog(res.Status);
            }
        }
Ejemplo n.º 3
0
        public void OnSave()
        {
            if (NewPassword != ConfirmPassword)
            {
                _dialogs.DisplayErrorDialog("Password Mismatch", "New Password and Confirm Password does not Match");
                return;
            }

            IsLoading(true);
            //save
            IsLoading(false);
        }
        public void OnMenu(string cmdPrm)
        {
            var selectedMenu = new MenuSelection();

            try
            {
                selectedMenu = (MenuSelection)Enum.Parse(typeof(MenuSelection), cmdPrm);
            }
            catch
            {
                _dialogs.DisplayErrorDialog("Unable To Parse Menu", "The selected menu option " + cmdPrm + " was not found. Please contact the developer.");
                return;
            }

            //if (string.IsNullOrEmpty(App.Current.Properties["LoginUser"].ToSafeString()))
            //{
            //    _dialogs.DisplayErrorDialog("Please log in", string.Empty);
            //    return;
            //}

            //if (!HasPermissions((int)selectedMenu))
            //{
            //    _dialogs.DisplayNoPermissionDialog();
            //    return;
            //}

            switch (selectedMenu)
            {
            case MenuSelection.LogOn:
                ShowWindow(new LogonView(), "Log On", ResizeMode.NoResize);
                break;

            case MenuSelection.LogOff:
                break;

            case MenuSelection.ChangePassword:
                ShowWindow(new ChangePasswordView(), "Change Password", ResizeMode.NoResize);
                break;

            case MenuSelection.Personalization:
                ShowWindow(new PersonalizationView(), "Personalization", ResizeMode.NoResize);
                break;

            case MenuSelection.Restart:
                Process.Start(Application.ResourceAssembly.Location);
                Application.Current.Shutdown();
                return;

            case MenuSelection.ShutDown:
                Application.Current.Shutdown();
                return;

            case MenuSelection.RoomManagement:
                break;

            case MenuSelection.ReserveaRoom:
                break;

            case MenuSelection.BlackList:
                break;

            case MenuSelection.ManageOtherUsers:
                break;

            case MenuSelection.Users:
                break;

            case MenuSelection.ManagePermissions:
                ShowWindow(new PermissionsView(), "Permissions", ResizeMode.NoResize);
                break;


            default:
                break;
            }
            ;
        }