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

            var mimmMysqlGetFeelingByidResult = await MimmMysql.GetFeelingByid(int.Parse($"{id}"));

            feeling = mimmMysqlGetFeelingByidResult;
        }
        public async Task <Models.MimmMysql.Feeling> CancelFeelingChanges(Models.MimmMysql.Feeling item)
        {
            var entity = context.Entry(item);

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

            return(item);
        }
        public async Task <Models.MimmMysql.Feeling> CreateFeeling(Models.MimmMysql.Feeling feeling)
        {
            OnFeelingCreated(feeling);

            context.Feelings.Add(feeling);
            context.SaveChanges();

            return(feeling);
        }
        protected async System.Threading.Tasks.Task Form0Submit(MimmClientBlazor.Models.MimmMysql.Feeling args)
        {
            try
            {
                var mimmMysqlUpdateFeelingResult = await MimmMysql.UpdateFeeling(int.Parse($"{id}"), feeling);

                DialogService.Close(feeling);
            }
            catch (Exception mimmMysqlUpdateFeelingException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update Feeling");
            }
        }
        public async Task <Models.MimmMysql.Feeling> UpdateFeeling(int?id, Models.MimmMysql.Feeling feeling)
        {
            OnFeelingUpdated(feeling);

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

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

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

            await InvokeAsync(() => { StateHasChanged(); });
        }
Exemple #7
0
 protected async System.Threading.Tasks.Task Load()
 {
     feeling = new MimmClientBlazor.Models.MimmMysql.Feeling();
 }
 partial void OnFeelingUpdated(Models.MimmMysql.Feeling item);
 partial void OnFeelingGet(Models.MimmMysql.Feeling item);
 partial void OnFeelingDeleted(Models.MimmMysql.Feeling item);