Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void CreateNewDepartment()
- {
- if ((textBox1.Text != String.Empty) && (comboBox1.SelectedIndex >= 0))
- {
- db.AddToDepartment(Department.CreateDepartment(0, textBox1.Text, Convert.ToInt32(comboBox1.SelectedValue)));
- Person person = (Person)comboBox1.SelectedItem;
- Department dep = new Department();
- dep.departmentID = 0;
- dep.departmentName = textBox1.Text;
- person.Department.Add(dep);
- db.SaveChanges();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement