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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Contact_DAO;
using System.Data.Objects.DataClasses;
namespace Contact_IHM
{
public partial class DetailContact : Form
{
private Contact _aContact;
private Contact UnContact;
public Contact aContact {
get { return _aContact; }
set { _aContact = value; }
}
public DetailContact(Contact bcontact )
{
InitializeComponent();
this.aContact = bcontact;
}
private void DetailContact_Load(object sender, EventArgs e)
{
if (aContact.EntityKey == null)
{ TxtIdentifiant.Text = "--"; }
else
{
TxtIdentifiant.DataBindings.Add("Text", this.aContact, "Identifiant");
}
textnom.DataBindings.Add("Text", this.aContact, "nom");
textprenom.DataBindings.Add("Text", this.aContact, "prenom");
textadresse.DataBindings.Add("Text", this.aContact, "adresse");
textphone.DataBindings.Add("Text", this.aContact, "telephone");
textville.DataBindings.Add("Text", this.aContact, "ville");
textsexe.DataBindings.Add("Text", this.aContact, "sexe");
bdcontact.DataSource = this.aContact;
}
private void cmdValider_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.OK;
} |