protected async System.Threading.Tasks.Task Load()
        {
            canEdit = true;

            var mimmMysqlGetTrackByidResult = await MimmMysql.GetTrackByid(int.Parse($"{id}"));

            track = mimmMysqlGetTrackByidResult;
        }
        public async Task <Models.MimmMysql.Track> CancelTrackChanges(Models.MimmMysql.Track item)
        {
            var entity = context.Entry(item);

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

            return(item);
        }
        public async Task <Models.MimmMysql.Track> CreateTrack(Models.MimmMysql.Track track)
        {
            OnTrackCreated(track);

            context.Tracks.Add(track);
            context.SaveChanges();

            return(track);
        }
        protected async System.Threading.Tasks.Task Form0Submit(MimmClientBlazor.Models.MimmMysql.Track args)
        {
            try
            {
                var mimmMysqlUpdateTrackResult = await MimmMysql.UpdateTrack(int.Parse($"{id}"), track);

                DialogService.Close(track);
            }
            catch (Exception mimmMysqlUpdateTrackException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update Track");
            }
        }
        public async Task <Models.MimmMysql.Track> UpdateTrack(int?id, Models.MimmMysql.Track track)
        {
            OnTrackUpdated(track);

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

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

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

            await InvokeAsync(() => { StateHasChanged(); });
        }
 partial void OnTrackUpdated(Models.MimmMysql.Track item);
 partial void OnTrackGet(Models.MimmMysql.Track item);
 partial void OnTrackDeleted(Models.MimmMysql.Track item);
示例#10
0
 protected async System.Threading.Tasks.Task Load()
 {
     track = new MimmClientBlazor.Models.MimmMysql.Track();
 }