汽车美容管理系统(5)

2019-03-02 22:55

主要的功能代码如下:

private void button1_Click(object sender, EventArgs e) {

if (textBox1.Text == \请输入ID!\ else { try {

string strconn = \Security=True\

SqlConnection connection = new SqlConnection(strconn); string sql2 = \ connection.Open();

SqlCommand command2 = new SqlCommand(sql2, connection); command2.ExecuteNonQuery(); connection.Close(); showlist();

textBox1.Text = \ }

catch (Exception ex)

{ MessageBox.Show(\添加错误!\ } }

4.5 车辆管理模块

4.5.1 车辆信息模块

程序运行结果如图4.9所示:

图4.9车辆信息模块

19

主要的功能代码如下: private void showlist() {

try {

string strconn, strsql;

strconn = \Security=True\

strsql = \车主ID,brand as 品牌 from car\ SqlConnection myconn = new SqlConnection(strconn); SqlDataAdapter myda = new SqlDataAdapter(strsql, myconn); DataSet myds = new DataSet(); myda.Fill(myds, \

dataGridView1.DataSource = myds.Tables[\ }

catch (Exception ex) {

MessageBox.Show(\刷新错误!\ } }

4.5.2新增车辆模块

程序运行结果如图4.10所示。

图4.10新增车辆模块

20

主要的功能代码如下:

private void button1_Click(object sender, EventArgs e) { try {

string strconn = \Security=True\

SqlConnection connection = new SqlConnection(strconn);

string sql2 = \into car(id,cus_id,brand) values('\+ textBox1.Text + \+ textBox2.Text + \ connection.Open();

SqlCommand command2 = new SqlCommand(sql2, connection); command2.ExecuteNonQuery(); connection.Close(); showlist();

textBox1.Text = textBox2.Text = textBox3.Text = \ }

catch (Exception ex) {

MessageBox.Show(\添加错误!\ } }

4.5.3车辆修改模块

程序运行结果如图4.11所示。

图4.11车辆修改模块

21

主要的功能代码如下:

private void button1_Click(object sender, EventArgs e)

{ if (textBox1.Text == \请输入ID!\

else if (textBox2.Text == \请输入修改值!\ else if (comboBox1.Text == \请输入修改项!\ else {try

{string cha = \

if (comboBox1.Text == \车主ID\ if (comboBox1.Text == \品牌\

string strconn = \Security=True\

SqlConnection connection = new SqlConnection(strconn);

string sql2 = \+ textBox1.Text + \

connection.Open();

SqlCommand command2 = new SqlCommand(sql2, connection); command2.ExecuteNonQuery(); connection.Close(); showlist();

textBox1.Text = textBox2.Text = \ }

catch (Exception ex) {

MessageBox.Show(\修改错误!\} } }

4.5.4车辆删除模块

程序运行结果如图4.12所示。

图4. 12车辆删除模块

22

主要的功能代码如下:

private void button1_Click(object sender, EventArgs e) {

if (textBox1.Text == \请输入ID!\ else { try {

string strconn = \Security=True\

SqlConnection connection = new SqlConnection(strconn); string sql2 = \ connection.Open();

SqlCommand command2 = new SqlCommand(sql2, connection); command2.ExecuteNonQuery(); connection.Close(); showlist(); textBox1.Text = \ }

catch (Exception ex) {

MessageBox.Show(\删除错误!\}}}

4.6 项目管理模块

4.6.1项目信息模块

程序运行结果如图4.13所示。

图4.13项目信息模块

23


汽车美容管理系统(5).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:新疆兵团上市公司与地方上市公司的财务风险差异研究

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: