public FormCommandesBis() { InitializeComponent(); dgvCommandes.SelectionChanged += DgvCommandes_SelectionChanged; btnRechercheOK.Click += BtnRechercheOK_Click; btnImportXML.Click += (object sender, EventArgs e) => _lstCommandes = DAL.ImporterXml(); btnExportXML.Click += (object sender, EventArgs e) => DAL.ExporterXml(_lstCommandes); }
protected override void OnLoad(EventArgs e) { ListCommEtDetails = DAL.GetListeCommandes(); //Récupération à partir du fichier XML //ListCommEtDetails = DAL.ImporterXml(); dgvCommandes.DataSource = ListCommEtDetails; DAL.ExporterXml(ListCommEtDetails); DAL.ExporterCommandesXml_XmlWriter(ListCommEtDetails); //dgvCommandes.Columns["ListeDetails"].Visible = false; PARCE QUE la dgv n'affiche pas les listes base.OnLoad(e); }
private void Sauvegarder(string code) { SaveFileDialog slctDossier = new SaveFileDialog(); slctDossier.Filter = "XML files (*.xml)|*.xml"; slctDossier.DefaultExt = "xml"; slctDossier.AddExtension = true; if (slctDossier.ShowDialog() == DialogResult.OK && !string.IsNullOrWhiteSpace(slctDossier.FileName)) { switch (code) { case "short": DAL.ExporterXml_XmlWriter(_listeCommande, slctDossier.FileName); break; default: DAL.ExporterXml(_listeCommande, slctDossier.FileName); break; } } }
private void Btn_export_Click(object sender, EventArgs e) { DAL.ExporterXml(_liste); }