private void buttonDepartmentAdd_Click(object sender, EventArgs e) { FormDepartmentDetail formDepartmentDetail = new FormDepartmentDetail(); formDepartmentDetail.ShowDialog(); refreshDataViewDepartment(); }
private void dataViewDepartment_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dataViewDepartment.SelectedRows.Count > 0) { int departmentID = Convert.ToInt16(dataViewDepartment.SelectedRows[0].Cells[0].Value); FormDepartmentDetail formDepartmentDetail = new FormDepartmentDetail(Department.GetDepartment(departmentID), "edit"); formDepartmentDetail.ShowDialog(); refreshDataViewDepartment(); } }
private void buttonDepartmentEdit_Click(object sender, EventArgs e) { if (dataViewDepartment.SelectedRows.Count > 0) { int departmentID = Convert.ToInt16(dataViewDepartment.SelectedRows[0].Cells[0].Value); FormDepartmentDetail formDepartmentDetail = new FormDepartmentDetail(Department.GetDepartment(departmentID), "edit"); formDepartmentDetail.ShowDialog(); refreshDataViewDepartment(); } }