Пример #1
0
 static void Main()
 {
     ds = new DsBiblio();
     AdherentTableAdapter = new AdherentTableAdapter();
     AdherentTableAdapter.Fill(ds.Adherent);
     livreTableAdapter = new livreTableAdapter();
     livreTableAdapter.Fill(ds.livre);
     themeTableAdapter = new themeTableAdapter();
     themeTableAdapter.Fill(ds.theme);
     empruntTableAdapter = new empruntTableAdapter();
     empruntTableAdapter.Fill(ds.emprunt);
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new Menu());
 }
Пример #2
0
        public FormAdherent()
        {
            InitializeComponent();
            ds = new DsBiblio();
            AdherentTableAdapter = new AdherentTableAdapter();
            AdherentTableAdapter.Fill(ds.Adherent);
            empruntTableAdapter emprunt = new empruntTableAdapter();

            emprunt.Fill(ds.emprunt);
            Mvvm_adherent            = new BindingSource();
            Mvvm_adherent.DataSource = ds.Adherent;
            dataGridView1.DataSource = Mvvm_adherent;
            nomATextBox.DataBindings.Add("Text", Mvvm_adherent, "nomA", true, DataSourceUpdateMode.Never);
            codeATextBox.DataBindings.Add("Text", Mvvm_adherent, "codeA", true, DataSourceUpdateMode.Never);
            adresseTextBox.DataBindings.Add("Text", Mvvm_adherent, "adresse", true, DataSourceUpdateMode.Never);
            dateInscriptionDateTimePicker.DataBindings.Add("Value", Mvvm_adherent, "dateInscription", true, DataSourceUpdateMode.Never);
            ds.Adherent.codeAColumn.AutoIncrementSeed = ds.Adherent.Count != 0 ? ds.Adherent.AsEnumerable().Max(x => x.codeA) + 1 : 1;
            ds.Adherent.codeAColumn.AutoIncrementStep = 1;
        }