📄 修改库存产品.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)
{
this.textBox2.ReadOnly = false;
this.textBox3.ReadOnly = false;
this.textBox4.ReadOnly = false;
this.textBox5.ReadOnly = false;
this.textBox6.ReadOnly = false;
this.dataGridView1.Enabled = false;
this.comboBox1.Enabled = false;
this.button2.Enabled = true;
this.button3.Enabled = true;
this.button1.Enabled = false;
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();
}
private void button2_Click(object sender, EventArgs e)
{
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.dataGridView1.Enabled = true;
this.comboBox1.Enabled = true;
this.button2.Enabled = false;
this.button3.Enabled = false;
this.button1.Enabled = true;
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(),int .Parse(this.textBox6.Text.Trim()), a, b, c, d, ee, int.Parse(f));
if (ii == 0) MessageBox.Show("修改失败");
else MessageBox.Show("修改成功");
}
catch (Exception exc)
{
MessageBox.Show("修改失败" + exc.Message);
}
this.库存类型TableAdapter.Fill(this.sqldatabase_DataDataSet.库存类型);
}
private void button3_Click(object sender, EventArgs e)
{
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.dataGridView1.Enabled = true;
this.comboBox1.Enabled = true;
this.button2.Enabled = false;
this.button3.Enabled = false;
this.button1.Enabled = true;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -