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

📄 frmgrxxselect.cs

📁 c#编写的汽车销售公司erp进销存系统
💻 CS
📖 第 1 页 / 共 4 页
字号:
			// label8
			// 
			this.label8.Font = new System.Drawing.Font("宋体", 9F);
			this.label8.Location = new System.Drawing.Point(267, 72);
			this.label8.Name = "label8";
			this.label8.Size = new System.Drawing.Size(72, 23);
			this.label8.TabIndex = 43;
			this.label8.Text = "省份";
			this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label13
			// 
			this.label13.Font = new System.Drawing.Font("宋体", 9F);
			this.label13.Location = new System.Drawing.Point(508, 72);
			this.label13.Name = "label13";
			this.label13.Size = new System.Drawing.Size(76, 23);
			this.label13.TabIndex = 44;
			this.label13.Text = "城市";
			this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label6
			// 
			this.label6.Font = new System.Drawing.Font("宋体", 9F);
			this.label6.Location = new System.Drawing.Point(27, 48);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(88, 23);
			this.label6.TabIndex = 29;
			this.label6.Text = "性别";
			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label4
			// 
			this.label4.Font = new System.Drawing.Font("宋体", 9F);
			this.label4.Location = new System.Drawing.Point(27, 96);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(88, 23);
			this.label4.TabIndex = 26;
			this.label4.Text = "邮政编码";
			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label11
			// 
			this.label11.Font = new System.Drawing.Font("宋体", 9F);
			this.label11.Location = new System.Drawing.Point(508, 48);
			this.label11.Name = "label11";
			this.label11.Size = new System.Drawing.Size(76, 23);
			this.label11.TabIndex = 38;
			this.label11.Text = "客户属地";
			this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label1
			// 
			this.label1.Font = new System.Drawing.Font("宋体", 9F);
			this.label1.Location = new System.Drawing.Point(27, 224);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(72, 23);
			this.label1.TabIndex = 25;
			this.label1.Text = "备注";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label5
			// 
			this.label5.Font = new System.Drawing.Font("宋体", 9F);
			this.label5.Location = new System.Drawing.Point(27, 72);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(88, 23);
			this.label5.TabIndex = 27;
			this.label5.Text = "文化程度";
			this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label2
			// 
			this.label2.Font = new System.Drawing.Font("宋体", 9F);
			this.label2.Location = new System.Drawing.Point(27, 24);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(88, 23);
			this.label2.TabIndex = 23;
			this.label2.Text = "客户名称";
			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// FrmGrxxSelect
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.AutoScroll = true;
			this.ClientSize = new System.Drawing.Size(840, 522);
			this.Controls.Add(this.panel2);
			this.Controls.Add(this.panel1);
			this.Name = "FrmGrxxSelect";
			this.Load += new System.EventHandler(this.GrxxManage_Load);
			((System.ComponentModel.ISupportInitialize)(this.panel2)).EndInit();
			this.panel2.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dgPriver)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.panel1)).EndInit();
			this.panel1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dttsjnrq.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txttsjnnr.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtysr.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtzw.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtzy.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtyyah.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtdzyx.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtcz.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtyddh.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtdh.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtqh.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtxxdz.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtyzbm.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtcs.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtsf.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtwhcd.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.cbxb.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtkhsd.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtnl.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtkhly.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtsfzh.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtkhxm.Properties)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtbz.Properties)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void GrxxManage_Load(object sender, System.EventArgs e)
		{
			
			this.gridDataFilter1.checkbox=this.checkBox1;
			ClearData();
			getDataBind();
			this.txtkhxm.Focus();
		}

		private void btAdd_Click(object sender, System.EventArgs e)
		{
			try
			{
				insertData();
				
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}
		private void insertData()
		{
			if(!this.checkValidate())
			{
				return ;
			}
			GrxxInfo cinfo=new GrxxInfo();
			cinfo=setData("添加");
			if(cinfo==null)
			{
				return;
			}
			GrxxBLL cbll=new GrxxBLL();
			int i=cbll.addGrxx(cinfo);
			if(i!=-1)
			{
				MessageBox.Show("添加成功","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
				getDataBind();
				ClearData();
			}
			else
			{
				MessageBox.Show("身份证号重复,添加失败!","警告",MessageBoxButtons.OK,MessageBoxIcon.Warning);
			}
			
		}
		private GrxxInfo setData(string tag)
		{
			GrxxInfo cinfo=new GrxxInfo();
			if(tag=="修改")
			{
				cinfo.id=Convert.ToInt32(this.dsservice.Tables["grxx"].Rows[this.dgPriver.CurrentCell.RowNumber]["id"]);//Convert.ToString(this.dgPriver[this.dgPriver.CurrentCell.RowNumber,1]);
				MessageBox.Show(cinfo.id.ToString());
			}
			//			else
			//			{
			//				cinfo.ccbh=this.txtccbh.Text;
			//			}
			cinfo.khxm=this.txtkhxm.Text;
			cinfo.sfzh=this.txtsfzh.Text;
			cinfo.khly=this.txtkhly.Text;
			cinfo.xb=this.cbxb.Text;
			cinfo.nl=Convert.ToInt32(this.txtnl.Text==""?"0":this.txtnl.Text);
			
			cinfo.khsd=this.txtkhsd.Text;

			cinfo.whcd=this.txtwhcd.Text;
			
			cinfo.sf=this.txtsf.Text;
			cinfo.cs=this.txtcs.Text;
			cinfo.yzbm=this.txtyzbm.Text;

			cinfo.xxdz=this.txtxxdz.Text;
			cinfo.qh=this.txtqh.Text;
			cinfo.dh=this.txtdh.Text;

			cinfo.yddh=this.txtyddh.Text;
			cinfo.cz=this.txtcz.Text;
			cinfo.dzyx=this.txtdzyx.Text;

			cinfo.yyah=this.txtyyah.Text;
			cinfo.zy=this.txtzy.Text;
			cinfo.zw=this.txtzw.Text;

			cinfo.ysr=Convert.ToDecimal(this.txtysr.Text==""?"0":this.txtysr.Text);
			cinfo.tsjnrq=Convert.ToDateTime(this.dttsjnrq.Text);
			cinfo.tsjnnr=this.txttsjnnr.Text;

			cinfo.bz=this.txtbz.Text;
			
			
			return cinfo;
		}
		private void getDataBind()
		{	
			this.dgPriver.CaptionBackColor=Color.FromArgb(ShareClass.Rcolor,ShareClass.Gcolor,ShareClass.Bcolor);
			this.dgPriver.BackgroundColor=Color.FromArgb(ShareClass.Rcolor,ShareClass.Gcolor,ShareClass.Bcolor);
			this.checkBox1.BackColor=Color.FromArgb(ShareClass.Rcolor,ShareClass.Gcolor,ShareClass.Bcolor);
			
			dsservice=new DataSet();
			GrxxBLL cbll=new GrxxBLL();
			GrxxInfo cinfo=new GrxxInfo();
			dsservice=cbll.getALLGrxx_DataSet("grxx");


			System.Type myDataType;
			myDataType = System.Type.GetType("System.Boolean");
			System.Data.DataColumn myColumn = new System.Data.DataColumn("check");
			// Set various properties.
			myColumn.AutoIncrement = false;
			myColumn.ReadOnly = false;
			myColumn.ColumnMapping = System.Data.MappingType.Attribute;
			myColumn.Caption = "check";
			myColumn.DefaultValue = "false";
			myColumn.DataType = myDataType;
			
			
			

			dsservice.Tables["grxx"].Columns.Add(myColumn);

			DataView dv=new DataView();
			dv=dsservice.Tables["grxx"].DefaultView;
			dv.AllowNew=false;
			

			this.dgPriver.DataSource=dv;//dsservice.Tables["service"].DefaultView;
			
		
			this.dgPriver.TableStyles.Clear();
			DataGridTableStyle ts = new DataGridTableStyle();
			ts.MappingName = dsservice.Tables["grxx"].TableName;

			ts.GridLineColor=Color.FromArgb(ShareClass.Rcolor,ShareClass.Gcolor,ShareClass.Bcolor);
			ts.HeaderBackColor=Color.FromArgb(ShareClass.Rcolor,ShareClass.Gcolor,ShareClass.Bcolor);


			DataGridColumnStyle gsc = new DataGridBoolColumn();
			gsc.MappingName = "check";
			gsc.HeaderText = "选择";
			gsc.Width=40;
			ts.GridColumnStyles.Add(gsc);

			DataGridColumnStyle gs0 = new DataGridTextBoxColumn();
			gs0.MappingName = "khxm";
			gs0.HeaderText = "客户名称";
			gs0.Width=80;
			gs0.ReadOnly=true;
			gs0.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs0);

			DataGridColumnStyle gs00 = new DataGridTextBoxColumn();
			gs00.MappingName = "sfzh";
			gs00.HeaderText = "身份证号";
			gs00.NullText = "";
			gs00.Width=80;
			gs00.ReadOnly=true;
			gs00.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs00);

			DataGridColumnStyle gs1 = new DataGridTextBoxColumn();
			gs1.MappingName = "khly";
			gs1.HeaderText = "客户来源";
			gs1.NullText = "";
			gs1.Width=200;
			gs1.ReadOnly=true;
			gs1.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs1);

			DataGridColumnStyle gs2 = new DataGridTextBoxColumn();
			gs2.MappingName = "xb";
			gs2.HeaderText = "性别";
			gs2.NullText = "";
			gs2.Width=100;
			gs2.ReadOnly=true;
			gs2.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs2);

			DataGridColumnStyle gst2 = new DataGridTextBoxColumn();
			gst2.MappingName = "nl";
			gst2.HeaderText = "年龄";
			gst2.NullText = "";
			gst2.Width=80;
			gst2.ReadOnly=true;
			gst2.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gst2);

			DataGridColumnStyle gs3 = new DataGridTextBoxColumn();
			gs3.MappingName = "khsd";
			gs3.HeaderText = "客户属地";
			gs3.NullText = "";
			gs3.Width=80;
			gs3.ReadOnly=true;
			gs3.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs3);

			DataGridColumnStyle gs4 = new DataGridTextBoxColumn();
			gs4.MappingName = "whcd";
			gs4.HeaderText = "文化程度";
			gs4.NullText = "";
			gs4.Width=100;
			gs4.ReadOnly=true;
			gs4.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs4);

			DataGridColumnStyle gs5 = new DataGridTextBoxColumn();
			gs5.MappingName = "sf";
			gs5.HeaderText = "省份";
			gs5.NullText = "";
			gs5.Width=100;
			gs5.ReadOnly=true;
			gs5.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs5);

			DataGridColumnStyle gs6 = new DataGridTextBoxColumn();
			gs6.MappingName = "cs";
			gs6.HeaderText = "城市";
			gs6.NullText = "";
			gs6.Width=100;
			gs6.ReadOnly=true;
			gs6.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs6);

			DataGridColumnStyle gs7 = new DataGridTextBoxColumn();
			gs7.MappingName = "yzbm";
			gs7.HeaderText = "邮政编码";
			gs7.NullText = "";
			gs7.Width=100;
			gs7.ReadOnly=true;
			gs7.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs7);

			DataGridColumnStyle gs8 = new DataGridTextBoxColumn();
			gs8.MappingName = "xxdz";
			gs8.HeaderText = "详细地址";
			gs8.NullText = "";
			gs8.Width=300;
			gs8.ReadOnly=true;
			gs8.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs8);

			DataGridColumnStyle gs9 = new DataGridTextBoxColumn();
			gs9.MappingName = "qh";
			gs9.HeaderText = "区号";
			gs9.NullText = "";
			gs9.Width=80;
			gs9.ReadOnly=true;
			gs9.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs9);

			DataGridColumnStyle gs10 = new DataGridTextBoxColumn();
			gs10.MappingName = "dh";
			gs10.HeaderText = "电话";
			gs10.NullText = "";
			gs10.Width=100;
			gs10.ReadOnly=true;
			gs10.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs10);


			DataGridColumnStyle gs11 = new DataGridTextBoxColumn();
			gs11.MappingName = "yddh";
			gs11.HeaderText = "移动电话";
			gs11.NullText = "";
			gs11.Width=100;
			gs11.ReadOnly=true;
			gs11.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs11);

			DataGridColumnStyle gs12 = new DataGridTextBoxColumn();
			gs12.MappingName = "cz";
			gs12.HeaderText = "传真";
			gs12.NullText = "";
			gs12.Width=100;
			gs12.ReadOnly=true;
			gs12.Alignment = HorizontalAlignment.Left;

⌨️ 快捷键说明

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