public Task <int> SaveProfileAsync(ProfileItems profileItems) { if (profileItems.Id != 0) { return(database.UpdateAsync(profileItems)); } else { return(database.InsertAsync(profileItems)); } }
public IDisposable Start(ProfileAction kind, String description) { var itm = new ProfileItem(description); if (!_items.TryGetValue(kind, out ProfileItems elems)) { elems = new ProfileItems(); _items.Add(kind, elems); } elems.Add(itm); return(itm); }
async void Save_Clicked(object sender, EventArgs e) { var additem = new ProfileItems { ProfileName = "Zelda", ProfileRace = "Kooiker" }; var profileItem = (ProfileItems)BindingContext; await App.Database.SaveProfileAsync(profileItem); await Navigation.PopAsync(); }
void PopulateProfileItems() { if (ProfileItems == null) { ProfileItems = new List <ProfileItem> (); } if (User == null) { return; } if (!string.IsNullOrWhiteSpace(User.Title)) { ProfileItems.Add(new ProfileItem { Item = PDPConstants.Title, Value = User.Title }); } if (!string.IsNullOrWhiteSpace(User.Practice)) { ProfileItems.Add(new ProfileItem { Item = PDPConstants.Practice, Value = User.Practice }); } if (!string.IsNullOrWhiteSpace(User.Email)) { ProfileItems.Add(new ProfileItem { Item = PDPConstants.Email, Value = User.Email }); } if (!string.IsNullOrWhiteSpace(User.ContactNumber)) { ProfileItems.Add(new ProfileItem { Item = PDPConstants.ContactNumber, Value = User.ContactNumber }); } if (!string.IsNullOrWhiteSpace(User.FacebookUsername)) { ProfileItems.Add(new ProfileItem { Item = PDPConstants.Facebook, Value = User.FacebookUsername, IsWebLink = true }); } if (!string.IsNullOrWhiteSpace(User.TwitterHandle)) { ProfileItems.Add(new ProfileItem { Item = PDPConstants.Twitter, Value = User.TwitterHandle, IsWebLink = true }); } if (!string.IsNullOrWhiteSpace(User.LinkedInUsername)) { ProfileItems.Add(new ProfileItem { Item = PDPConstants.LinkedIn, Value = User.LinkedInUsername, IsWebLink = true }); } }
public Task <int> DeleteProfileAsync(ProfileItems profileItems) { return(database.DeleteAsync(profileItems)); }