Esempio n. 1
0
        public EditWorkerType(employee_type o)
        {
            InitializeComponent();

            e = o;

            TitleTextBox.Text        = e.title;
            SalaryTextBox.Text       = e.salery.ToString();
            LicenseTypeComboBox.Text = e.license_type;
            DescriptionTextBox.Text  = e.description;
        }
Esempio n. 2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string title       = TitleTextBox.Text;
            float  salary      = float.Parse(SalaryTextBox.Text);
            string type        = LicenseTypeComboBox.Text;
            string description = DescriptionTextBox.Text;

            employee_type t = new employee_type();

            t.title        = title;
            t.salery       = salary;
            t.license_type = type;
            t.description  = description;

            db.employee_type.Add(t);
            db.SaveChanges();

            Close();
        }