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

📄 serviceprovidermanage.cs

📁 c#编写的汽车销售公司erp进销存系统
💻 CS
📖 第 1 页 / 共 3 页
字号:
			this.label13.Font = new System.Drawing.Font("宋体", 9F);
			this.label13.Location = new System.Drawing.Point(267, 96);
			this.label13.Name = "label13";
			this.label13.Size = new System.Drawing.Size(56, 23);
			this.label13.TabIndex = 44;
			this.label13.Text = "好评数";
			this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// txtAddr
			// 
			this.txtAddr.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.txtAddr.Location = new System.Drawing.Point(99, 120);
			this.txtAddr.Name = "txtAddr";
			this.txtAddr.Size = new System.Drawing.Size(632, 21);
			this.txtAddr.TabIndex = 42;
			this.txtAddr.Text = "";
			// 
			// label6
			// 
			this.label6.Font = new System.Drawing.Font("宋体", 9F);
			this.label6.Location = new System.Drawing.Point(27, 72);
			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(507, 48);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(72, 23);
			this.label4.TabIndex = 26;
			this.label4.Text = "服务商网址";
			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// btService
			// 
			this.btService.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btService.Font = new System.Drawing.Font("宋体", 9F);
			this.btService.Location = new System.Drawing.Point(747, 88);
			this.btService.Name = "btService";
			this.btService.Size = new System.Drawing.Size(75, 24);
			this.btService.TabIndex = 54;
			this.btService.Text = "服务记录";
			this.btService.Click += new System.EventHandler(this.btService_Click);
			// 
			// label11
			// 
			this.label11.Font = new System.Drawing.Font("宋体", 9F);
			this.label11.Location = new System.Drawing.Point(507, 72);
			this.label11.Name = "label11";
			this.label11.Size = new System.Drawing.Size(56, 23);
			this.label11.TabIndex = 38;
			this.label11.Text = "服务内容";
			this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// txtWeb
			// 
			this.txtWeb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.txtWeb.Location = new System.Drawing.Point(579, 48);
			this.txtWeb.Name = "txtWeb";
			this.txtWeb.Size = new System.Drawing.Size(152, 21);
			this.txtWeb.TabIndex = 35;
			this.txtWeb.Text = "";
			// 
			// txtRPerson
			// 
			this.txtRPerson.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.txtRPerson.Location = new System.Drawing.Point(339, 48);
			this.txtRPerson.Name = "txtRPerson";
			this.txtRPerson.Size = new System.Drawing.Size(152, 21);
			this.txtRPerson.TabIndex = 34;
			this.txtRPerson.Text = "";
			// 
			// dateTimePicker1
			// 
			this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
			this.dateTimePicker1.Location = new System.Drawing.Point(579, 24);
			this.dateTimePicker1.Name = "dateTimePicker1";
			this.dateTimePicker1.Size = new System.Drawing.Size(152, 21);
			this.dateTimePicker1.TabIndex = 30;
			// 
			// label9
			// 
			this.label9.Font = new System.Drawing.Font("宋体", 9F);
			this.label9.Location = new System.Drawing.Point(507, 24);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(56, 23);
			this.label9.TabIndex = 28;
			this.label9.Text = "加盟时间";
			this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label1
			// 
			this.label1.Font = new System.Drawing.Font("宋体", 9F);
			this.label1.Location = new System.Drawing.Point(27, 152);
			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;
			// 
			// txtTel
			// 
			this.txtTel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.txtTel.Location = new System.Drawing.Point(99, 48);
			this.txtTel.Name = "txtTel";
			this.txtTel.Size = new System.Drawing.Size(152, 21);
			this.txtTel.TabIndex = 37;
			this.txtTel.Text = "";
			// 
			// txtPosition
			// 
			this.txtPosition.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.txtPosition.Location = new System.Drawing.Point(99, 96);
			this.txtPosition.Name = "txtPosition";
			this.txtPosition.Size = new System.Drawing.Size(152, 21);
			this.txtPosition.TabIndex = 45;
			this.txtPosition.Text = "";
			// 
			// btSave
			// 
			this.btSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btSave.Font = new System.Drawing.Font("宋体", 9F);
			this.btSave.Location = new System.Drawing.Point(747, 56);
			this.btSave.Name = "btSave";
			this.btSave.Size = new System.Drawing.Size(75, 24);
			this.btSave.TabIndex = 48;
			this.btSave.Text = "修  改";
			this.btSave.Click += new System.EventHandler(this.btSave_Click);
			// 
			// label5
			// 
			this.label5.Font = new System.Drawing.Font("宋体", 9F);
			this.label5.Location = new System.Drawing.Point(267, 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;
			// 
			// btDelete
			// 
			this.btDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btDelete.Font = new System.Drawing.Font("宋体", 9F);
			this.btDelete.Location = new System.Drawing.Point(747, 120);
			this.btDelete.Name = "btDelete";
			this.btDelete.Size = new System.Drawing.Size(75, 24);
			this.btDelete.TabIndex = 49;
			this.btDelete.Text = "删  除";
			this.btDelete.Click +=new EventHandler(btDelete_Click);
			// 
			// btAdd
			// 
			this.btAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btAdd.Font = new System.Drawing.Font("宋体", 9F);
			this.btAdd.Location = new System.Drawing.Point(747, 24);
			this.btAdd.Name = "btAdd";
			this.btAdd.Size = new System.Drawing.Size(75, 24);
			this.btAdd.TabIndex = 46;
			this.btAdd.Text = "添  加";
			this.btAdd.Click += new System.EventHandler(this.btAdd_Click);
			// 
			// 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;
			// 
			// tabControl1
			// 
			this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.tabControl1.Location = new System.Drawing.Point(0, 0);
			this.tabControl1.Name = "tabControl1";
			this.tabControl1.SelectedIndex = 0;
			this.tabControl1.Size = new System.Drawing.Size(848, 208);
			this.tabControl1.TabIndex = 55;
			// 
			// ServiceProviderManage
			// 
			this.AutoScroll = true;
			this.Controls.Add(this.panel2);
			this.Controls.Add(this.panel1);
			this.Name = "ServiceProviderManage";
			this.Size = new System.Drawing.Size(848, 549);
			this.Load += new System.EventHandler(this.ServiceProviderManage_Load);
			this.panel2.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dgPriver)).EndInit();
			this.panel1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		private void ServiceProviderManage_Load(object sender, System.EventArgs e)
		{
			ServiceProviderBLL sbll=new ServiceProviderBLL();
			DataSet ds=new DataSet();
			ds=sbll.getSPType_DataSet("stype");
			this.cbSType.DataSource=ds.Tables["stype"].DefaultView;
			this.cbSType.DisplayMember=ds.Tables["stype"].Columns["stname"].ToString();
			this.cbSType.ValueMember=ds.Tables["stype"].Columns["id"].ToString();
			this.gridDataFilter1.checkbox=this.checkBox1;

			ClearData();
			getDataBind();
		}

		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 ;
			}
			ServiceProviderInfo sinfo=new ServiceProviderInfo();
			sinfo=setData("添加");
			if(sinfo==null)
			{
				return;
			}
			ServiceProviderBLL sbll=new ServiceProviderBLL();
			if(sbll.addServiceProvider(sinfo).ToString()!=null)
			{
				MessageBox.Show("添加成功","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
				getDataBind();
				ClearData();
			}
			else
			{
				MessageBox.Show("添加失败!","警告",MessageBoxButtons.OK,MessageBoxIcon.Warning);
			}
			
		}
		private ServiceProviderInfo setData(string tag)
		{
			ServiceProviderInfo sinfo=new ServiceProviderInfo();
			if(tag=="修改")
			{
				sinfo.id=Convert.ToInt32(this.dgPriver[this.dgPriver.CurrentCell.RowNumber,1]);
			}
			
			sinfo.sname=this.txtname.Text;
			sinfo.stelephone=this.txtTel.Text;
			sinfo.sfax=this.txtFax.Text;
			sinfo.saddress=this.txtAddr.Text;
			
			sinfo.position=Convert.ToInt32(this.txtPosition.Text==""?"0":this.txtPosition.Text);
			sinfo.sbrief=this.txtMemo.Text;
			sinfo.stype=Convert.ToInt32(this.cbSType.SelectedValue);
			sinfo.slinkname=this.txtRPerson.Text;
			sinfo.semail=this.txtEmail.Text;
			
			sinfo.sgood=Convert.ToInt32(this.txtGood.Text==""?"0":this.txtGood.Text);
			sinfo.sdate=this.dateTimePicker1.Text;
			sinfo.sweb=this.txtWeb.Text;
			sinfo.ckeywords=this.txtNeiRong.Text;
			sinfo.sbad=Convert.ToInt32(this.txtBad.Text==""?"0":this.txtBad.Text);
			
			return sinfo;
		}
		private void getDataBind()
		{	
			dsservice=new DataSet();
			ServiceProviderBLL sbll=new ServiceProviderBLL();
			ServiceProviderInfo sinfo=new ServiceProviderInfo();
			dsservice=sbll.queryServiceProvider_DataSet(sinfo,"service");


			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["service"].Columns.Add(myColumn);

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

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


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

			DataGridColumnStyle gs0 = new DataGridTextBoxColumn();
			gs0.MappingName = "id";
			gs0.HeaderText = "编号";
			gs0.Width=40;
			gs0.ReadOnly=true;
			gs0.Alignment = HorizontalAlignment.Right;
			ts.GridColumnStyles.Add(gs0);
			

			DataGridColumnStyle gs1 = new DataGridTextBoxColumn();
			gs1.MappingName = "sname";
			gs1.HeaderText = "服务商名称";
			gs1.NullText = "";
			gs1.Width=200;
			gs1.ReadOnly=true;
			gs1.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs1);

			DataGridColumnStyle gs2 = new DataGridTextBoxColumn();
			gs2.MappingName = "stname";
			gs2.HeaderText = "服务商类别";
			gs2.NullText = "";
			gs2.Width=100;
			gs2.ReadOnly=true;
			gs2.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs2);

			DataGridColumnStyle gst2 = new DataGridTextBoxColumn();
			gst2.MappingName = "sdate";
			gst2.HeaderText = "加盟时间";
			gst2.NullText = "";
			gst2.Width=80;
			gst2.ReadOnly=true;
			gst2.Alignment = HorizontalAlignment.Center;
			ts.GridColumnStyles.Add(gst2);

			DataGridColumnStyle gs3 = new DataGridTextBoxColumn();
			gs3.MappingName = "slinkname";
			gs3.HeaderText = "联系人";
			gs3.NullText = "";
			gs3.Width=80;
			gs3.ReadOnly=true;
			gs3.Alignment = HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(gs3);

			DataGridColumnStyle gs4 = new DataGridTextBoxColumn();
			gs4.MappingName = "stelephone";
			gs4.HeaderText = "联系电话";
			gs4.NullText = "";
			gs4.Width=100;
			gs4.ReadOnly=true;
			gs4.Alignment = HorizontalAlignment.Right;

⌨️ 快捷键说明

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