ASP.NET客户信息管理系统的开发(14)_毕业论文

毕业论文移动版

毕业论文 > 计算机论文 >

ASP.NET客户信息管理系统的开发(14)


            SqlCommand cmd1 = new SqlCommand(sql, conn);
            if (cmd1.ExecuteScalar() == null)
            {
                MessageBox.Show("查无资料,请输入");
                button1.Enabled = true;
                return;
            }
            else
            {
                textBox1.Text = cmd1.ExecuteScalar().ToString();
                button5.Enabled = true;
                button3.Enabled = true;
            }
2)添加信息
if (textBox1.Text == "")
            {
                MessageBox.Show("请输入投诉信息");
                return;
            }
            else
            {
                sqlConnect();
                string sq2 = "insert into tousu values('" + comboBox1.Text.Trim() + "','" + textBox1.Text.Trim() + "' )";
                SqlCommand cmd2 = new SqlCommand(sq2, conn);
                cmd2.ExecuteNonQuery();
                sqlClose();
                MessageBox.Show("添加成功");
            }
 
3)修改信息
if (textBox1.Text =="")
            {
                MessageBox.Show("请输入投诉信息");
                return;
            }
            else
            {
                sqlConnect();
                string sq4 = "update tousu set liyou='" + textBox1.Text.Trim() + "'where custormid='" + comboBox1.Text + "'";
                SqlCommand cmd4 = new SqlCommand(sq4, conn); (责任编辑:qin)