Example #1
0
        private void AddWorkerButton_Click(object sender, RoutedEventArgs e)
        {
            string name      = NameTextBox.Text;
            string telephone = TelephoneTextBox.Text;
            string address   = AddressTextBox.Text;
            string lN        = LNTextBox.Text;
            int    type      = ((employee_type)EmployeeTypeComboBox.SelectedItem).Id;

            employee o = new employee(); //יצירת אובייקט עובד חדש

            o.name             = name;
            o.telephone        = telephone;
            o.address          = address;
            o.license_number   = lN;
            o.employee_type_id = type;

            db.employee.Add(o);

            db.SaveChanges();

            this.Close();
        }