protected override void OnLoad(EventArgs e) { _listCom = DAL.GetComDétail(); dgvCommandes.DataSource = _listCom; #region Paramétrage dgvCommandes dgvCommandes.Columns["DateLivraion"].Visible = false; dgvCommandes.Columns["NbProduitsCom"].Visible = false; dgvCommandes.Columns["MontantCom"].Visible = false; dgvCommandes.Columns["Frais"].Visible = false; dgvCommandes.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells; dgvCommandes.ReadOnly = true; dgvCommandes.Columns["DateCommande"].Resizable = DataGridViewTriState.True; #endregion DAL.ExporterXml_XmlWriter(_listCom); 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_test_Click(object sender, EventArgs e) { DAL.ExporterXml_XmlWriter(_liste); }