public async Task <Models.ConData.State> CancelStateChanges(Models.ConData.State item)
        {
            var entity = context.Entry(item);

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

            return(item);
        }
        public async Task <Models.ConData.State> CreateState(Models.ConData.State state)
        {
            OnStateCreated(state);

            context.States.Add(state);
            context.SaveChanges();

            return(state);
        }
예제 #3
0
        protected async System.Threading.Tasks.Task Form0Submit(FemiFriendsApp.Models.ConData.State args)
        {
            try
            {
                var conDataUpdateStateResult = await ConData.UpdateState(StateID, state);

                DialogService.Close(state);
            }
            catch (System.Exception conDataUpdateStateException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update State");
            }
        }
        public async Task <Models.ConData.State> UpdateState(int?stateId, Models.ConData.State state)
        {
            OnStateUpdated(state);

            var item = context.States
                       .Where(i => i.StateID == stateId)
                       .FirstOrDefault();

            if (item == null)
            {
                throw new Exception("Item no longer available");
            }
            var entry = context.Entry(item);

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

            return(state);
        }
예제 #5
0
        protected async System.Threading.Tasks.Task Load()
        {
            var conDataGetStateByStateIdResult = await ConData.GetStateByStateId(StateID);

            state = conDataGetStateByStateIdResult;
        }
예제 #6
0
        protected async System.Threading.Tasks.Task Grid0RowSelect(FemiFriendsApp.Models.ConData.State args)
        {
            var dialogResult = await DialogService.OpenAsync <EditState>("Edit State", new Dictionary <string, object>() { { "StateID", args.StateID } });

            await InvokeAsync(() => { StateHasChanged(); });
        }
 protected async System.Threading.Tasks.Task Load()
 {
     state = new FemiFriendsApp.Models.ConData.State()
     {
     };
 }
 partial void OnStateUpdated(Models.ConData.State item);
 partial void OnStateGet(Models.ConData.State item);
 partial void OnStateDeleted(Models.ConData.State item);