public void SaveIfNotExistsTest() { IDepartamentRepository departamentRepository = new DepartamentRepository(); Departament departament = new Departament("Digital Platform"); departament = departamentRepository.SaveIfNotExists(departament); }
private void MainWindow1_Loaded(object sender, RoutedEventArgs e) { StreamReader connectionConfigureFile = new StreamReader("connectionString.txt"); string connectionString = connectionConfigureFile.ReadLine(); dataManage = new TsqlDataManage(connectionString); statusRepository = new StatusRepository(connectionString); departamentRepository = new DepartamentRepository(connectionString); postRepository = new PostRepository(connectionString); statusBox.Items.Add(new Status() { Id = -1, Name = "*" }); foreach (var status in statusRepository.GetAllEntitys()) { statusBox.Items.Add(status); } statusBox.SelectedIndex = 0; statusBox2.ItemsSource = statusRepository.GetAllEntitys(); statusBox2.SelectedIndex = 0; departmentBox.Items.Add(new Departament() { Id = -1, Name = "*" }); foreach (var departament in departamentRepository.GetAllEntitys()) { departmentBox.Items.Add(departament); } departmentBox.SelectedIndex = 0; postBox.Items.Add(new Post() { Id = -1, Name = "*" }); foreach (var post in postRepository.GetAllEntitys()) { postBox.Items.Add(post); } postBox.SelectedIndex = 0; }
public EmployeeController(EmployeeRepository empRepository, DepartamentRepository repository) { this._empRepository = empRepository; this._departamentRepository = repository; }