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

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

            return(item);
        }
        public async Task <Models.ConData.MyFriend> CreateMyFriend(Models.ConData.MyFriend myFriend)
        {
            OnMyFriendCreated(myFriend);

            context.MyFriends.Add(myFriend);
            context.SaveChanges();

            return(myFriend);
        }
        protected async System.Threading.Tasks.Task Form0Submit(FemiFriendsApp.Models.ConData.MyFriend args)
        {
            try
            {
                var conDataUpdateMyFriendResult = await ConData.UpdateMyFriend(FriendID, myfriend);

                DialogService.Close(myfriend);
            }
            catch (System.Exception conDataUpdateMyFriendException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update MyFriend");
            }
        }
Exemplo n.º 4
0
        protected async System.Threading.Tasks.Task Load()
        {
            var conDataGetGendersResult = await ConData.GetGenders();

            getGendersResult = conDataGetGendersResult;

            var conDataGetCountriesResult = await ConData.GetCountries();

            getCountriesResult = conDataGetCountriesResult;

            var conDataGetStatesResult = await ConData.GetStates();

            getStatesResult = conDataGetStatesResult;

            myfriend = new FemiFriendsApp.Models.ConData.MyFriend()
            {
            };
        }
        public async Task <Models.ConData.MyFriend> UpdateMyFriend(Int64?friendId, Models.ConData.MyFriend myFriend)
        {
            OnMyFriendUpdated(myFriend);

            var item = context.MyFriends
                       .Where(i => i.FriendID == friendId)
                       .FirstOrDefault();

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

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

            return(myFriend);
        }
Exemplo n.º 6
0
        protected async System.Threading.Tasks.Task Grid0RowSelect(FemiFriendsApp.Models.ConData.MyFriend args)
        {
            var dialogResult = await DialogService.OpenAsync <EditMyFriend>("Edit My Friend", new Dictionary <string, object>() { { "FriendID", args.FriendID } });

            await InvokeAsync(() => { StateHasChanged(); });
        }
 partial void OnMyFriendUpdated(Models.ConData.MyFriend item);
 partial void OnMyFriendGet(Models.ConData.MyFriend item);
 partial void OnMyFriendDeleted(Models.ConData.MyFriend item);