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

📄 rvku.cs

📁 进销存管理系统软件
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace my进销售
{
	/// <summary>
	/// rvku 的摘要说明。
	/// </summary>
	public class rvku : System.Windows.Forms.Form
	{
		private System.Windows.Forms.ToolBar toolBar1;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.ImageList imageList1;
		private System.Windows.Forms.ToolBarButton toolBarButton1;
		private System.Windows.Forms.ToolBarButton toolBarButton2;
		private System.Windows.Forms.ToolBarButton toolBarButton3;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.GroupBox groupBox2;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.TextBox textBox6;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.TextBox textBox7;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.TextBox textBox8;
		private System.ComponentModel.IContainer components;
		private System.Windows.Forms.DataGrid dataview;
        

		private DataTable newtable;
		private System.Windows.Forms.ComboBox people;
		private System.Windows.Forms.TextBox txt_people;
		private System.Windows.Forms.TextBox txt_comedate;
		private System.Windows.Forms.ComboBox txt_ghid;
		private Database link=new Database();
		private System.Windows.Forms.TextBox txt_data;

		public static string[] inputdata=new string[] {"",""};

		public rvku()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();
			this.selectpeople();
			this.DataGrid();
			this.txt_ghid.Items.Add("");
			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}


	
		/// <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.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(rvku));
			this.toolBar1 = new System.Windows.Forms.ToolBar();
			this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
			this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
			this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
			this.imageList1 = new System.Windows.Forms.ImageList(this.components);
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.people = new System.Windows.Forms.ComboBox();
			this.txt_ghid = new System.Windows.Forms.ComboBox();
			this.txt_data = new System.Windows.Forms.TextBox();
			this.label4 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.txt_people = new System.Windows.Forms.TextBox();
			this.label2 = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.txt_comedate = new System.Windows.Forms.TextBox();
			this.groupBox2 = new System.Windows.Forms.GroupBox();
			this.textBox8 = new System.Windows.Forms.TextBox();
			this.label7 = new System.Windows.Forms.Label();
			this.textBox7 = new System.Windows.Forms.TextBox();
			this.label6 = new System.Windows.Forms.Label();
			this.textBox6 = new System.Windows.Forms.TextBox();
			this.label5 = new System.Windows.Forms.Label();
			this.dataview = new System.Windows.Forms.DataGrid();
			this.groupBox1.SuspendLayout();
			this.groupBox2.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.dataview)).BeginInit();
			this.SuspendLayout();
			// 
			// toolBar1
			// 
			this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
																						this.toolBarButton1,
																						this.toolBarButton2,
																						this.toolBarButton3});
			this.toolBar1.ButtonSize = new System.Drawing.Size(39, 20);
			this.toolBar1.DropDownArrows = true;
			this.toolBar1.ImageList = this.imageList1;
			this.toolBar1.Location = new System.Drawing.Point(0, 0);
			this.toolBar1.Name = "toolBar1";
			this.toolBar1.ShowToolTips = true;
			this.toolBar1.Size = new System.Drawing.Size(592, 28);
			this.toolBar1.TabIndex = 0;
			// 
			// toolBarButton1
			// 
			this.toolBarButton1.ImageIndex = 0;
			// 
			// toolBarButton2
			// 
			this.toolBarButton2.ImageIndex = 1;
			// 
			// toolBarButton3
			// 
			this.toolBarButton3.ImageIndex = 2;
			// 
			// imageList1
			// 
			this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
			this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
			this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.people);
			this.groupBox1.Controls.Add(this.txt_ghid);
			this.groupBox1.Controls.Add(this.txt_data);
			this.groupBox1.Controls.Add(this.label4);
			this.groupBox1.Controls.Add(this.label3);
			this.groupBox1.Controls.Add(this.txt_people);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Controls.Add(this.txt_comedate);
			this.groupBox1.Location = new System.Drawing.Point(0, 32);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(592, 72);
			this.groupBox1.TabIndex = 1;
			this.groupBox1.TabStop = false;
			// 
			// people
			// 
			this.people.Location = new System.Drawing.Point(448, 16);
			this.people.Name = "people";
			this.people.Size = new System.Drawing.Size(121, 20);
			this.people.TabIndex = 10;
			// 
			// txt_ghid
			// 
			this.txt_ghid.Location = new System.Drawing.Point(88, 40);
			this.txt_ghid.Name = "txt_ghid";
			this.txt_ghid.Size = new System.Drawing.Size(121, 20);
			this.txt_ghid.TabIndex = 9;
			this.txt_ghid.DropDown += new System.EventHandler(this.cmb_client_dropDown);
			this.txt_ghid.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txt_ghid_KeyUp);
			// 
			// txt_data
			// 
			this.txt_data.Location = new System.Drawing.Point(224, 40);
			this.txt_data.Name = "txt_data";
			this.txt_data.ReadOnly = true;
			this.txt_data.Size = new System.Drawing.Size(224, 21);
			this.txt_data.TabIndex = 8;
			this.txt_data.Text = "";
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(24, 40);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(64, 16);
			this.label4.TabIndex = 6;
			this.label4.Text = "供货商编号";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(400, 16);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(64, 16);
			this.label3.TabIndex = 4;
			this.label3.Text = "业务员";
			// 
			// txt_people
			// 
			this.txt_people.Location = new System.Drawing.Point(280, 8);
			this.txt_people.Name = "txt_people";
			this.txt_people.TabIndex = 3;
			this.txt_people.Text = "";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(216, 16);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(64, 16);
			this.label2.TabIndex = 2;
			this.label2.Text = "操作员";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(24, 16);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(64, 16);
			this.label1.TabIndex = 1;
			this.label1.Text = "进货日期";
			// 
			// txt_comedate
			// 
			this.txt_comedate.Location = new System.Drawing.Point(88, 8);
			this.txt_comedate.Name = "txt_comedate";
			this.txt_comedate.TabIndex = 0;
			this.txt_comedate.Text = "";
			// 
			// groupBox2
			// 
			this.groupBox2.Controls.Add(this.textBox8);
			this.groupBox2.Controls.Add(this.label7);
			this.groupBox2.Controls.Add(this.textBox7);
			this.groupBox2.Controls.Add(this.label6);
			this.groupBox2.Controls.Add(this.textBox6);
			this.groupBox2.Controls.Add(this.label5);
			this.groupBox2.Location = new System.Drawing.Point(0, 360);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new System.Drawing.Size(592, 56);
			this.groupBox2.TabIndex = 2;
			this.groupBox2.TabStop = false;
			// 
			// textBox8
			// 
			this.textBox8.Location = new System.Drawing.Point(448, 16);
			this.textBox8.Name = "textBox8";
			this.textBox8.TabIndex = 12;
			this.textBox8.Text = "";
			// 
			// label7
			// 
			this.label7.Location = new System.Drawing.Point(408, 24);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(64, 16);
			this.label7.TabIndex = 11;
			this.label7.Text = "税额";
			// 
			// textBox7
			// 
			this.textBox7.Location = new System.Drawing.Point(288, 24);
			this.textBox7.Name = "textBox7";
			this.textBox7.TabIndex = 10;
			this.textBox7.Text = "";
			// 
			// label6
			// 
			this.label6.Location = new System.Drawing.Point(232, 24);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(64, 16);
			this.label6.TabIndex = 9;
			this.label6.Text = "不含税";
			// 
			// textBox6
			// 
			this.textBox6.Location = new System.Drawing.Point(104, 24);
			this.textBox6.Name = "textBox6";
			this.textBox6.TabIndex = 8;
			this.textBox6.Text = "";
			// 
			// label5
			// 
			this.label5.Location = new System.Drawing.Point(24, 24);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(64, 16);
			this.label5.TabIndex = 7;
			this.label5.Text = "合计金额";
			// 
			// dataview
			// 
			this.dataview.CaptionBackColor = System.Drawing.SystemColors.AppWorkspace;
			this.dataview.DataMember = "";
			this.dataview.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataview.Location = new System.Drawing.Point(0, 104);
			this.dataview.Name = "dataview";
			this.dataview.Size = new System.Drawing.Size(592, 248);
			this.dataview.TabIndex = 3;
			// 
			// rvku
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(592, 416);
			this.Controls.Add(this.dataview);
			this.Controls.Add(this.groupBox2);
			this.Controls.Add(this.groupBox1);
			this.Controls.Add(this.toolBar1);
			this.Name = "rvku";
			this.Text = "rvku";
			this.groupBox1.ResumeLayout(false);
			this.groupBox2.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dataview)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion


		private void selectpeople()
		{
			
			this.txt_people.Text=login.struser;
			this.txt_comedate.Text=System.DateTime.Today.ToShortDateString();
			string sql="select 姓名 from  业务员清单 ";
			DataTable tempdataTable=link.selectdata(sql);
			for ( int i=1;i<tempdataTable.Rows.Count;i++)
			{
				this.people.Items.Add(tempdataTable.Rows[i][0]);
				this.people.SelectedIndex=0;
			}
		}

		private void DataGrid()

		{
			newtable=new DataTable();
			newtable.Columns.Add("货号",typeof(string));
			newtable.Columns.Add("数量",typeof(decimal));
			newtable.Columns.Add("单价",typeof(decimal));
			this.dataview.DataSource=newtable;
			newtable.Rows.Add(newtable.NewRow());
			DataGridTableStyle ts=new DataGridTableStyle();
			DataGridTextBoxColumn abox;
			ts.AllowSorting=false;
			ts.AlternatingBackColor=Color.LightBlue;
			ts.MappingName=newtable.TableName;
			int nows=this.newtable.Columns.Count;
			for(int i=1;i<nows;i++)

			{
					abox=new DataGridTextBoxColumn();
				abox.MappingName=newtable.Columns[i].ColumnName;
				abox.HeaderText=newtable.Columns[i].ColumnName;
				abox.NullText="";

				ts.GridColumnStyles.Add(abox);
			}
			this.dataview.TableStyles.Add(ts);
	

		}

		private void cmb_client_dropDown(object sender,System.EventArgs e)
		{
			htadd_ht newfrm=new htadd_ht(false);
			newfrm.takedatareadonyl(true);
			newfrm.ShowDialog();
            settextdata();


		}

		public void settextdata()

		{ this.txt_ghid.IntegralHeight=false;
          this.txt_ghid.DroppedDown=false;
          this.txt_ghid.Items[0]=inputdata[0];
          this.txt_ghid.SelectedIndex=0;
          this.txt_data.Text=inputdata[1];
         
		}

		private void txt_ghid_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
		{
		this.txt_data.Text="";
			//string name=this.txt_ghid.Text;
			//string sqlname="select 供货商号,名称 from 供货商清单 where 名称='"+name+"'";
			//DataTable newtable=this.link.selectdata(sqlname);
			//if (newtable.Rows.Count>0)
			//{
			//	inputdata[0]=newtable.Rows[0][0].ToString().Trim();
			//	/
			{
				inputdata[0]="123";
				inputdata[1]="123";
			}
		
		}


	}

	

	//最后的括包
}

⌨️ 快捷键说明

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