Esempio n. 1
0
        public async Task SaveAuthorAsync()
        {
            Author.City = _selectedCity;
            Author savedAuthor;

            if (Author.AuthorId > 0)
            {
                savedAuthor = await BookStoreService.UpdateAsync("authors", Author.AuthorId, Author);
            }
            else
            {
                savedAuthor = await BookStoreService.SaveAsync("authors", Author);
            }
            Result     = savedAuthor != null ? true : false;
            IsVisible  = true;
            RecordName = Author.FirstName + " " + Author.LastName;
            await LoadAuthors();

            Author = new Author();
            await JSRuntime.InvokeVoidAsync("setFocus", firstNameRef);
        }
Esempio n. 2
0
        protected async Task SavePublisherAsync()
        {
            Publisher.City = _selectedCity;
            Publisher savedPublisher;

            if (Publisher.PubId > 0)
            {
                savedPublisher = await BookStoreService.UpdateAsync("publishers", Publisher.PubId, Publisher);
            }
            else
            {
                savedPublisher = await BookStoreService.SaveAsync("publishers", Publisher);
            }

            Result     = savedPublisher == null ? false : true;
            RecordName = Publisher.PublisherName;
            IsVisible  = true;
            await LoadPublishers();

            var name = Publisher.PublisherName;

            Publisher = new Publisher();
            await JSRuntime.InvokeVoidAsync("setFocus", publisherNameRef);
        }