private void toolStripButtonAddDepartmentInfo_Click(object sender, EventArgs e) { AccessDataBase.Model.DepartmentInfo modeDepartmentInfo = new AccessDataBase.Model.DepartmentInfo(); AccessDataBase.BLL.DepartmentInfo bllDepartmentInfo = new AccessDataBase.BLL.DepartmentInfo(); modeDepartmentInfo.DepartmentID = bllDepartmentInfo.GetMaxId(); FormDepartment formCompany = new FormDepartment(modeDepartmentInfo, OpenMode.Add); formCompany.ShowDialog(); this.refreshDataGridView(); }
private void toolStripButtonUpdateDepartmentInfo_Click(object sender, EventArgs e) { if (kryptonDataGridViewDepartment.CurrentRow == null) { return; } AccessDataBase.BLL.DepartmentInfo bllDepartmentInfo = new AccessDataBase.BLL.DepartmentInfo(); int selectIndex = kryptonDataGridViewDepartment.CurrentRow.Index; string departmentID = kryptonDataGridViewDepartment["DepartmentID", selectIndex].Value.ToString().Trim(); AccessDataBase.Model.DepartmentInfo modeDepartmentInfo = bllDepartmentInfo.GetModel(int.Parse(departmentID)); FormDepartment formDepartment = new FormDepartment(modeDepartmentInfo, OpenMode.Update); formDepartment.ShowDialog(); this.refreshDataGridView(); }
private void toolStripButtonUpdateDepartmentInfo_Click(object sender, EventArgs e) { if (kryptonDataGridViewDepartment.CurrentRow == null) return; AccessDataBase.BLL.DepartmentInfo bllDepartmentInfo = new AccessDataBase.BLL.DepartmentInfo(); int selectIndex = kryptonDataGridViewDepartment.CurrentRow.Index; string departmentID = kryptonDataGridViewDepartment["DepartmentID", selectIndex].Value.ToString().Trim(); AccessDataBase.Model.DepartmentInfo modeDepartmentInfo = bllDepartmentInfo.GetModel(int.Parse(departmentID)); FormDepartment formDepartment = new FormDepartment(modeDepartmentInfo, OpenMode.Update); formDepartment.ShowDialog(); this.refreshDataGridView(); }