📄 editcustomer.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
namespace Eboer.MIS.MF.WinForm
{
/// <summary>
/// EditCustomer 的摘要说明。
/// </summary>
public class EditCustomer : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox corName;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox sign;
private System.Windows.Forms.ComboBox area;
/// <summary>
/// 指定了需要修改的自动编号,此表示保存操作修改
/// </summary>
private string autoID = null;
/// <summary>
/// 供货商或是订货商,默认订货商
/// </summary>
public string comType = "SELL";
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.TextBox openBank;
private System.Windows.Forms.TextBox bankAccName;
private System.Windows.Forms.TextBox bankAccNum;
private System.Windows.Forms.TextBox address;
private System.Windows.Forms.TextBox mobile;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox email;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox http;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox fax;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox tel;
private System.Windows.Forms.TextBox contacter;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox zip;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox memo;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.Label label19;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.ComboBox jhdz;
private System.Windows.Forms.ComboBox jhhf;
private System.Windows.Forms.ComboBox hkfs;
private System.Windows.Forms.ComboBox yhzf;
private System.Windows.Forms.ComboBox fplx;
/// <summary>
/// 父窗体
/// </summary>
public ListForCumstor list = null;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.TextBox deler;
public ListForCumstor _lf = null;
public EditCustomer(ListForCumstor list)
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
this.list = list;
this.LoadAreaItem();
}
/// <summary>
/// 载入信息
/// </summary>
private void LoadInfo(){
if(this.autoID != null){
try{
string sql = "select * from CorpColl where autoID=" + this.autoID;
OleDbDataAdapter adp = new OleDbDataAdapter(sql,Public.conn);
DataSet ds = new DataSet();
adp.Fill(ds,"info");
if(ds != null && ds.Tables[0].Rows.Count > 0){
DataRow row = ds.Tables[0].Rows[0];
this.sign.Text = row["sign"].ToString();
this.corName.Text = row["corName"].ToString();
this.contacter.Text = row["corContacter"].ToString();
this.area.Text = row["areaName"].ToString();
this.address.Text = row["address"].ToString();
this.zip.Text = row["pcCode"].ToString();
this.tel.Text = row["tel"].ToString();
this.fax.Text = row["fax"].ToString();
this.mobile.Text = row["mobileTel"].ToString();
this.email.Text = row["email"].ToString();
this.http.Text = row["http"].ToString();
this.memo.Text = row["content"].ToString();
this.jhdz.Text = row["jhdz"].ToString();
this.jhhf.Text = row["jhfs"].ToString();
this.hkfs.Text = row["hkfs"].ToString();
this.yhzf.Text = row["yhzf"].ToString();
this.fplx.Text = row["fplx"].ToString();
this.deler.Text = row["deler"].ToString();
this.openBank.Text = row["openBank"].ToString();
this.bankAccName.Text = row["bankAccName"].ToString();
this.bankAccNum.Text = row["bankAccNum"].ToString();
this.sign.Enabled = false;
}
}catch(Exception ex){
MessageBox.Show(ex.Message.ToString());
return;
}
}else{
this.sign.Text = Public.GetNewInfoID("CorpColl","sign");
}
}
/// <summary>
/// 载入地区选择条目
/// </summary>
private void LoadAreaItem(){
DataSet ds = Public.GetDireItem("地区(ZD006");
if(ds != null){
for(int i=0;i<ds.Tables[0].Rows.Count;i++){
DataRow row = ds.Tables[0].Rows[i];
this.area.Items.Add(row["diSign"].ToString() + "|" + row["diName"].ToString());
}
}
//交货地址
ds = Public.GetDireItem("交货地点(ZD002");
if(ds != null){
for(int i=0;i<ds.Tables[0].Rows.Count;i++){
DataRow row = ds.Tables[0].Rows[i];
this.jhdz.Items.Add(row["diName"].ToString());
}
}
//交货方式
ds = Public.GetDireItem("交货方法(ZD008");
if(ds != null){
for(int i=0;i<ds.Tables[0].Rows.Count;i++){
DataRow row = ds.Tables[0].Rows[i];
this.jhhf.Items.Add(row["diName"].ToString());
}
}
//付款方式
ds = Public.GetDireItem("付款方法(ZD004");
if(ds != null){
for(int i=0;i<ds.Tables[0].Rows.Count;i++){
DataRow row = ds.Tables[0].Rows[i];
this.hkfs.Items.Add(row["diName"].ToString());
}
}
//付款方式
ds = Public.GetDireItem("运费支付方式(ZD009");
if(ds != null){
for(int i=0;i<ds.Tables[0].Rows.Count;i++){
DataRow row = ds.Tables[0].Rows[i];
this.yhzf.Items.Add(row["diName"].ToString());
}
}
//付款方式
ds = Public.GetDireItem("发票类型(ZD003");
if(ds != null){
for(int i=0;i<ds.Tables[0].Rows.Count;i++){
DataRow row = ds.Tables[0].Rows[i];
this.fplx.Items.Add(row["diName"].ToString());
}
}
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.memo = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.mobile = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.email = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.http = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.fax = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.tel = new System.Windows.Forms.TextBox();
this.contacter = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.zip = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.address = new System.Windows.Forms.TextBox();
this.area = new System.Windows.Forms.ComboBox();
this.sign = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.corName = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.deler = new System.Windows.Forms.TextBox();
this.label21 = new System.Windows.Forms.Label();
this.bankAccNum = new System.Windows.Forms.TextBox();
this.bankAccName = new System.Windows.Forms.TextBox();
this.openBank = new System.Windows.Forms.TextBox();
this.label15 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.fplx = new System.Windows.Forms.ComboBox();
this.yhzf = new System.Windows.Forms.ComboBox();
this.hkfs = new System.Windows.Forms.ComboBox();
this.jhhf = new System.Windows.Forms.ComboBox();
this.jhdz = new System.Windows.Forms.ComboBox();
this.label20 = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.memo);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.mobile);
this.groupBox1.Controls.Add(this.label11);
this.groupBox1.Controls.Add(this.email);
this.groupBox1.Controls.Add(this.label10);
this.groupBox1.Controls.Add(this.http);
this.groupBox1.Controls.Add(this.label9);
this.groupBox1.Controls.Add(this.fax);
this.groupBox1.Controls.Add(this.label8);
this.groupBox1.Controls.Add(this.tel);
this.groupBox1.Controls.Add(this.contacter);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.zip);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.address);
this.groupBox1.Controls.Add(this.area);
this.groupBox1.Controls.Add(this.sign);
this.groupBox1.Controls.Add(this.label12);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.corName);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Location = new System.Drawing.Point(8, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(520, 240);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "基本资料";
//
// memo
//
this.memo.Location = new System.Drawing.Point(64, 184);
this.memo.Multiline = true;
this.memo.Name = "memo";
this.memo.Size = new System.Drawing.Size(432, 48);
this.memo.TabIndex = 12;
this.memo.Text = "";
//
// label3
//
this.label3.Location = new System.Drawing.Point(8, 192);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(56, 16);
this.label3.TabIndex = 31;
this.label3.Text = "备 注";
//
// mobile
//
this.mobile.Location = new System.Drawing.Point(336, 88);
this.mobile.MaxLength = 1000;
this.mobile.Name = "mobile";
this.mobile.Size = new System.Drawing.Size(160, 21);
this.mobile.TabIndex = 6;
this.mobile.Text = "";
//
// label11
//
this.label11.Location = new System.Drawing.Point(280, 96);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(56, 16);
this.label11.TabIndex = 29;
this.label11.Text = "手 机";
//
// email
//
this.email.Location = new System.Drawing.Point(336, 136);
this.email.MaxLength = 1000;
this.email.Name = "email";
this.email.Size = new System.Drawing.Size(160, 21);
this.email.TabIndex = 10;
this.email.Text = "";
//
// label10
//
this.label10.Location = new System.Drawing.Point(280, 144);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(56, 16);
this.label10.TabIndex = 27;
this.label10.Text = "E-mail";
//
// http
//
this.http.Location = new System.Drawing.Point(64, 160);
this.http.MaxLength = 1000;
this.http.Name = "http";
this.http.Size = new System.Drawing.Size(432, 21);
this.http.TabIndex = 11;
this.http.Text = "";
//
// label9
//
this.label9.Location = new System.Drawing.Point(8, 168);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(312, 16);
this.label9.TabIndex = 25;
this.label9.Text = "网 址";
//
// fax
//
this.fax.Location = new System.Drawing.Point(336, 112);
this.fax.MaxLength = 1000;
this.fax.Name = "fax";
this.fax.Size = new System.Drawing.Size(160, 21);
this.fax.TabIndex = 8;
this.fax.Text = "";
//
// label8
//
this.label8.Location = new System.Drawing.Point(280, 120);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(56, 16);
this.label8.TabIndex = 23;
this.label8.Text = "传 真";
//
// tel
//
this.tel.Location = new System.Drawing.Point(64, 112);
this.tel.MaxLength = 1000;
this.tel.Name = "tel";
this.tel.Size = new System.Drawing.Size(176, 21);
this.tel.TabIndex = 7;
this.tel.Text = "";
//
// contacter
//
this.contacter.Location = new System.Drawing.Point(64, 88);
this.contacter.MaxLength = 1000;
this.contacter.Name = "contacter";
this.contacter.Size = new System.Drawing.Size(176, 21);
this.contacter.TabIndex = 5;
this.contacter.Text = "";
//
// label7
//
this.label7.Location = new System.Drawing.Point(8, 96);
this.label7.Name = "label7";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -