/// <summary> /// The execute method of the Insert<see cref="RelayCommand"/> /// Tries to add the share to the Database. /// </summary> /// <param name="o">A parameter for this method.</param> private void Insert(object o) { // Add the share to the database switch (DataBaseHelper.AddShareToDB(this)) { case 1: this.WebSite = string.Empty; break; case 0: // Message if it already exist MessageBox.Show($"You already have a share with an ISIN matching ISIN={this.ISIN}."); break; case -1: // Message if the was an error while inserting MessageBox.Show($"There was an error while inserting the share with the ISIN={this.ISIN} to the database."); break; default: break; } }