private void btnMod_Click(object sender, EventArgs e) { int count = this.gdvInfo.SelectedRowsCount; if (count == 0) { MessageBox.Show("请先搜索/刷新并选择需要修改的行", "错误!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Mo_Project myMo_Project = new Mo_Project(); myMo_Project.projectNo = this.gdvInfo.GetFocusedRowCellValue("project_no").ToString(); myMo_Project.projectName = this.gdvInfo.GetFocusedRowCellValue("project_name").ToString(); myMo_Project.projectHeader = this.gdvInfo.GetFocusedRowCellValue("project_header").ToString(); myMo_Project.projectStartDate = Convert.ToDateTime(this.gdvInfo.GetFocusedRowCellValue("project_start_date")); myMo_Project.projectEndDate = Convert.ToDateTime(this.gdvInfo.GetFocusedRowCellValue("project_end_date")); myMo_Project.projectCompany = this.gdvInfo.GetFocusedRowCellValue("project_company").ToString(); myMo_Project.projectContact = this.gdvInfo.GetFocusedRowCellValue("project_contact").ToString(); myMo_Project.contactPhone = this.gdvInfo.GetFocusedRowCellValue("contact_phone").ToString(); myMo_Project.remark = this.gdvInfo.GetFocusedRowCellValue("remark").ToString(); IsUpdate = true; frmProjectAdd myfrmCustomerAdd = new frmProjectAdd(myMo_Project, IsUpdate); if (myfrmCustomerAdd.ShowDialog() == DialogResult.Yes) { btnSearch_Click(sender, e); } }
private void btnAdd_Click(object sender, EventArgs e) { frmProjectAdd myfrmCustomerAdd = new frmProjectAdd(); if (myfrmCustomerAdd.ShowDialog() == DialogResult.Yes) { btnSearch_Click(sender, e); } }