📄 修改厂家信息.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace 计量
{
public partial class 修改厂家信息 : Form
{
string a = "", b = "", c = "", d = "", ee = "", f = "";
public 修改厂家信息()
{
InitializeComponent();
}
private void 修改厂家信息_Load(object sender, EventArgs e)
{
// TODO: 这行代码将数据加载到表“sqldatabase_DataDataSet.厂家信息表”中。您可以根据需要移动或移除它。
this.厂家信息表TableAdapter.Fill(this.sqldatabase_DataDataSet.厂家信息表);
this.textBox1.ReadOnly = true;
this.textBox2.ReadOnly = true;
this.textBox3.ReadOnly = true;
this.textBox4.ReadOnly = true;
this.textBox5.ReadOnly = true;
this.textBox6.ReadOnly = true;
this.button2.Enabled = false;
this.button3.Enabled = false;
}
private void button1_Click(object sender, EventArgs e)
{
a = this.textBox1.Text.Trim();
b = this.textBox2.Text.Trim();
c = this.textBox3.Text.Trim();
d = this.textBox4.Text.Trim();
ee = this.textBox5.Text.Trim();
f = this.textBox6.Text.Trim();
this.textBox1.ReadOnly = false;
this.textBox2.ReadOnly = false;
this.textBox3.ReadOnly = false;
this.textBox4.ReadOnly = false;
this.textBox5.ReadOnly = false;
this.textBox6.ReadOnly = false;
this.button2.Enabled = true;
this.button3.Enabled = true;
this.button1.Enabled = false;
this.dataGridView1.Enabled = false;
this.comboBox1.Enabled = false;
}
private void button2_Click(object sender, EventArgs e)
{
try
{
int ii = this.厂家信息表TableAdapter.Update(this.textBox1.Text.Trim(), this.textBox2.Text.Trim(), this.textBox3.Text.Trim(), this.textBox4.Text.Trim(), this.textBox5.Text.Trim(), this.textBox6.Text.Trim(), a, b, c, d, ee, f);
if (ii == 0) MessageBox.Show("修改失败");
else MessageBox.Show("修改成功");
}
catch (Exception exc)
{
MessageBox.Show("修改失败" + exc.Message);
}
this.button2.Enabled = false;
this.button3.Enabled = false;
this.comboBox1.Enabled = true;
this.button1.Enabled = true;
this.dataGridView1.Enabled = true;
this.厂家信息表TableAdapter.Fill(this.sqldatabase_DataDataSet.厂家信息表);
this.textBox1.ReadOnly = true;
this.textBox2.ReadOnly = true;
this.textBox3.ReadOnly = true;
this.textBox4.ReadOnly = true;
this.textBox5.ReadOnly = true;
this.textBox6.ReadOnly = true;
}
private void button3_Click(object sender, EventArgs e)
{
this.button2.Enabled = false;
this.button3.Enabled = false;
this.comboBox1.Enabled = true;
this.button1.Enabled = true;
this.dataGridView1.Enabled = true;
this.厂家信息表TableAdapter.Fill(this.sqldatabase_DataDataSet.厂家信息表);
this.textBox1.ReadOnly = true;
this.textBox2.ReadOnly = true;
this.textBox3.ReadOnly = true;
this.textBox4.ReadOnly = true;
this.textBox5.ReadOnly = true;
this.textBox6.ReadOnly = true;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -