1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| private void btnOK_Click(object sender, EventArgs e)
{
dbShelterDataSet1.ShelterRow newShelterRow = dbShelterDataSet1.Shelter.NewShelterRow();
//newShelterRow.Code = " ";
newShelterRow.Category = cbCategory.Text;
newShelterRow.Name = tbNameShelter.Text;
newShelterRow.NbOfAdult = int.Parse(mtbNbOfAdult.Text);
newShelterRow.NbOfKid = int.Parse(mtbNbOfKid.Text);
newShelterRow.RateOfTVA = Int32.Parse(cbRateOfTVA.Text);
newShelterRow.PriceTTC = int.Parse(tbLowSeasonWeekPriceTTC.Text);
//newShelterRow.Picture = pbPicture.Image;
newShelterRow.DateCreated = dtpDateCreated.Value;
newShelterRow.DateModified = dtpDateModified.Value;
newShelterRow.ModifiedBy = cbModifiedBy.Text;
dbShelterDataSet1.Shelter.AddShelterRow(newShelterRow);
try
{
shelterTableAdapter.Update(dbShelterDataSet1.Shelter);
}
catch (SqlCeException exception)
{
MessageBox.Show("ERREUR :\n" + exception.Message, "ERREUR");
}
} |
Partager