Example #1
0
        public PersoanaForm(string titlu, int id, string nume,string prenume, bool anulat, string functie,string cod, int numar,string firma)
        {
            ManagerFunctie m = new ManagerFunctie();
            ManagerFirma m1 = new ManagerFirma();
            Functie f = null;
            Firma f1 = null;
            InitializeComponent();

            this.Id = id;
            this.Nume = nume;
            this.Prenume = prenume;
            this.Anulat = anulat;
            this.Cod = cod;
            this.Numar = numar;
            //this.Firma = firma;

            this.Text = titlu;
            txtNume.Text = nume;
            txtPrenume.Text = prenume;
            lbCod.Text = cod;
            ckAnulat.Checked = anulat;
            txtNumar.Value = numar;
            functii = m.GetFunctii(false);
            firme = m1.GetFirme(false);

                if (id == 0)
                {
                    BindCombo();

                }
                else
                {
                    f = m.GetFunctieByDenumire(functie);
                    f1 = m1.GetFirmaByDenumire(firma);
                    BindCombo1(f,f1);
                }
        }
Example #2
0
        private void SetFunctii()
        {
            ManagerFunctie m = null;
            try
            {
                m = new ManagerFunctie();

                functii = m.GetFunctii(false);
                functii.Add(new Functie("Toate functiile"));
                cmbFunctii.DataSource = functii;
                cmbFunctii.DisplayMember = "Denumire";
                cmbFunctii.Text = "Toate functiile";
            }
            finally
            {
                m = null;
            }
        }
Example #3
0
        private void ConfirmareAnularePeroana(object sender, EventArgs e)
        {
            ManagerPersoana m = null;
            ManagerFunctie m1 = null;
            ManagerFirma m2 = null;
            Persoana p = null;

            try
            {
                if ((sender as Form).DialogResult != DialogResult.Yes)
                {
                    return;
                }
                m = new ManagerPersoana();
                m1 = new ManagerFunctie();

                p = new Persoana();
                persoanaCurenta.Anulat = true;
                p.Id = persoanaCurenta.Id;
                p.Nume = persoanaCurenta.Nume;
                p.Prenume = persoanaCurenta.Prenume;
                p.Cod = persoanaCurenta.Cod;
                p.Anulat = persoanaCurenta.Anulat;
                p.Numar = persoanaCurenta.Numar;
                p.Functie = m1.GetFunctieByDenumire(persoanaCurenta.Functie);
                p.Firma = m2.GetFirmaByDenumire(persoanaCurenta.Firma);
                m.SavePersoana(p);
                Init();
                bindingSource1_PositionChanged(sender, e);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                m = null;
            }
        }