ERP销售管理销售合同子模块的设计与开发(13)
时间:2017-01-13 12:57 来源:毕业论文 作者:毕业论文 点击:次
private void button10_Click(object sender, EventArgs e) { dataset.Clear(); if (textBox15.Text.Trim() == "" || textBox16.Text.Trim() == "" || textBox17.Text.Trim() == "" || textBox18.Text.Trim() == "" || textBox19.Text.Trim() == "" || textBox29.Text.Trim() == "") { MessageBox.Show("请输入完整的合同信息", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { sql = "select * from contract where number=" + "'" + textBox15.Text.Trim() + "'"; adapter = new SqlDataAdapter(sql, con); adapter.Fill(dataset, "contract"); if (dataset.Tables["contract"].Rows.Count < 1) { MessageBox.Show("要修改的合同不存在", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { sql = string.Format(@"update contract set name='{1}',owner='{2}',customer='{3}',abstract='{4}',content='{5}' ,date='{6}' where number='{0}'", textBox15.Text.Trim(), textBox16.Text.Trim(), textBox17.Text.Trim(), textBox18.Text.Trim(), textBox19.Text.Trim(), textBox29.Text.Trim(), dateTimePicker2.Value); SqlCommand cmd = new SqlCommand(sql, con); try { con.Open(); cmd.ExecuteNonQuery(); MessageBox.Show("修改成功", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); showcontract(); } (责任编辑:qin) |