private void toolStripButtonAddCompanyInfo_Click(object sender, EventArgs e) { AccessDataBase.Model.CompanyInfo modeCompanyInfo = new AccessDataBase.Model.CompanyInfo(); AccessDataBase.BLL.CompanyInfo bllCompanyInfo = new AccessDataBase.BLL.CompanyInfo(); modeCompanyInfo.CompanyID = bllCompanyInfo.GetMaxId(); FormCompany formCompany = new FormCompany(modeCompanyInfo, OpenMode.Add); formCompany.ShowDialog(); this.refreshDataGridView(); }
private void toolStripButtonUpdateCompanyInfo_Click(object sender, EventArgs e) { if (kryptonDataGridViewCompany.CurrentRow == null) { return; } AccessDataBase.BLL.CompanyInfo bllCompanyInfo = new AccessDataBase.BLL.CompanyInfo(); int selectIndex = kryptonDataGridViewCompany.CurrentRow.Index; string companyID = kryptonDataGridViewCompany["CompanyID", selectIndex].Value.ToString().Trim(); AccessDataBase.Model.CompanyInfo modeCompanyInfo = bllCompanyInfo.GetModel(int.Parse(companyID)); FormCompany formCompany = new FormCompany(modeCompanyInfo, OpenMode.Update); formCompany.ShowDialog(); this.refreshDataGridView(); }