Example #1
0
        public async Task DeleteSupplier(Guid id)
        {
            var modalRes = await ModalManager.ConfirmationPopup("Confirm", "Supplier will be deleted. Are you sure?");

            if (!modalRes)
            {
                return;
            }

            try
            {
                var res = await Http.PostGetBaseResponseAsync("api/supplier/delete", id);

                if (res.Success)
                {
                    SupplierList.RemoveAll(i => i.Id == id);
                    //await loadList();
                }
            }
            catch (ApiException ex)
            {
                await ModalManager.ShowMessageAsync("Error", ex.Message);
            }
            catch (Exception ex)
            {
                await ModalManager.ShowMessageAsync("An Error", ex.Message);
            }
        }
Example #2
0
        protected async Task DeleteUser(Guid id)
        {
            bool confirmed = await ModalManager.ConfirmationPopup("Confirmation", "User will be deleted. Are you sure?");

            if (!confirmed)
            {
                return;
            }

            try
            {
                bool deleted = await Client.PostGetServiceResponseAsync <bool, Guid>("api/User/Delete", id, true);

                await LoadList();
            }
            catch (ApiException ex)
            {
                await ModalManager.ShowMessageAsync("User Deletion Error", ex.Message);
            }
            catch (Exception ex)
            {
                await ModalManager.ShowMessageAsync("An Error", ex.Message);
            }
        }