Exemple #1
0
        private void btPlus_Click(object sender, EventArgs e)
        {
            FrmEdit frm = new FrmEdit(settings, AppDir);

            frm.prj = new Projet();
            if (frm.ShowDialog() == DialogResult.OK)
            {
                frm.UpdatePrj();
                lstprj.Projets.Add(frm.prj);
                SaveDB();
                RefreshListbox();
                RefreshFields(true);
            }
        }
Exemple #2
0
        private void btEdit_Click(object sender, EventArgs e)
        {
            int p = listBoxProjets.SelectedIndex;

            if (p == -1)
            {
                return;
            }

            FrmEdit frm = new FrmEdit(settings, AppDir);

            frm.prj = lstprj.Projets[p];
            if (frm.ShowDialog() == DialogResult.OK)
            {
                frm.UpdatePrj();
                SaveDB();
                RefreshListbox();
                //.. On repositionne le curseur
                listBoxProjets.SelectedIndex = p;
                //..
                RefreshFields(true);
            }
        }