private void buttonAdd_Click(object sender, EventArgs e) { SoloDepartment sd = new SoloDepartment(); sd.Name = textBoxAdd.Text.ToString(); dpmRepo.Insert(sd); dpmRepo.Save(); textBoxAdd.Text = ""; RefreshGui(); }
public FormDepartementEdit(DepartmentRepository departmentRepository, int v) { InitializeComponent(); this.departmentRepository = departmentRepository; this.SelectedIndex = v; sd = new SoloDepartment(); labelID.Text = String.Format("ID of department: {0}", SelectedIndex); sd = departmentRepository.SelectById(SelectedIndex); textBoxOLD.Text = sd.Name.ToString(); }