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

📄 inputfrm.cs

📁 《Csharp案例开发》源代码,希望对大家有用~
💻 CS
📖 第 1 页 / 共 2 页
字号:
			// label9
			// 
			this.label9.Location = new System.Drawing.Point(248, 112);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(56, 16);
			this.label9.TabIndex = 15;
			this.label9.Text = "进货时间";
			// 
			// goods_price
			// 
			this.goods_price.Location = new System.Drawing.Point(96, 128);
			this.goods_price.Name = "goods_price";
			this.goods_price.Size = new System.Drawing.Size(144, 21);
			this.goods_price.TabIndex = 18;
			this.goods_price.Text = "";
			// 
			// label10
			// 
			this.label10.Location = new System.Drawing.Point(32, 136);
			this.label10.Name = "label10";
			this.label10.Size = new System.Drawing.Size(64, 16);
			this.label10.TabIndex = 17;
			this.label10.Text = "租价/售价";
			// 
			// member_price
			// 
			this.member_price.Location = new System.Drawing.Point(336, 128);
			this.member_price.Name = "member_price";
			this.member_price.Size = new System.Drawing.Size(144, 21);
			this.member_price.TabIndex = 20;
			this.member_price.Text = "";
			// 
			// label11
			// 
			this.label11.Location = new System.Drawing.Point(248, 136);
			this.label11.Name = "label11";
			this.label11.Size = new System.Drawing.Size(88, 16);
			this.label11.TabIndex = 19;
			this.label11.Text = "会员租价/售价";
			// 
			// hire_price
			// 
			this.hire_price.Enabled = false;
			this.hire_price.Location = new System.Drawing.Point(336, 160);
			this.hire_price.Name = "hire_price";
			this.hire_price.Size = new System.Drawing.Size(144, 21);
			this.hire_price.TabIndex = 22;
			this.hire_price.Text = "";
			// 
			// label12
			// 
			this.label12.Location = new System.Drawing.Point(120, 168);
			this.label12.Name = "label12";
			this.label12.Size = new System.Drawing.Size(232, 16);
			this.label12.TabIndex = 21;
			this.label12.Text = "出租押金(出租商品才有该项,请注意)";
			// 
			// publish
			// 
			this.publish.Location = new System.Drawing.Point(112, 224);
			this.publish.Name = "publish";
			this.publish.Size = new System.Drawing.Size(368, 21);
			this.publish.TabIndex = 26;
			this.publish.Text = "";
			// 
			// label13
			// 
			this.label13.Location = new System.Drawing.Point(32, 232);
			this.label13.Name = "label13";
			this.label13.Size = new System.Drawing.Size(72, 16);
			this.label13.TabIndex = 25;
			this.label13.Text = "出版/发行";
			// 
			// author
			// 
			this.author.Location = new System.Drawing.Point(112, 200);
			this.author.Name = "author";
			this.author.Size = new System.Drawing.Size(368, 21);
			this.author.TabIndex = 24;
			this.author.Text = "";
			// 
			// label14
			// 
			this.label14.Location = new System.Drawing.Point(32, 208);
			this.label14.Name = "label14";
			this.label14.Size = new System.Drawing.Size(64, 16);
			this.label14.TabIndex = 23;
			this.label14.Text = "歌手/演员";
			// 
			// info
			// 
			this.info.Location = new System.Drawing.Point(112, 248);
			this.info.Multiline = true;
			this.info.Name = "info";
			this.info.Size = new System.Drawing.Size(376, 48);
			this.info.TabIndex = 28;
			this.info.Text = "";
			// 
			// label15
			// 
			this.label15.Location = new System.Drawing.Point(32, 256);
			this.label15.Name = "label15";
			this.label15.Size = new System.Drawing.Size(72, 16);
			this.label15.TabIndex = 27;
			this.label15.Text = "其它信息";
			// 
			// inputbtn
			// 
			this.inputbtn.Location = new System.Drawing.Point(128, 296);
			this.inputbtn.Name = "inputbtn";
			this.inputbtn.TabIndex = 29;
			this.inputbtn.Text = "确定";
			this.inputbtn.Click += new System.EventHandler(this.inputbtn_Click);
			// 
			// cancelbtn
			// 
			this.cancelbtn.Location = new System.Drawing.Point(272, 296);
			this.cancelbtn.Name = "cancelbtn";
			this.cancelbtn.TabIndex = 30;
			this.cancelbtn.Text = "取消";
			this.cancelbtn.Click += new System.EventHandler(this.cancelbtn_Click);
			// 
			// goods_type
			// 
			this.goods_type.Items.AddRange(new object[] {
															"VCD",
															"CD",
															"DVD",
															"磁带"});
			this.goods_type.Location = new System.Drawing.Point(64, 160);
			this.goods_type.Name = "goods_type";
			this.goods_type.Size = new System.Drawing.Size(48, 20);
			this.goods_type.TabIndex = 32;
			this.goods_type.Text = "VCD";
			// 
			// label16
			// 
			this.label16.Location = new System.Drawing.Point(32, 168);
			this.label16.Name = "label16";
			this.label16.Size = new System.Drawing.Size(32, 16);
			this.label16.TabIndex = 31;
			this.label16.Text = "介质";
			// 
			// inputFrm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(492, 323);
			this.Controls.Add(this.goods_type);
			this.Controls.Add(this.label16);
			this.Controls.Add(this.cancelbtn);
			this.Controls.Add(this.inputbtn);
			this.Controls.Add(this.info);
			this.Controls.Add(this.label15);
			this.Controls.Add(this.publish);
			this.Controls.Add(this.label13);
			this.Controls.Add(this.author);
			this.Controls.Add(this.label14);
			this.Controls.Add(this.hire_price);
			this.Controls.Add(this.label12);
			this.Controls.Add(this.member_price);
			this.Controls.Add(this.label11);
			this.Controls.Add(this.goods_price);
			this.Controls.Add(this.label10);
			this.Controls.Add(this.order_time);
			this.Controls.Add(this.label9);
			this.Controls.Add(this.order_price);
			this.Controls.Add(this.label7);
			this.Controls.Add(this.order_num);
			this.Controls.Add(this.label6);
			this.Controls.Add(this.bar_code);
			this.Controls.Add(this.label5);
			this.Controls.Add(this.g_code);
			this.Controls.Add(this.label4);
			this.Controls.Add(this.g_name);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.department);
			this.Controls.Add(this.g_type);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.order_from);
			this.Controls.Add(this.label8);
			this.Name = "inputFrm";
			this.Text = "销售入库";
			this.Load += new System.EventHandler(this.inputFrm_Load);
			this.ResumeLayout(false);

		}
		#endregion

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

		private void g_type_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			if(g_type.Text.ToString().Substring(0,1)=="H")
			{
				GoodsType="H";
				hire_price.Enabled = true;
			}
			else{
				hire_price.Enabled = false;
			}
		}

		private void inputbtn_Click(object sender, System.EventArgs e)
		{
			SqlDataAdapter sda=new SqlDataAdapter("select top 1 * from Goods_"+GoodsType+" order by id desc",FPara.connStr);
			DataSet ds=new DataSet();
			SqlCommandBuilder GoodCB = new SqlCommandBuilder(sda);
			sda.Fill(ds,"newGoods");
			int Tempid=1;
			if(ds.Tables["newGoods"].Rows.Count==1)
			{
				Tempid=int.Parse(ds.Tables["newGoods"].Rows[0]["ID"].ToString())+1;
			}
			DataRow newdr=ds.Tables["newGoods"].NewRow();
			newdr["ID"]=Tempid;
			newdr["Department"]=department.Text;
			newdr["GoodsName"]=g_name.Text;
			newdr["GoodsCode"]=g_code.Text;
			newdr["GoodsType"]=goods_type.Text;
			newdr["OrderNum"]=order_num.Text;
			newdr["KCNum"]=order_num.Text;
			newdr["DTNum"]=0;
			newdr["OrderPrice"]=order_price.Text;
			newdr["BarCode"]=bar_code.Text;
			newdr["OrderFrom"]=order_from.Text;
			newdr["OrderTime"]=order_time.Text;
			newdr["GoodsPrice"]=goods_price.Text;
			newdr["MemberPrice"]=member_price.Text;
			if(GoodsType=="H")newdr["HirePrice"]=hire_price.Text;
			newdr["Author"]=author.Text;
			newdr["Publish"]=publish.Text;
			newdr["Info"]=info.Text.ToString()+"/"+order_time.Text.ToString()+"开始进货"+order_num.Text.ToString();
			ds.Tables["newGoods"].Rows.Add(newdr);
			if(ds.HasChanges())
			{
				int errorNum=sda.Update(ds,"newGoods");
				if(errorNum==1)
				{
					MessageBox.Show("添加成功");
					ClearText();
				}
				else{
					MessageBox.Show("操作失败,请检查输入信息");
				}
			}
			else
			{ 
				MessageBox.Show("操作失败,请检查输入信息");
			} 
		}
		private void ClearText(){
			g_name.Text="";
			g_code.Text="";
			order_num.Text="";
			order_price.Text="";
			bar_code.Text="";
			goods_price.Text="";
			member_price.Text="";
			hire_price.Text="";
			author.Text="";
			publish.Text="";
			info.Text="";
		}

		private void inputFrm_Load(object sender, System.EventArgs e)
		{
		
		}
	}
}

⌨️ 快捷键说明

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