Esempio n. 1
0
        private void btnAdauga_Click(object sender, EventArgs e)
        {
            PersoanaForm frm = null;

            try
            {
                frm = new PersoanaForm("Adauga persoana", 0, "","", false, "","",0,"");
                frm.ShowDialog();
                frm.FormClosed += new Form.FormClosedEventHandler(PersoanaForm_FormClosing);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 2
0
 private void btnModifica_Click(object sender, EventArgs e)
 {
     PersoanaForm frm = null;
     try
     {
         if (persoanaCurenta == null)
         {
             btnAdauga_Click(sender, e);
         }
         else
         {
             frm = new PersoanaForm("Editeaza persoana " + persoanaCurenta.Nume + " "+persoanaCurenta.Prenume,
                 persoanaCurenta.Id, persoanaCurenta.Nume, persoanaCurenta.Prenume, persoanaCurenta.Anulat,
                 persoanaCurenta.Functie,persoanaCurenta.Cod,persoanaCurenta.Numar,persoanaCurenta.Firma);
             frm.ShowDialog();
             frm.FormClosed += new Form.FormClosedEventHandler(PersoanaForm_FormClosing);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }