Ejemplo n.º 1
0
        public async void Create()
        {
            try
            {
                Acr.UserDialogs.UserDialogs.Instance.ShowLoading(AppResource.alertLoading);



                CategoryGroup group = new CategoryGroup();


                group.Name           = txtName.Text;
                group.IsDisabled     = !swtActive.IsToggled;
                group.CompanyId      = Helpers.Settings.DisplayUserCompany;
                group.CategoryId     = categoryId;
                group.OrderingNumber = Convert.ToInt32(txtPosition.Text);
                group.MenuType       = _type;

                var result = await companyService.CreateCategoryGroup(group);

                Acr.UserDialogs.UserDialogs.Instance.Toast(AppResource.lblItemCreatedSucess);
                await App.AppCurrent.NavigationService.GoBack();
            }
            catch (Exception ex)
            {
                this.DisplayAlert(MocoApp.Resources.AppResource.alertAlert, ex.Message, AppResource.textOk);
            }
            finally
            {
                Acr.UserDialogs.UserDialogs.Instance.HideLoading();
            }
        }