public Form1()
 {
     InitializeComponent();
     btnClose.Enabled = false;
     rbtRadio1.Text   = "Wybierz mnie";
     rbtRadio2.Text   = "";
     rbtRadio3.Text   = "";
     db = new SzwalniaEntities();
 }
        public DetailsForm(SzwalniaEntities db, String employeeLastName)
        {
            InitializeComponent();

            Pracownicy employee = db.Pracownicy.Where(pracownik => pracownik.Nazwisko == employeeLastName).First();

            lblTitle.Text   = employee.ID_Pracownika + ' ' + employee.Imie + ' ' + employee.Nazwisko.Trim();
            txtName.Text    = employee.Imie.Trim();
            txtSurname.Text = employee.Nazwisko.Trim();
            txtPesel.Text   = employee.Pesel.Trim();
            txtAdres.Text   = employee.Adres.Trim();

            dgvEmployment.DataSource = db.vZatrudnienie.Where(employment => employment.ID_Pracownika == employee.ID_Pracownika).ToList();
        }