⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 editcustomer.cs

📁 机械制造业信息管理系统(含源码) 是为一个粮仪厂开发的
💻 CS
📖 第 1 页 / 共 2 页
字号:
			this.label7.Size = new System.Drawing.Size(56, 16);
			this.label7.TabIndex = 20;
			this.label7.Text = "联 系 人";
			// 
			// label6
			// 
			this.label6.Location = new System.Drawing.Point(8, 120);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(56, 16);
			this.label6.TabIndex = 19;
			this.label6.Text = "联系电话";
			// 
			// zip
			// 
			this.zip.Location = new System.Drawing.Point(64, 136);
			this.zip.MaxLength = 6;
			this.zip.Name = "zip";
			this.zip.Size = new System.Drawing.Size(176, 21);
			this.zip.TabIndex = 9;
			this.zip.Text = "";
			// 
			// label5
			// 
			this.label5.Location = new System.Drawing.Point(8, 144);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(56, 16);
			this.label5.TabIndex = 17;
			this.label5.Text = "邮政编码";
			// 
			// address
			// 
			this.address.Location = new System.Drawing.Point(64, 62);
			this.address.Name = "address";
			this.address.Size = new System.Drawing.Size(432, 21);
			this.address.TabIndex = 4;
			this.address.Text = "";
			// 
			// area
			// 
			this.area.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.area.Location = new System.Drawing.Point(344, 16);
			this.area.Name = "area";
			this.area.Size = new System.Drawing.Size(160, 20);
			this.area.TabIndex = 2;
			// 
			// sign
			// 
			this.sign.Location = new System.Drawing.Point(64, 16);
			this.sign.Name = "sign";
			this.sign.Size = new System.Drawing.Size(184, 21);
			this.sign.TabIndex = 1;
			this.sign.Text = "";
			// 
			// label12
			// 
			this.label12.Location = new System.Drawing.Point(8, 24);
			this.label12.Name = "label12";
			this.label12.Size = new System.Drawing.Size(56, 16);
			this.label12.TabIndex = 6;
			this.label12.Text = "手工编号";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(288, 24);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(56, 16);
			this.label2.TabIndex = 2;
			this.label2.Text = "所在地区";
			// 
			// corName
			// 
			this.corName.Location = new System.Drawing.Point(64, 40);
			this.corName.Name = "corName";
			this.corName.Size = new System.Drawing.Size(432, 21);
			this.corName.TabIndex = 3;
			this.corName.Text = "";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(8, 48);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(56, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "单位名称";
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(8, 72);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(56, 16);
			this.label4.TabIndex = 0;
			this.label4.Text = "联系地址";
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(400, 424);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(64, 23);
			this.button1.TabIndex = 2;
			this.button1.Text = "保 存";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// button4
			// 
			this.button4.Location = new System.Drawing.Point(464, 424);
			this.button4.Name = "button4";
			this.button4.Size = new System.Drawing.Size(64, 23);
			this.button4.TabIndex = 5;
			this.button4.Text = "取 消";
			this.button4.Click += new System.EventHandler(this.button4_Click);
			// 
			// groupBox3
			// 
			this.groupBox3.Controls.Add(this.deler);
			this.groupBox3.Controls.Add(this.label21);
			this.groupBox3.Controls.Add(this.bankAccNum);
			this.groupBox3.Controls.Add(this.bankAccName);
			this.groupBox3.Controls.Add(this.openBank);
			this.groupBox3.Controls.Add(this.label15);
			this.groupBox3.Controls.Add(this.label14);
			this.groupBox3.Controls.Add(this.label13);
			this.groupBox3.Location = new System.Drawing.Point(8, 256);
			this.groupBox3.Name = "groupBox3";
			this.groupBox3.Size = new System.Drawing.Size(256, 144);
			this.groupBox3.TabIndex = 6;
			this.groupBox3.TabStop = false;
			this.groupBox3.Text = "银行帐号";
			// 
			// deler
			// 
			this.deler.Location = new System.Drawing.Point(64, 88);
			this.deler.Name = "deler";
			this.deler.Size = new System.Drawing.Size(184, 21);
			this.deler.TabIndex = 17;
			this.deler.Text = "";
			// 
			// label21
			// 
			this.label21.Location = new System.Drawing.Point(8, 96);
			this.label21.Name = "label21";
			this.label21.Size = new System.Drawing.Size(56, 16);
			this.label21.TabIndex = 16;
			this.label21.Text = "税 号";
			// 
			// bankAccNum
			// 
			this.bankAccNum.Location = new System.Drawing.Point(64, 64);
			this.bankAccNum.Name = "bankAccNum";
			this.bankAccNum.Size = new System.Drawing.Size(184, 21);
			this.bankAccNum.TabIndex = 15;
			this.bankAccNum.Text = "";
			// 
			// bankAccName
			// 
			this.bankAccName.Location = new System.Drawing.Point(64, 40);
			this.bankAccName.Name = "bankAccName";
			this.bankAccName.Size = new System.Drawing.Size(184, 21);
			this.bankAccName.TabIndex = 14;
			this.bankAccName.Text = "";
			// 
			// openBank
			// 
			this.openBank.Location = new System.Drawing.Point(64, 16);
			this.openBank.Name = "openBank";
			this.openBank.Size = new System.Drawing.Size(184, 21);
			this.openBank.TabIndex = 13;
			this.openBank.Text = "";
			// 
			// label15
			// 
			this.label15.Location = new System.Drawing.Point(8, 72);
			this.label15.Name = "label15";
			this.label15.Size = new System.Drawing.Size(56, 16);
			this.label15.TabIndex = 9;
			this.label15.Text = "开户帐号";
			// 
			// label14
			// 
			this.label14.Location = new System.Drawing.Point(8, 48);
			this.label14.Name = "label14";
			this.label14.Size = new System.Drawing.Size(56, 16);
			this.label14.TabIndex = 8;
			this.label14.Text = "开户名称";
			// 
			// label13
			// 
			this.label13.Location = new System.Drawing.Point(8, 24);
			this.label13.Name = "label13";
			this.label13.Size = new System.Drawing.Size(56, 16);
			this.label13.TabIndex = 7;
			this.label13.Text = "开 户 行";
			// 
			// groupBox2
			// 
			this.groupBox2.Controls.Add(this.fplx);
			this.groupBox2.Controls.Add(this.yhzf);
			this.groupBox2.Controls.Add(this.hkfs);
			this.groupBox2.Controls.Add(this.jhhf);
			this.groupBox2.Controls.Add(this.jhdz);
			this.groupBox2.Controls.Add(this.label20);
			this.groupBox2.Controls.Add(this.label19);
			this.groupBox2.Controls.Add(this.label16);
			this.groupBox2.Controls.Add(this.label17);
			this.groupBox2.Controls.Add(this.label18);
			this.groupBox2.Location = new System.Drawing.Point(272, 256);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new System.Drawing.Size(256, 144);
			this.groupBox2.TabIndex = 7;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "默认设置";
			// 
			// fplx
			// 
			this.fplx.Location = new System.Drawing.Point(64, 112);
			this.fplx.Name = "fplx";
			this.fplx.Size = new System.Drawing.Size(168, 20);
			this.fplx.TabIndex = 20;
			// 
			// yhzf
			// 
			this.yhzf.Location = new System.Drawing.Point(64, 88);
			this.yhzf.Name = "yhzf";
			this.yhzf.Size = new System.Drawing.Size(168, 20);
			this.yhzf.TabIndex = 19;
			// 
			// hkfs
			// 
			this.hkfs.Location = new System.Drawing.Point(64, 66);
			this.hkfs.Name = "hkfs";
			this.hkfs.Size = new System.Drawing.Size(168, 20);
			this.hkfs.TabIndex = 18;
			// 
			// jhhf
			// 
			this.jhhf.Location = new System.Drawing.Point(64, 40);
			this.jhhf.Name = "jhhf";
			this.jhhf.Size = new System.Drawing.Size(168, 20);
			this.jhhf.TabIndex = 17;
			// 
			// jhdz
			// 
			this.jhdz.Location = new System.Drawing.Point(64, 16);
			this.jhdz.Name = "jhdz";
			this.jhdz.Size = new System.Drawing.Size(168, 20);
			this.jhdz.TabIndex = 16;
			// 
			// label20
			// 
			this.label20.Location = new System.Drawing.Point(8, 120);
			this.label20.Name = "label20";
			this.label20.Size = new System.Drawing.Size(56, 16);
			this.label20.TabIndex = 14;
			this.label20.Text = "发票类型";
			// 
			// label19
			// 
			this.label19.Location = new System.Drawing.Point(8, 96);
			this.label19.Name = "label19";
			this.label19.Size = new System.Drawing.Size(56, 16);
			this.label19.TabIndex = 13;
			this.label19.Text = "运费支付";
			// 
			// label16
			// 
			this.label16.Location = new System.Drawing.Point(8, 72);
			this.label16.Name = "label16";
			this.label16.Size = new System.Drawing.Size(56, 16);
			this.label16.TabIndex = 9;
			this.label16.Text = "付款方法";
			// 
			// label17
			// 
			this.label17.Location = new System.Drawing.Point(8, 48);
			this.label17.Name = "label17";
			this.label17.Size = new System.Drawing.Size(56, 16);
			this.label17.TabIndex = 8;
			this.label17.Text = "交货方法";
			// 
			// label18
			// 
			this.label18.Location = new System.Drawing.Point(8, 24);
			this.label18.Name = "label18";
			this.label18.Size = new System.Drawing.Size(56, 16);
			this.label18.TabIndex = 7;
			this.label18.Text = "交货地址";
			// 
			// EditCustomer
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(538, 455);
			this.Controls.Add(this.groupBox2);
			this.Controls.Add(this.groupBox3);
			this.Controls.Add(this.button4);
			this.Controls.Add(this.button1);
			this.Controls.Add(this.groupBox1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.MaximizeBox = false;
			this.Name = "EditCustomer";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "供应商资料";
			this.groupBox1.ResumeLayout(false);
			this.groupBox3.ResumeLayout(false);
			this.groupBox2.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// 保存资料
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void button1_Click(object sender, System.EventArgs e) {
			try{
				string sql = "";
				if(this.autoID != null){
					sql  = "Update CorpColl set sign='"+ this.sign.Text +"',corName='"+ this.corName.Text +"',corContacter='"+ this.contacter.Text +"',address='"+ this.address.Text +"',pcCode='"+ this.zip.Text +"',areaName='"+ this.area.Text +"',tel='"+ this.tel.Text +"',fax='"+ this.fax.Text +"',mobileTel='"+ this.mobile.Text +"',email='"+ this.email.Text +"',http='"+ this.http.Text +"',openBank='"+ this.openBank.Text +"',bankAccName='"+ this.bankAccName.Text +"',bankAccNum='"+ this.bankAccNum.Text +"',content='"+ this.memo.Text +"',modifyer='"+ Public.userID +"',modifyDate='"+ DateTime.Now.ToString() +"',jhdz='"+ this.jhdz.Text +"',jhfs='"+ this.jhhf.Text +"',hkfs='"+ this.hkfs.Text +"',yhzf='"+ this.yhzf.Text +"',fplx='"+ fplx.Text +"',deler='"+ this.deler.Text +"' where autoID = " + this.autoID;
					OleDbCommand cmd = new OleDbCommand(sql,Public.conn);
					Public.CloseConn();
					Public.conn.Open();
					cmd.ExecuteNonQuery();

					//将两个单库中的单位名称也更新一遍
					sql = "update sellOrder set buyName='"+ this.corName.Text +"' where buySign='"+ this.sign.Text +"'";
					cmd = new OleDbCommand(sql,Public.conn);
					cmd.ExecuteNonQuery();

					sql = "update StockOrder set offerName='"+ this.corName.Text +"' where offerSign='"+ this.sign.Text +"'";
					cmd = new OleDbCommand(sql,Public.conn);
					cmd.ExecuteNonQuery();

					Public.conn.Close();
				}else{

					//检查编号是否正确和重复
					if(!Public.SystemSignIsRight(this.sign.Text)){
						MessageBox.Show("手工编号为空或格式不正确。" + Public.systemSignNotRight);
						return;
					}

					sql = "select sign from CorpColl where sign='"+ this.sign.Text +"' and comType='"+ this.comType +"'";
					OleDbDataAdapter da = new OleDbDataAdapter(sql,Public.conn);
					DataSet _ds = new DataSet();
					da.Fill(_ds,"c");
					if(_ds == null || _ds.Tables[0].Rows.Count > 0){
						MessageBox.Show("手工编号有重复,请重新输入!");
						return;
					}

					if(this.corName.Text.Trim() == ""){
						MessageBox.Show("单位名称不能为空!");
						return;
					}

					_ds = null;

					sql  = "Insert into CorpColl (comType,sign,corName,corContacter,address,pcCode,areaName,tel,fax,mobileTel,email,http,openBank,bankAccName,bankAccNum,content,adder,addDate,jhdz,jhfs,hkfs,yhzf,fplx,deler)";
					sql += " values ('"+ this.comType +"','"+ this.sign.Text +"','"+ this.corName.Text +"'";
					sql += ",'"+ this.contacter.Text +"','"+ this.address.Text +"','"+ this.zip.Text +"','"+ this.area.Text +"','"+ this.tel.Text +"','"+ this.fax.Text +"','"+ this.mobile.Text +"','"+ this.email.Text +"','"+ this.http.Text +"','"+ this.openBank.Text +"','"+ this.bankAccName.Text +"','"+ this.bankAccNum.Text +"','"+ this.memo.Text +"','"+ Public.userID +"','"+ DateTime.Now.ToString() +"','"+ this.jhdz.Text +"','"+ this.jhhf.Text +"','"+ this.hkfs.Text +"','"+ this.yhzf.Text +"','"+ this.fplx.Text +"','"+ this.deler.Text +"')";
					OleDbCommand cmd = new OleDbCommand(sql,Public.conn);
					Public.CloseConn();
					Public.conn.Open();
					cmd.ExecuteNonQuery();
					Public.conn.Close();
				}

				//成功提示
				//提示
				if(this.autoID == null &&  MessageBox.Show("保存操作成功,是否继续新建操作?","操作成功",MessageBoxButtons.OKCancel,MessageBoxIcon.Question) == DialogResult.OK){
					if(this._lf != null) this._lf.button3_Click(null,null);
					this.Close();
				}else{
					if(this._lf != null) this._lf.LoadList();
					this.Close();
				}

			}catch(Exception ex){
				MessageBox.Show(ex.Message.ToString());
				return;
			}
		}

		/// <summary>
		/// 打印
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void button3_Click(object sender, System.EventArgs e) {
			MessageBox.Show("无打印模板!");
			return;
		}

		private void button4_Click(object sender, System.EventArgs e) {
			this.Close();
		}

		/// <summary>
		/// 设置本窗体的Text
		/// </summary>
		/// <param name="text"></param>
		public void SetFormText(string text){
			this.Text = text;
			this.sign.Text = Public.GetNewInfoID("CorpColl","sign");
		}

		/// <summary>
		/// 设置系统编号
		/// </summary>
		/// <param name="_autoID"></param>
		public void SetAutoID(string _autoID){
			this.autoID = _autoID;
			this.LoadInfo();
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -