【SQL开源代码栏目提醒】:以下是网学会员为您推荐的SQL开源代码-[C#项目源码][工程-物资管理系统][ FormSuppliesManage cs] - 讲义教程,希望本篇文章对您学习有所帮助。
using System using System.Collections.Generic using System.ComponentModel using System.Data using System.Drawing using System.Text using System.Windows.Forms using DaHua.DAL using DaHua.Common using DaHua.Entity namespace DaHua public partial class FormSuppliesManage : Form private static FormSuppliesManage suppliesManage public static FormSuppliesManage getsuppliesManage if suppliesManage null suppliesManage.IsDisposed suppliesManage new FormSuppliesManage return suppliesManage private FormSuppliesManage InitializeComponent //初始化物资下拉列表 List e_list new List Evaluate e0 new Evaluate e0.Id 0 e0.Evaluate_desc 无 e_list.Adde0 Evaluate e1 new Evaluate e1.Id 1 e1.Evaluate_desc A e_list.Adde1 Evaluate e2 new Evaluate e2.Id 2 e2.Evaluate_desc B e_list.Adde2 Evaluate e3 new Evaluate e3.Id 3 e3.Evaluate_desc C e_list.Adde3 this.comboBox3.DataSource e_list this.comboBox3.ValueMember Id this.comboBox3.DisplayMember Evaluate_desc this.comboBox3.SelectedIndex 0 /// /// 查询 /// /// /// private void button1_Clickobject sender EventArgs e Searchandshow /// /// 查询显示 /// private void Searchandshow string
sql if this.textBox2.Text
sql vendor_name like this.textBox2.Text.ToString string vclass switch this.comboBox5.SelectedItem.ToString case 所有分类: vclass break case A类: vclass A break case B类: vclass B break case C类: vclass C break if vclass if
sql sql sql vendor_class vclass else
sql sql and vendor_class vclass Validator vd new Validator if vd.IsAccordTypethis.textBox3.Text Validator.Operation.Int32 MessageBox.Show输入的供应商积分不正确 提示 return if Convert.ToInt32this.textBox3.Text 0 MessageBox.Show输入的供应商积分不正确 提示 return if
sql sql sql vendor_point Convert.ToInt32this.textBox3.Text.ToString else
sql sql and vendor_point Convert.ToInt32this.textBox3.Text.ToString string sqlall select vendor_novendor_namevendor_classvendor_point from VM_newvendor where
sql DataTable dtvendors new Conn.getAllsqlall this.dataGridView1.DataSource dtvendors if dtvendors.Rows.Count 0 MessageBox.Show没有查询到供应商 return /// /// 显示详情 /// /// /// private void dataGridView1_CellClickobject sender DataGridViewCellEventArgs e if e.RowIndex 0 return string
sql select from VM_newvendor where vendor_no dataGridView1.Rowse.RowIndex.Cells0.Value.ToString DataTable dtvendorpoints new Conn.getAllsql this.textBox5.Text dtvendorpoints.Rows0vendor_no.ToString this.textBox6.Text dtvendorpoints.Rows0vendor_name.ToString this.textBox7.Text dtvendorpoints.Rows0pyCode.ToString this.textBox8.Text dtvendorpoints.Rows0date_created.ToString this.textBox9.Text dtvendorpoints.Rows0country.ToString this.textBox10.Text dtvendorpoints.Rows0addr1.ToString this.textBox11.Text dtvendorpoints.Rows0zip_code1.ToString this.textBox12.Text dtvendorpoints.Rows0phone1.ToString this.textBox13.Text dtvendorpoints.Rows0contact1.ToString this.textBox14.Text dtvendorpoints.Rows0phone2.ToString this.textBox15.Text dtvendorpoints.Rows0cable1.ToString this.textBox16.Text dtvendorpoints.Rows0fax1.ToString this.textBox17.Text dtvendorpoints.Rows0contact2.ToString this.textBox18.Text dtvendorpoints.Rows0telephone_o.ToString this.textBox19.Text dtvendorpoints.Rows0fax2.ToString this.textBox20.Text dtvendorpoints.Rows0telephone_h.ToString this.textBox21.Text dtvendorpoints.Rows0cable2.ToString this.textBox22.Text dtvendorpoints.Rows0tax_value.ToString this.textBox23.Text dtvendorpoints.Rows0e_mail.ToString this.textBox24.Text dtvendorpoints.Rows0bank_name.ToString this.textBox25.Text dtvendorpoints.Rows0account_no.ToString this.textBox26.Text dtvendorpoints.Rows0currency_code.ToString this.textBox27.Text dtvendorpoints.Rows0date_updated.ToString this.textBox28.Text dtvendorpoints.Rows0http.ToString this.textBox29.Text dtvendorpoints.Rows0vendor_ziben.ToString this.textBox30.Text dtvendorpoints.Rows0vendor_persons.ToString this.textBox1.Text dtvendorpoints.Rows0vendor_paystyle.ToString this.textBox31.Text dtvendorpoints.Rows0vendor_products.ToString this.textBox32.Text dtvendorpoints.Rows0vendor_Cooperation.ToString this.comboBox1.Text 2323 this.comboBox2.Text 3232 this.comboBox3.Text dtvendorpoints.Rows0vendor_class.ToString //this.checkBox1.Text //this.checkBox2.Text //this.checkBox3.Text vendor_class //this.checkBox4.Text //this.checkBox1.Checked false //this.checkBox2.Checked false //this.checkBox3.Checked false //this.checkBox4.Checked false //this.checkBox5.Checked false
sql select ID_useinfokoupointkoupersonkoutime from PointsJL where vendor_no dataGridView1.Rowse.RowIndex.Cells0.Value.ToString DataTable dtpoints new Conn.getAllsql //dataGridView2.DataSource null dataGridView2.DataSource dtpoints //读取积分
sql select vendor_pointvendor_no from vendor_points where vendor_no dataGridView1.Rowse.RowIndex.Cells0.Value.ToString DataTable now_points new Conn.getAllsql this.label现在积分.Text now_points.Rows0vendor_point.ToString this.label商编号.Text now_points.Rows0vendor_no.ToString /// /// 更改积分按钮 /// /// /// private void button5_Clickobject sender EventArgs e int jifen 0 try jifen int.Parsethis.textBox更改积分.Text.Trim catch MessageBox.Show积分必须为整数警告MessageBoxButtons.OKMessageBoxIcon.Warning return int now_jifen int.Parsethis.label现在积分.Text int kou_jifen now_jifen - jifen try string
sql update vendor_points set vendor_point this.textBox更改积分.Text where vendor_no this.label商编号.Text new Conn.querysql
sql insert into pointsjl vendor_noid_useinfokoupointkoutimekouperson values this.label商编号.Text 0 kou_jifen.ToString getdate Identity.GetIdentity.UserName int ir new Conn.querysql if ir 0 MessageBox.Show积分更新成功 提示 MessageBoxButtons.OK MessageBoxIcon.Information this.UpdateJFthis.label商编号.Text else MessageBox.Show积分更新失败 警告 MessageBoxButtons.OK MessageBoxIcon.Warning catch MessageBox.Show数据库错误积分更新失败 警告 MessageBoxButtons.OK MessageBoxIcon.Warning /// /// 添加按钮 /// /// /// private void button6_Clickobject sender EventArgs e setnull /// /// 清空详情 /// private void setnull this.textBox5.Text this.textBox6.Text this.textBox7.Text this.textBox8.Text this.textBox9.Text this.textBox10.Text this.textBox11.Text this.textBox12.Text this.textBox13.Text this.textBox14.Text this.textBox15.Text this.textBox16.Text this.textBox17.Text this.textBox18.Text this.textBox19.Text this.textBox20.Text this.textBox21.Text this.textBox22.Text this.textBox23.Text this.textBox24.Text this.textBox25.Text this.textBox26.Text this.textBox27.Text this.textBox28.Text this.textBox29.Text this.textBox30.Text this.textBox31.Text this.textBox32.Text //this.checkBox1.Text //this.checkBox2.Text //this.checkBox3.Text //this.checkBox4.Text //this.checkBox1.Checked false //this.checkBox2.Checked false //this.checkBox3.Checked false //this.checkBox4.Checked false //this.checkBox5.Checked false private void button2_Clickobject sender EventArgs e /// /// 删除按钮 /// /// /// private void button3_Clickobject sender EventArgs e if this.textBox5.Text MessageBox.Show请选择要删除的供应商 提示 return string
sql delete from Vendor_points where vendor_no this.textBox5.Text.ToString
sql sql delete from Vendor where vendor_no this.textBox5.Text.ToString int alinenew Conn.querysql Searchandshow setnull /// /// 加载 /// /// /// private void FormSuppliesManage_Loadobject sender EventArgs e this.comboBox5.SelectedIndex 0 this.textBox3.Text 0 /// /// 修改按钮 /// /// /// private void button7_Clickobject sender EventArgs e if this.textBox5.Text MessageBox.Show请先选择要删除的供应商提示 return if this.textBox6.Text MessageBox.Show供应商名称不能为空 提示 string
sql update Vendor set vendor_namethis.textBox6.Text.ToStringaddr1this.textBox10.Text.ToStringcountrythis.textBox9.Text.ToStringPYCodethis.textBox7.Text.ToString where vendor_nothis.textBox5.Text.ToString int kline new Conn.querysql Searchandshow /// /// 清空按钮 /// /// /// private void button4_Click_1object sender EventArgs e this.textBox2.Text this.comboBox5.SelectedIndex 0 this.textBox3.Text 0 /// /// 积分更新成功后更新积分 /// /// private void UpdateJFstring vendor_no //读取积分 string
sql select vendor_pointvendor_no from vendor_points where vendor_no vendor_no DataTable now_points new Conn.getAllsql this.label现在积分.Text now_points.Rows0vendor_point.ToString this.label商编号.Text now_points.Rows0vendor_no.ToString this.textBox更改积分.Text /// /// 保存记录 /// /// /// private void button8_Clickobject sender EventArgs e string vendor_ziben this.textBox29.Text//注册资本 string vendor_class//ABC分类 if this.comboBox3.Text A this.comboBox3.Text C this.comboBox3.TextB vendor_class this.comboBox3.Text string vendor_persons this.textBox30.Text//员工人数 string vendor_products this.textBox31.Text//主要产品 string vendor_paystyle this.textBox1.Text//付款方式 string vendor_cooperation this.textBox32.Text//合作说明 string vendor_no this.textBox5.Text//供应商编码 string
sql update vendor_points set vendor_classvendor_classvendor_personsvendor_persons vendor_zibenvendor_zibenvendor_productsvendor_productsvendor_paystylevendor_paystyle vendor_cooperationvendor_cooperation where vendor_no vendor_no int ir new Conn.querysql if ir 0 MessageBox.Show供应商信息修改成功 提示 MessageBoxButtons.OK MessageBoxIcon.Information return else MessageBox.Show供应商信息修改失败请重试 警告 MessageBoxButtons.OK MessageBoxIcon.Warning return
上一篇:
特别推荐:纯VB_NET代码直接生成Excel文件(不需要Excel)
下一篇:
关于大学英语教学