private void 添加ToolStripMenuItem_Click(object sender, EventArgs e) { num = 1; CustomerAddAndEdit cus = new CustomerAddAndEdit(); cus.ShowDialog(); }
private void 修改ToolStripMenuItem_Click(object sender, EventArgs e) { //获取被选中的内容 cm.Id1 = int.Parse(this.dataGridView1.SelectedRows[0].Cells[0].Value.ToString()); cm.CName1 = this.dataGridView1.SelectedRows[0].Cells[1].Value.ToString(); cm.Phone1 = this.dataGridView1.SelectedRows[0].Cells[2].Value.ToString(); cm.Address1 = this.dataGridView1.SelectedRows[0].Cells[3].Value.ToString(); num = 0; CustomerAddAndEdit cus = new CustomerAddAndEdit(); cus.ShowDialog(); }