Exemple #1
0
        protected async System.Threading.Tasks.Task Load()
        {
            canEdit = true;

            var mimmMysqlGetAlbumByidResult = await MimmMysql.GetAlbumByid(int.Parse($"{id}"));

            album = mimmMysqlGetAlbumByidResult;
        }
        public async Task <Models.MimmMysql.Album> CreateAlbum(Models.MimmMysql.Album album)
        {
            OnAlbumCreated(album);

            context.Albums.Add(album);
            context.SaveChanges();

            return(album);
        }
        public async Task <Models.MimmMysql.Album> CancelAlbumChanges(Models.MimmMysql.Album item)
        {
            var entity = context.Entry(item);

            entity.CurrentValues.SetValues(entity.OriginalValues);
            entity.State = EntityState.Unchanged;

            return(item);
        }
        protected async System.Threading.Tasks.Task Form0Submit(MimmClientBlazor.Models.MimmMysql.Album args)
        {
            try
            {
                var mimmMysqlCreateAlbumResult = await MimmMysql.CreateAlbum(album);

                DialogService.Close(album);
            }
            catch (Exception mimmMysqlCreateAlbumException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to create new Album!");
            }
        }
        public async Task <Models.MimmMysql.Album> UpdateAlbum(int?id, Models.MimmMysql.Album album)
        {
            OnAlbumUpdated(album);

            var item = context.Albums
                       .Where(i => i.id == id)
                       .First();
            var entry = context.Entry(item);

            entry.CurrentValues.SetValues(album);
            entry.State = EntityState.Modified;
            context.SaveChanges();

            return(album);
        }
Exemple #6
0
        protected async System.Threading.Tasks.Task Grid0RowSelect(MimmClientBlazor.Models.MimmMysql.Album args)
        {
            var result = await DialogService.OpenAsync <EditAlbum>("Edit Album", new Dictionary <string, object>() { { "id", args.id } });

            await InvokeAsync(() => { StateHasChanged(); });
        }
 partial void OnAlbumCreated(Models.MimmMysql.Album item);
 partial void OnAlbumGet(Models.MimmMysql.Album item);
 partial void OnAlbumDeleted(Models.MimmMysql.Album item);
 protected async System.Threading.Tasks.Task Load()
 {
     album = new MimmClientBlazor.Models.MimmMysql.Album();
 }