111,129
社区成员
发帖
与我相关
我的任务
分享


ds1.Tables["dc"].Rows.RemoveAt(dataGridView2.Rows.Count - 2);
int ii = dataGridView1.CurrentCell.RowIndex;//获得选定行
float a;
a = float.Parse(dataGridView1.Rows[ii].Cells[3].Value.ToString());//单价
a = float.Parse(numericUpDown1.Value.ToString()) * a; //总金额
ds1.Tables["dc"].Rows.Add(textBox1.Text, dcxh.ToString("D2"), str1,
dataGridView1.Rows[ii].Cells[0].Value.ToString(),
dataGridView1.Rows[ii].Cells[1].Value.ToString(),
dataGridView1.Rows[ii].Cells[2].Value.ToString(),
dataGridView1.Rows[ii].Cells[3].Value.ToString(),
numericUpDown1.Value.ToString(), a, '0');//往表中添加数据行
dcxh++;//点菜序号