Ejemplo n.º 1
0
 public ISysPrefsRepository sysPrefsRepository()
 {
     if (_SysPrefsRepository == null)
     {
         _SysPrefsRepository = new SysPrefsRepository(_Context, _Logger, this);
     }
     return(_SysPrefsRepository);
 }
Ejemplo n.º 2
0
/*
 *      public string ModalTitle = "Saving Status";
 *      public string ModalMessage = "System Preferences Saved";
 *
 *      private Modal modalRef;
 *
 *      private void ShowModal()
 *      {
 *          modalRef.Show();
 *      }
 *
 *      private void HideModal()
 *      {
 *          modalRef.Hide();
 *      }
 */
        private async Task LoadSysPrefs()
        {
            ISysPrefsRepository _SysPref = _AppUnitOfWork.sysPrefsRepository();

            StateHasChanged();
            await Task.Run(() => SysPrefsModel = _SysPref.GetSysPrefs());

            IsSaved = false;
            StateHasChanged();
        }
Ejemplo n.º 3
0
        public async void HandleValidSubmit()
        {
            if (SysPrefsModel != null)
            {
                ShowSaving();
                ISysPrefsRepository _SysPref = _AppUnitOfWork.sysPrefsRepository();
                // save
                bool _Saved = await _SysPref.UpdateSysPreferencesAsync(SysPrefsModel);

                if (!_Saved)
                {
                    ShowSavedStatus.UpdateModalMessage("Error saving preferences");
                }
                else
                {
                    ShowSavedStatus.ShowModal();
                }

                HideSaving();
                //ShowModal();
                StateHasChanged();
            }
        }