private void 添加分类ToolStripMenuItem_Click(object sender, EventArgs e) { AddClassFrm addclass = new AddClassFrm(); if (addclass.ShowDialog() == DialogResult.OK) { string classStr = addclass.textBox1.Text.ToUpper().ToString(); ArrayList selectedlist = new ArrayList(); foreach (DataGridViewRow dr in this.dataGridView1.Rows) { if (dr.Selected == true) { selectedlist.Add(dr.Index); } } for (int i = 0; i < selectedlist.Count; i++) { int index = int.Parse(selectedlist[i].ToString()); string projectidStr = this.dataGridView1.Rows[index].Cells["项目号"].Value.ToString(); string drawingStr = this.dataGridView1.Rows[index].Cells["图纸号"].Value.ToString(); string spoolStr = this.dataGridView1.Rows[index].Cells["小票号"].Value.ToString(); WorkShopStatusFlow.AddTrayORClass("SP_ADDCLASSIFICATION", projectidStr, drawingStr, spoolStr, classStr); this.dataGridView1.Rows[index].Cells["分类"].Value = classStr; } selectedlist.Clear(); MessageBox.Show("--------完成--------"); } }