1、自动包装机数控软件源码using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;using System.Data.SqlClient;namespace WindowsApplication4private void sure_button_Click(object sender,System.EventArgs e)if(textID.Text.Trim()!=string.Empty)
2、userID=textID.Text.Trim();elseMessageBox.Show();return;passWord=textPwdOld.Text.Trim();elseMessageBox.Show();return;if(textPwdNew1.Text.Trim()!=string.Empty)NewPassWord1=textPwdNew1.Text.Trim();elseMessageBox.Show();return;NewPassWord2=textPwdNew2.Text.Trim();MessageBox.Show();return;SqlConnection m
3、yConn=null;SqlTransaction UserInsertTra=null;DataSet UserInfoSet=new DataSet();if(NewPassWord1=NewPassWord2)rymyConn=new SqlConnection(server=.;Trusted_Connection=yes;user=sa;pwd=1;database=storage);myConn.Open();PwdAdapter.SelectCommand.CommandText=SELECT*FROM LonInFrm WHERE UserID=+userID+;PwdAdap
4、ter.SelectCommand.Connection=myConn;PwdAdapter.Fill(UserInfoSet,UserInfoTab);if(UserInfoSet.TablesUserInfoTab=null|UserInfoSet.TablesUserInfoTab.Rows.Count=0)MessageBox.Show(User is not exist);this.textID.Focus();this.textID.Select(0,this.textID.Text.Length);return;if(UserInfoSet.TablesUserInfoTab.R
5、ows0PassWord.ToString().Trim()!=passWord)MessageBox.Show(PassWord Error!);this.textPwdOld.Focus();this.textPwdOld.Select(0,this.textPwdOld.Text.Length);return;UserInfoSet.TablesUserInfoTab.Rows0PassWord=NewPassWord1;UserInsertTra=myConn.BeginTransaction();PwdAdapter.UpdateCommand.Connection=myConn;P
6、wdAdapter.UpdateCommand.Transaction=UserInsertTra;PwdAdapter.Update(UserInfoSet.Tables0);UserInsertTra.Commit();MessageBox.Show(OK);catch(Exception ex)UserInsertTra.Rollback();MessageBox.Show(ex.Message);finallyif(myConn.State!=ConnectionState.Closed)myConn.Close();private void esc_button_Click(obje
7、ct sender,System.EventArgs e)this.Close();using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;using System.Data.SqlClient;namespace WindowsApplication4public class ReturnStg:System.Windows.Forms.Formprivate System.Window
8、s.Forms.GroupBox groupBox1;private System.Windows.Forms.Label label2;private System.Windows.Forms.Label label3;private System.Windows.Forms.Label label4;private System.Windows.Forms.Label label5;private System.Windows.Forms.Label label6;private System.Windows.Forms.TextBox textNum2;private System.Wi
9、ndows.Forms.TextBox textDate;private System.Windows.Forms.TextBox textAmount;private System.Windows.Forms.TextBox textMan;private System.Windows.Forms.DataGrid dataGrid1;private DataTable ReturnInfo=new DataTable();private DataSet Returnset=new DataSet();private CurrencyManager ReReport;private SqlT
10、ransaction ReturnTran;private SqlConnection MyConn=new SqlConnection(server=.;Trusted_Connection=yes;user=sa;pwd=1;database=storage);private System.Data.SqlClient.SqlCommand sqlSelectCommand1;private System.Data.SqlClient.SqlCommand sqlInsertCommand1;private System.Data.SqlClient.SqlCommand sqlUpdat
11、eCommand1;private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;private System.Data.SqlClient.SqlConnection sqlConnection1;private System.Windows.Forms.TextBox textDep;private System.Windows.Forms.Button cancel_button;private System.Windows.Forms.Button send_button;private System.Windows.Forms.
12、Button add_button;private System.Data.SqlClient.SqlDataAdapter RetnAdapter;private string oldtxtAmount=;private bool change=false;private System.ComponentModel.Container components=null;public ReturnStg()InitializeComponent();protected override void Dispose(bool disposing)if(disposing)if(components!
13、=null)components.Dispose();base.Dispose(disposing);private void InitializeComponent()this.groupBox1=new System.Windows.Forms.GroupBox();this.textDep=new System.Windows.Forms.TextBox();this.textMan=new System.Windows.Forms.TextBox();this.textAmount=new System.Windows.Forms.TextBox();this.textDate=new
14、 System.Windows.Forms.TextBox();this.textNum2=new System.Windows.Forms.TextBox();this.label6=new System.Windows.Forms.Label();this.label5=new System.Windows.Forms.Label();this.label4=new System.Windows.Forms.Label();this.label3=new System.Windows.Forms.Label();this.label2=new System.Windows.Forms.La
15、bel();this.add_button=new System.Windows.Forms.Button();this.send_button=new System.Windows.Forms.Button();this.cancel_button=new System.Windows.Forms.Button();this.dataGrid1=new System.Windows.Forms.DataGrid();this.RetnAdapter=new System.Data.SqlClient.SqlDataAdapter();this.sqlDeleteCommand1=new Sy
16、stem.Data.SqlClient.SqlCommand();this.sqlConnection1=new System.Data.SqlClient.SqlConnection();this.sqlInsertCommand1=new System.Data.SqlClient.SqlCommand();this.sqlSelectCommand1=new System.Data.SqlClient.SqlCommand();this.sqlUpdateCommand1=new System.Data.SqlClient.SqlCommand();this.groupBox1.Susp
17、endLayout();(System.ComponentModel.ISupportInitialize)(this.dataGrid1).BeginInit();this.SuspendLayout();this.groupBox1.Controls.Add(this.textDep);this.groupBox1.Controls.Add(this.textMan);this.groupBox1.Controls.Add(this.textAmount);this.groupBox1.Controls.Add(this.textDate);this.groupBox1.Controls.
18、Add(this.textNum2);this.groupBox1.Controls.Add(this.label6);this.groupBox1.Controls.Add(this.label5);this.groupBox1.Controls.Add(this.label4);this.groupBox1.Controls.Add(this.label3);this.groupBox1.Controls.Add(this.label2);this.groupBox1.Controls.Add(this.add_button);this.groupBox1.Controls.Add(thi
19、s.send_button);this.groupBox1.Controls.Add(this.cancel_button);this.groupBox1.Location=new System.Drawing.Point(24,192);this.groupBox1.Name=groupBox1;this.groupBox1.Size=new System.Drawing.Size(456,144);this.groupBox1.TabIndex=4;this.groupBox1.TabStop=false;this.groupBox1.Text=;this.textDep.Location
20、=new System.Drawing.Point(80,96);this.textDep.Name=textDep;this.textDep.Size=new System.Drawing.Size(248,21);this.textDep.TabIndex=9;this.textDep.Text=;this.textMan.Location=new System.Drawing.Point(240,56);this.textMan.Name=textMan;this.textMan.Size=new System.Drawing.Size(88,21);this.textMan.TabIn
21、dex=8;this.textMan.Text=;this.textAmount.Location=new System.Drawing.Point(80,56);this.textAmount.Name=textAmount;this.textAmount.Size=new System.Drawing.Size(88,21);this.textAmount.TabIndex=7;this.textAmount.Text=;this.textDate.Location=new System.Drawing.Point(240,16);this.textDate.Name=textDate;t
22、his.textDate.Size=new System.Drawing.Size(88,21);this.textDate.TabIndex=6;this.textDate.Text=;this.textNum2.Location=new System.Drawing.Point(80,16);this.textNum2.Name=textNum2;this.textNum2.Size=new System.Drawing.Size(88,21);this.textNum2.TabIndex=5;this.textNum2.Text=;this.label6.Location=new Sys
23、tem.Drawing.Point(8,96);this.label6.Name=label6;this.label6.Size=new System.Drawing.Size(72,16);this.label6.TabIndex=4;this.label6.Text=;this.label5.Location=new System.Drawing.Point(184,64);this.label5.Name=label5;this.label5.Size=new System.Drawing.Size(56,24);this.label5.TabIndex=3;this.label5.Te
24、xt=;this.label4.Location=new System.Drawing.Point(16,56);this.label4.Name=label4;this.label4.Size=new System.Drawing.Size(48,16);this.label4.TabIndex=2;this.label4.Text=;this.label3.Location=new System.Drawing.Point(176,16);this.label3.Name=label3;this.label3.Size=new System.Drawing.Size(80,16);this
25、.label3.TabIndex=1;this.label3.Text=this.label2.Location=new System.Drawing.Point(16,24);this.label2.Name=label2;this.label2.Size=new System.Drawing.Size(72,16);this.label2.TabIndex=0;this.add_button.Font=new System.Drawing.Font(ok,9F,System.Drawing.FontStyle.Regular,System.Drawing.GraphicsUnit.Poin
26、t,(System.Byte)(134);this.add_button.Location=new System.Drawing.Point(376,16);this.add_button.Name=add_button;this.add_button.Size=new System.Drawing.Size(72,24);this.add_button.TabIndex=1;this.add_button.Click+=new System.EventHandler(this.add_button_Click);this.send_button.Font=new System.Drawing
27、.Font(ok,9F,System.Drawing.FontStyle.Regular,System.Drawing.GraphicsUnit.Point,(System.Byte)(134);this.send_button.Location=new System.Drawing.Point(376,64);this.send_button.Name=send_button;this.send_button.Size=new System.Drawing.Size(72,24);this.send_button.TabIndex=2;this.send_button.Click+=new
28、System.EventHandler(this.send_button_Click);this.cancel_button.Font=new System.Drawing.Font(ok,9F,System.Drawing.FontStyle.Regular,System.Drawing.GraphicsUnit.Point,(System.Byte)(134);this.cancel_button.Location=new System.Drawing.Point(376,112);this.cancel_button.Name=cancel_button;this.cancel_butt
29、on.Size=new System.Drawing.Size(72,24);this.cancel_button.TabIndex=3;this.cancel_button.Click+=new System.EventHandler(this.cancel_button_Click);this.dataGrid1.DataMember=;this.dataGrid1.HeaderForeColor=System.Drawing.SystemColors.ControlText;this.dataGrid1.Location=new System.Drawing.Point(24,8);th
30、is.dataGrid1.Name=dataGrid1;this.dataGrid1.Size=new System.Drawing.Size(456,168);this.dataGrid1.TabIndex=6;this.dataGrid1.Click+=new System.EventHandler(this.dataGrid1_Select);this.RetnAdapter.DeleteCommand=this.sqlDeleteCommand1;this.RetnAdapter.InsertCommand=this.sqlInsertCommand1;this.RetnAdapter.SelectCommand=this.sqlSelectCommand1;this.RetnAdapter.TableMappings.AddRange(new System.Data.Common.DataTableMappingnew System.Data.Common.DataTableMapping(Table,storage_retn,new System.Data.Common.DataColumnMappingUserInfoSet.TablesUserInfoTab.Rows0PassWord=NewPassWord1;UserInsertTra=m
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1