public void Save(FootballPlayer player) { using (SQLite.SQLiteConnection database = DependencyService.Get<ISQLite> ().GetConnection ()) { database.Insert (player); } }
public void DeletePlayerWithName(FootballPlayer player) { using (SQLite.SQLiteConnection database = DependencyService.Get<ISQLite> ().GetConnection ()) { database.Delete (player); } }
void OnSavePlayerProfileBTNClicked() { //Write for Image Picker string saveDataStatus = ""; if (_firstName == null || _lastName == null) { saveDataStatus = "Please Enter First Name and Last Name"; } else if (_country < 0) { saveDataStatus = "Please Enter Country"; } else if (_playerdescription == null) { saveDataStatus = "Please Enter Description"; } else { FootballPlayer player = new FootballPlayer { FirstName = _firstName, LastName = _lastName, DateOfBirth = _dateOfBirth, Country = Countries[_country], Description = _playerdescription }; SQLiteHelper databaseHelper = new SQLiteHelper(); databaseHelper.Save(player); saveDataStatus = "Player Data Saved Successfully"; } MessagingCenter.Send(this, "SaveFootballPlayerProfileStatusAlert", saveDataStatus); }
public void DeletePlayerWithName(FootballPlayer player) { using (SQLite.SQLiteConnection database = DependencyService.Get <ISQLite> ().GetConnection()) { database.Delete(player); } }
public void Save(FootballPlayer player) { using (SQLite.SQLiteConnection database = DependencyService.Get <ISQLite> ().GetConnection()) { database.Insert(player); } }
public FootballPlayerDetailPage(Object obj) { FootballPlayer player = (FootballPlayer)obj; InitializeComponent(); this.PlayerNamelbl.Text = player.FullName; this.Countrylbl.Text = string.Concat("Country: ", player.Country); this.Agelbl.Text = string.Concat("Age: ", player.Age); string[] dateFormats = player.DateOfBirth.GetDateTimeFormats(); this.DOBlbl.Text = string.Concat("DateOfBirth: ", dateFormats [8]); this.Descriptionlbl.Text = string.Concat("Description : ", player.Description); if (player.IsFavourite) { this.IsFavouritelbl.Text = "(Is Favourite)"; } else { this.IsFavouritelbl.Text = ""; } }