Ejemplo n.º 1
0
        protected async override void OnInitialized()
        {
            CurrID = Guid.Empty;

            if (LocalData.componentBridge != null)
            {
                LocalData.componentBridge.OnRefresh = CmdRefresh;
                LocalData.componentBridge.OnConfirm = CmdActualDelete;
            }


            if (LocalData.IsAuthenticated)
            {
                await CmdGetAllCategories();
            }
            else
            {
                LocalFunctions.CmdNavigate();

                LocalFunctions.AddMessage("Please login", true, false);
            }


            base.OnInitialized();
        }
Ejemplo n.º 2
0
        private async void CmdActualDelete()
        {
            if (LocalData.EventConsumerName.Equals("CategoriesPage"))
            {
                if (LocalData.TSCategoriesList.Any())
                {
                    string a = await WebApiFunctions.CmdDeleteCategory(LocalData.TSCategoriesList.Single(x => x.ID == CurrID));

                    if (a.Equals("OK"))
                    {
                        LocalData.TSCategoriesList       = new List <TSCategoryEx>();
                        LocalData.TSCategoriesDictionary = new Dictionary <Guid, string>();

                        LocalData.btModal.Close();

                        LocalFunctions.CmdNavigate("CategoriesPage");
                        LocalData.componentBridge.InvokeRefresh();
                    }
                    else
                    {
                        LocalFunctions.AddError(a, MethodBase.GetCurrentMethod(), true, false);
                    }
                }
            }
        }
 private void CmdPrintClick()
 {
     LBDLocalData.ShouldCallPrintDialog = true;
     LBDLocalData.IsLayoutVisible       = false;
     LBDLocalData.mainLayout.Refresh();
     LocalFunctions.CmdNavigate("print");
 }
        protected override void OnInitialized()
        {
            if (!LocalData.IsAuthenticated)
            {
                LocalFunctions.CmdNavigate();

                LocalFunctions.AddMessage("Please login", true, false);
            }

            base.OnInitialized();
        }
        public async void ComboUILanguageSelectionChanged()
        {
            //BTodosJsInterop.Log("======aaaaaaa=====");
            //var results = await LocalData.indexDbManager.GetRecords<TSUILanguage>("UILanguages");
            //foreach (var item in results)
            //{
            //    BTodosJsInterop.Log(item.Name);
            //    await LocalData.indexDbManager.DeleteRecord("UILanguages", item);
            //}

            //BTodosJsInterop.Log("done");
            //// await LocalData.indexDbManager.ClearStore("UILanguages");

            ////  await LocalData.indexDbManager.ClearStore("UILangDict");

            //return;


            LocalData.uiTranslator.CurrUILanguage = LocalData.uiTranslator.TSUILanguagesList[LocalData.uiTranslator.ComboUILanguagesSelectedIndex];


            if (!LocalData.uiTranslator.CurrUILanguage.Code.Equals("en", StringComparison.InvariantCultureIgnoreCase))
            {
                await LocalFunctions.GetUILangDict();

                //BTodosJsInterop.Log("====================");

                //foreach (var item in LocalData.TSUIWordForeignsList)
                //{
                //    BTodosJsInterop.Log(item.Word);
                //}
            }


            if (LocalData.IsAuthenticated)
            {
                LocalFunctions.CmdNavigate("DesktopPage");
            }
            else
            {
                LocalFunctions.CmdNavigate();
            }


            LocalData.uiTranslator.OnUILanguageChanged?.Invoke();

            LocalData.compHeader.Refresh();



            StateHasChanged();
        }
Ejemplo n.º 6
0
        private void ContextMenuOnClick(int id)
        {
            if (id == 1)
            {
                LocalFunctions.CmdNavigate("ProfilePage");
            }
            else
            {
                if (LocalData.bcMenu.Name.Equals("Logout"))
                {
                    LocalFunctions.Logout();
                }
            }

            LocalFunctions.ContextMenu_Hide();
        }
Ejemplo n.º 7
0
        private async void CmdActualDelete()
        {
            if (LocalData.EventConsumerName.Equals("TodosPage"))
            {
                if (LocalData.TsTodosList.Any())
                {
                    string a = await WebApiFunctions.CmdDeleteTodo(LocalData.TsTodosList.Single(x => x.ID == CurrID));

                    if (a.Equals("OK"))
                    {
                        LocalData.TsTodosList = new List <TSTodoEx>();

                        LocalFunctions.CmdNavigate("TodosPage");
                        LocalData.componentBridge.InvokeRefresh();
                    }
                    else
                    {
                        LocalFunctions.AddError(a, MethodBase.GetCurrentMethod(), true, false);
                    }
                }
            }
        }
Ejemplo n.º 8
0
 public void CmdOnClick(MouseEventArgs e)
 {
     LocalFunctions.CmdNavigate(desktopItem.NavigateTo);
 }
 public void CmdAddCategory()
 {
     LocalFunctions.CmdNavigate("CategoriesPage");
     LocalData.btModal.Close();
 }
 protected void CmdViewWordsList(string LangName)
 {
     LocalFunctions.CmdNavigate(@"UIWordsListPage\" + LangName);
     LocalFunctions.ConsolePrint(LangName);
 }