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); } }
private void SetFirme() { ManagerFirma m = null; try { m = new ManagerFirma(); firme = m.GetFirme(false); //firme.Add(new Firma("Toate firmele")); cmbFirme.DataSource = firme; cmbFirme.DisplayMember = "Denumire"; //cmbFirme.Text = "Toate firmele"; } finally { m = null; } }