//添加母线 private void button8_Click(object sender, EventArgs e) { MsgGeneratrix theGeneratrixHandel = new MsgGeneratrix(); theGeneratrixHandel.Text = "添加母线"; theGeneratrixHandel.isAddOrUpdate = 0; theGeneratrixHandel.ShowDialog(); }
//修改母线 private void button7_Click(object sender, EventArgs e) { if (GeneratrixView.SelectedRows.Count > 0 && ValidateData.CellIsNullOrZero(GeneratrixView.SelectedRows[0].Cells["GeneratrixID"])) { Generatrix theGeneratrix = new Generatrix(); theGeneratrix.GeneratrixName = GeneratrixView.SelectedRows[0].Cells["GeneratrixName"].Value.ToString(); theGeneratrix.GeneratrixNumber = GeneratrixView.SelectedRows[0].Cells["GeneratrixNumber"].Value.ToString(); theGeneratrix.GeneratrixID = GeneratrixView.SelectedRows[0].Cells["GeneratrixID"].Value.ToString(); theGeneratrix.GeneratrixToID = GeneratrixView.SelectedRows[0].Cells["GeneratrixToID"].Value.ToString(); MsgGeneratrix theGeneratrixHandel = new MsgGeneratrix(theGeneratrix); theGeneratrixHandel.Text = "修改变母线"; theGeneratrixHandel.isAddOrUpdate = 1; theGeneratrixHandel.ShowDialog(); } else { HandelControls.Msg("请选择要修改的数据", MessageBoxButtons.OK, MessageBoxIcon.Error); } }