📄 provider.cs
字号:
this.label5.TabIndex = 4;
this.label5.Text = "联系电话";
//
// label4
//
this.label4.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label4.Location = new System.Drawing.Point(8, 136);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(72, 23);
this.label4.TabIndex = 3;
this.label4.Text = "公司地址";
//
// label3
//
this.label3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label3.Location = new System.Drawing.Point(256, 64);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(72, 23);
this.label3.TabIndex = 2;
this.label3.Text = "联系人";
//
// label2
//
this.label2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label2.Location = new System.Drawing.Point(8, 104);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(72, 23);
this.label2.TabIndex = 1;
this.label2.Text = "公司名称";
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.Location = new System.Drawing.Point(8, 64);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(72, 23);
this.label1.TabIndex = 0;
this.label1.Text = "供应商编号";
//
// label6
//
this.label6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label6.Location = new System.Drawing.Point(256, 104);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(72, 23);
this.label6.TabIndex = 5;
this.label6.Text = "公司Email";
//
// textPostalCode
//
this.textPostalCode.Location = new System.Drawing.Point(328, 96);
this.textPostalCode.Name = "textPostalCode";
this.textPostalCode.Size = new System.Drawing.Size(120, 23);
this.textPostalCode.TabIndex = 16;
this.textPostalCode.Text = "";
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(24, 56);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(50, 30);
this.btnCancel.TabIndex = 19;
this.btnCancel.Text = "取消";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnExit
//
this.btnExit.Location = new System.Drawing.Point(384, 312);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(72, 40);
this.btnExit.TabIndex = 18;
this.btnExit.Text = "退出";
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// btnAdd
//
this.btnAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAdd.Location = new System.Drawing.Point(16, 24);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(56, 24);
this.btnAdd.TabIndex = 2;
this.btnAdd.Text = "添加";
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// btnDelete
//
this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDelete.Location = new System.Drawing.Point(216, 296);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(56, 24);
this.btnDelete.TabIndex = 3;
this.btnDelete.Text = "删除";
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// btnModify
//
this.btnModify.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnModify.Location = new System.Drawing.Point(88, 24);
this.btnModify.Name = "btnModify";
this.btnModify.Size = new System.Drawing.Size(56, 24);
this.btnModify.TabIndex = 5;
this.btnModify.Text = "修改";
this.btnModify.Click += new System.EventHandler(this.btnModify_Click);
//
// btnApply
//
this.btnApply.Location = new System.Drawing.Point(88, 56);
this.btnApply.Name = "btnApply";
this.btnApply.Size = new System.Drawing.Size(50, 30);
this.btnApply.TabIndex = 20;
this.btnApply.Text = "应用";
this.btnApply.Click += new System.EventHandler(this.btnApply_Click);
//
// groupBox3
//
this.groupBox3.Controls.Add(this.btnModify);
this.groupBox3.Controls.Add(this.btnAdd);
this.groupBox3.Controls.Add(this.btnApply);
this.groupBox3.Controls.Add(this.btnCancel);
this.groupBox3.Location = new System.Drawing.Point(24, 272);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(176, 96);
this.groupBox3.TabIndex = 21;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "添加/修改";
//
// sqlConnection1
//
this.sqlConnection1.ConnectionString = "workstation id=ANDY;packet size=4096;integrated security=SSPI;data source=ANDY;pe" +
"rsist security info=False;initial catalog=Sell";
//
// sqlDataAdapter1
//
this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand1;
this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "Provider", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("ProviderID", "ProviderID"),
new System.Data.Common.DataColumnMapping("ProviderName", "ProviderName"),
new System.Data.Common.DataColumnMapping("ProviderAddress", "ProviderAddress"),
new System.Data.Common.DataColumnMapping("ProviderPhoneNo", "ProviderPhoneNo"),
new System.Data.Common.DataColumnMapping("ProviderEmail", "ProviderEmail"),
new System.Data.Common.DataColumnMapping("ProviderPeople", "ProviderPeople"),
new System.Data.Common.DataColumnMapping("ProviderRemark", "ProviderRemark")})});
this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;
//
// sqlDeleteCommand1
//
this.sqlDeleteCommand1.CommandText = @"DELETE FROM Provider WHERE (ProviderID = @Original_ProviderID) AND (ProviderAddress = @Original_ProviderAddress OR @Original_ProviderAddress IS NULL AND ProviderAddress IS NULL) AND (ProviderEmail = @Original_ProviderEmail OR @Original_ProviderEmail IS NULL AND ProviderEmail IS NULL) AND (ProviderName = @Original_ProviderName OR @Original_ProviderName IS NULL AND ProviderName IS NULL) AND (ProviderPeople = @Original_ProviderPeople OR @Original_ProviderPeople IS NULL AND ProviderPeople IS NULL) AND (ProviderPhoneNo = @Original_ProviderPhoneNo OR @Original_ProviderPhoneNo IS NULL AND ProviderPhoneNo IS NULL) AND (ProviderRemark = @Original_ProviderRemark OR @Original_ProviderRemark IS NULL AND ProviderRemark IS NULL)";
this.sqlDeleteCommand1.Connection = this.sqlConnection1;
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ProviderID", System.Data.SqlDbType.VarChar, 5, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ProviderID", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ProviderAddress", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ProviderAddress", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ProviderEmail", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ProviderEmail", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ProviderName", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ProviderName", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ProviderPeople", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ProviderPeople", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ProviderPhoneNo", System.Data.SqlDbType.VarChar, 15, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ProviderPhoneNo", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ProviderRemark", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ProviderRemark", System.Data.DataRowVersion.Original, null));
//
// sqlInsertCommand1
//
this.sqlInsertCommand1.CommandText = @"INSERT INTO Provider(ProviderID, ProviderName, ProviderAddress, ProviderPhoneNo, ProviderEmail, ProviderPeople, ProviderRemark) VALUES (@ProviderID, @ProviderName, @ProviderAddress, @ProviderPhoneNo, @ProviderEmail, @ProviderPeople, @ProviderRemark); SELECT ProviderID, ProviderName, ProviderAddress, ProviderPhoneNo, ProviderEmail, ProviderPeople, ProviderRemark FROM Provider WHERE (ProviderID = @ProviderID)";
this.sqlInsertCommand1.Connection = this.sqlConnection1;
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ProviderID", System.Data.SqlDbType.VarChar, 5, "ProviderID"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ProviderName", System.Data.SqlDbType.VarChar, 20, "ProviderName"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ProviderAddress", System.Data.SqlDbType.VarChar, 50, "ProviderAddress"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ProviderPhoneNo", System.Data.SqlDbType.VarChar, 15, "ProviderPhoneNo"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ProviderEmail", System.Data.SqlDbType.VarChar, 20, "ProviderEmail"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ProviderPeople", System.Data.SqlDbType.VarChar, 20, "ProviderPeople"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ProviderRemark", System.Data.SqlDbType.VarChar, 50, "ProviderRemark"));
//
// sqlSelectCommand1
//
this.sqlSelectCommand1.CommandText = "SELECT ProviderID, ProviderName, ProviderAddress, ProviderPhoneNo, ProviderEmail," +
" ProviderPeople, ProviderRemark FROM Provider";
this.sqlSelectCommand1.Connection = this.sqlConnection1;
//
// sqlUpdateCommand1
//
this.sqlUpdateCommand1.CommandText = @"UPDATE Provider SET ProviderID = @ProviderID, ProviderName = @ProviderName, ProviderAddress = @ProviderAddress, ProviderPhoneNo = @ProviderPhoneNo, ProviderEmail = @ProviderEmail, ProviderPeople = @ProviderPeople, ProviderRemark = @ProviderRemark WHERE (ProviderID = @Original_ProviderID) AND (ProviderAddress = @Original_ProviderAddress OR @Original_ProviderAddress IS NULL AND ProviderAddress IS NULL) AND (ProviderEmail = @Original_ProviderEmail OR @Original_ProviderEmail IS NULL AND ProviderEmail IS NULL) AND (ProviderName = @Original_ProviderName OR @Original_ProviderName IS NULL AND ProviderName IS NULL) AND (ProviderPeople = @Original_ProviderPeople OR @Original_ProviderPeople IS NULL AND ProviderPeople IS NULL) AND (ProviderPhoneNo = @Original_ProviderPhoneNo OR @Original_ProviderPhoneNo IS NULL AND ProviderPhoneNo IS NULL) AND (ProviderRemark = @Original_ProviderRemark OR @Original_ProviderRemark IS NULL AND ProviderRemark IS NULL); SELECT ProviderID, ProviderName, ProviderAddress, ProviderPhoneNo, ProviderEmail, ProviderPeople, ProviderRemark FROM Provider WHERE (ProviderID = @ProviderID)";
this.sqlUpdateCommand1.Connection = this.sqlConnection1;
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ProviderID", System.Data.SqlDbType.VarChar, 5, "ProviderID"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ProviderName", System.Data.SqlDbType.VarChar, 20, "ProviderName"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ProviderAddress", System.Data.SqlDbType.VarChar, 50, "ProviderAddress"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ProviderPhoneNo", System.Data.SqlDbType.VarChar, 15, "ProviderPhoneNo"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ProviderEmail", System.Data.SqlDbType.VarChar, 20, "ProviderEmail"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ProviderPeople", System.Data.SqlDbType.VarChar, 20, "ProviderPeople"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ProviderRemark", System.Data.SqlDbType.VarChar, 50, "ProviderRemark"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ProviderID", System.Data.SqlDbType.VarChar, 5, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ProviderID", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ProviderAddress", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ProviderAddress", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ProviderEmail", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ProviderEmail", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ProviderName", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ProviderName", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ProviderPeople", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ProviderPeople", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ProviderPhoneNo", System.Data.SqlDbType.VarChar, 15, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ProviderPhoneNo", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ProviderRemark", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ProviderRemark", System.Data.DataRowVersion.Original, null));
//
// objDataSetProvider
//
this.objDataSetProvider.DataSetName = "DataSetProvider";
this.objDataSetProvider.Locale = new System.Globalization.CultureInfo("zh-CN");
//
// Provider
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(544, 397);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnDelete);
this.Controls.Add(this.btnExit);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Provider";
this.Text = "供应商管理";
this.Load += new System.EventHandler(this.Provider_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.objDataSetProvider)).EndInit();
this.ResumeLayout(false);
}
#endregion
private void menuItem7_Click(object sender, System.EventArgs e)
{
this.Close();
}
public void ErrorHandle(System.Exception E)
{
MessageBox.Show(E.ToString());
}
private void ButtonPositonChange()
{
this.btnPrevious.Enabled=true;
this.btnNext.Enabled=true;
this.btnFirst.Enabled=true;
this.btnLast.Enabled=true;
if(this.BindingContext[this.objDataSetProvider,"Provider"].Position==0)
{
this.btnFirst.Enabled=false;
this.btnPrevious.Enabled=false;
}
if(this.BindingContext[this.objDataSetProvider,"Provider"].Position==this.BindingContext[this.objDataSetProvider,"Provider"].Count-1)
{
this.btnNext.Enabled=false;
this.btnLast.Enabled=false;
}
}
private void DatasetPostionChange()
{
this.lblDatasetPosition.Text=(this.BindingContext[this.objDataSetProvider,"Provider"].Position+1)+"的"+
(this.BindingContext[this.objDataSetProvider,"Provider"].Count);
}
private void TextEnableControl(bool valid)
{
if(valid)
{
this.textId.Enabled=true;
this.textName.Enabled=true;
this.textPeople.Enabled=true;
this.textTelNo.Enabled=true;
//this.textFaxNo.Enabled=true;
this.textAddress.Enabled=true;
this.textPostalCode.Enabled=true;
//this.textWebSite.Enabled=true;
this.textRemark.Enabled=true;
}
else
{
this.textId.Enabled=false;
this.textName.Enabled=false;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -