private void BtnSaveAccountClicked(object sender, EventArgs e) { string name = textBoxName.Text; string address = textBoxAddress.Text; //Accès à la table eatfast_person dans la bdd DataSetEatFast personDataSet = new DataSetEatFast(); DataSetEatFastTableAdapters.EATFAST_PERSONTableAdapter personTableAdapter = new DataSetEatFastTableAdapters.EATFAST_PERSONTableAdapter(); if (name != "") { //Update name personTableAdapter.UpdateName(name, personRow.PER_ID); } if (address != "") { //Update address personTableAdapter.UpdateAddress(address, personRow.PER_ID); } textBoxName.Text = ""; textBoxAddress.Text = ""; MessageBox.Show("Your account information has been saved!", "Information"); }
private void UpdateUserAddress() { //Accès à la table eatfast_person dans la bdd DataSetEatFast personDataSet = new DataSetEatFast(); DataSetEatFastTableAdapters.EATFAST_PERSONTableAdapter listePerson = new DataSetEatFastTableAdapters.EATFAST_PERSONTableAdapter(); try { //Mise à jour de l'adresse de livraison listePerson.UpdateAddress(textBoxAddress.Text, id); Homepage.getInstance().UpdateAddress(textBoxAddress.Text); this.Close(); } catch (Exception o) { MessageBox.Show("Something went wrong"); Console.Write(o); } }