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

            var mimmMysqlGetArtistByidResult = await MimmMysql.GetArtistByid(int.Parse($"{id}"));

            artist = mimmMysqlGetArtistByidResult;
        }
        public async Task <Models.MimmMysql.Artist> CancelArtistChanges(Models.MimmMysql.Artist item)
        {
            var entity = context.Entry(item);

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

            return(item);
        }
        public async Task <Models.MimmMysql.Artist> CreateArtist(Models.MimmMysql.Artist artist)
        {
            OnArtistCreated(artist);

            context.Artists.Add(artist);
            context.SaveChanges();

            return(artist);
        }
Example #4
0
        protected async System.Threading.Tasks.Task Form0Submit(MimmClientBlazor.Models.MimmMysql.Artist args)
        {
            try
            {
                var mimmMysqlUpdateArtistResult = await MimmMysql.UpdateArtist(int.Parse($"{id}"), artist);

                DialogService.Close(artist);
            }
            catch (Exception mimmMysqlUpdateArtistException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update Artist");
            }
        }
        public async Task <Models.MimmMysql.Artist> UpdateArtist(int?id, Models.MimmMysql.Artist artist)
        {
            OnArtistUpdated(artist);

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

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

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

            await InvokeAsync(() => { StateHasChanged(); });
        }
 partial void OnArtistUpdated(Models.MimmMysql.Artist item);
 partial void OnArtistGet(Models.MimmMysql.Artist item);
 partial void OnArtistDeleted(Models.MimmMysql.Artist item);
Example #10
0
 protected async System.Threading.Tasks.Task Load()
 {
     artist = new MimmClientBlazor.Models.MimmMysql.Artist();
 }