private void SetSefiEchipe()
        {
            ManagerPersoana m = null;
            try
            {
                m = new ManagerPersoana();

                sefi = m.GetPersoaneIMO("", "", "sefechipa", cmbFirme.Text == "Toate firmele" ? "ALL" : cmbFirme.Text, false, true);
                sefi.Add(new PersoanaIMO("Toti sefi echipa"));
                cmbSefiEchipa.DataSource = sefi;
                cmbSefiEchipa.DisplayMember = "NumeComplet";
                cmbSefiEchipa.Text = "Toti sefi echipa";
            }
            finally
            {
                m = null;
            }
        }
Example #2
0
 private void SavePersoana(ManagerPersoana m)
 {
     Persoana p = new Persoana();
     p.Id = Id;
     p.Nume = Nume;
     p.Prenume = Prenume;
     p.Anulat = Anulat;
     p.Functie = Functie;
     p.Cod = Cod;
     p.Numar=Numar;
     p.Firma = Firma;
     m.SavePersoana(p);
 }
Example #3
0
        private void searchTextBox1_Search(object sender, EventArgs e)
        {
            ManagerPersoana m = new ManagerPersoana();
            IList<PersoanaIMO> persoane = null;

            try
            {
                SetFilterColor();

                persoane = m.GetPersoaneIMO(stxtNume.Text,stxtPrenume.Text,
                    cmbFunctii.Text == "Toate functiile" ? "ALL" : cmbFunctii.Text,
                    cmbFirme.Text == "Toate firmele" ? "ALL" : cmbFirme.Text,
                    ckAnulate.Checked,rbOrdoneazaNume.Checked);

                bindingSource1.DataSource = persoane;
                PopuleazaTotal(persoane);

                grdPersoane.Update();

                bindingSource1_PositionChanged(this, null);

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                m = null;
            }
        }
Example #4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            ManagerPersoana m = null;

            try
            {
                m = new ManagerPersoana();

                Nume = txtNume.Text;
                Prenume = txtPrenume.Text;
                Functie=cmbFunctii.SelectedItem as Functie;
                Firma = cmbFirme.SelectedItem as Firma;
                Anulat = ckAnulat.Checked;
                Numar = Convert.ToInt32(txtNumar.Value);
                if (Cod == "")
                {
                    do
                    {
                        Cod = GetRandomCode();
                        if (m.VerificaUnicitateCod(Cod, this.Id))
                        {
                            break;
                        }
                    } while (true);
                }
                lbCod.Text = Cod;
                if (!VerifyInfo()) { return; }
                SavePersoana(m);
                IsOk = true;
                this.Close();
            }
            catch (Exception ex)
            {
                IsOk = false;
                MessageBox.Show(ex.Message);
            }
            finally
            {
                m = null;
            }
        }
Example #5
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;
            }
        }