亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? waredatamanage.cs

?? 進銷存管理系統
?? CS
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace 進銷存管理系統
{
	/// <summary>
	/// WareDataManage 的摘要說明。
	/// </summary>
	public class WareDataManage : System.Windows.Forms.Form
	{
		private bool blSellTableShow;
		private DataSet ds = new DataSet();
		private LinkDataBase link = new LinkDataBase();	
		private string sendTableName = "商品清單";
		private string sendStrSQL = "SELECT 貨號, 條碼, 拼音編碼, 品名, 單位, 進貨價, 銷售價1, 銷售價2, 規格, 產地, 類別, 最低售價 FROM 商品清單";

		private System.Windows.Forms.DataGrid dgrd_WareData;
		private System.Windows.Forms.ToolBar toolBar1;
		private System.Windows.Forms.ToolBarButton tbarBtnSave;
		private System.Windows.Forms.ImageList imageList1;
		private System.Windows.Forms.ToolBarButton tbarBtnDelete;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.TextBox txt_WareWord;
		private System.Windows.Forms.Button btn_Search;
		private System.ComponentModel.IContainer components;

		public WareDataManage()
		{
			//
			// Windows 窗體設計器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 調用后添加任何構造函數代碼
			//
		}

		//--------重載構造函數-----------
		public WareDataManage(bool blShowToolBar)
		{	
			//
			// Windows 窗體設計器支持所必需的
			//
			InitializeComponent();
			//
			// TODO: 在 InitializeComponent 調用后添加任何構造函數代碼
			//
			this.ds = link.SelectDataBase(sendStrSQL,sendTableName);//創建數據庫連接
			//如果blToolBarShow為false,則表示該窗體由銷售單和進貨單生成,用于雙擊選擇商品
			this.DataGridStateControl(blShowToolBar); 
			this.dgrd_WareData.DataSource = ds.Tables[0];
			this.toolBar1.Enabled = blShowToolBar;
		}

		/// <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(WareDataManage));
			this.dgrd_WareData = new System.Windows.Forms.DataGrid();
			this.toolBar1 = new System.Windows.Forms.ToolBar();
			this.tbarBtnSave = new System.Windows.Forms.ToolBarButton();
			this.tbarBtnDelete = new System.Windows.Forms.ToolBarButton();
			this.imageList1 = new System.Windows.Forms.ImageList(this.components);
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.label1 = new System.Windows.Forms.Label();
			this.txt_WareWord = new System.Windows.Forms.TextBox();
			this.btn_Search = new System.Windows.Forms.Button();
			((System.ComponentModel.ISupportInitialize)(this.dgrd_WareData)).BeginInit();
			this.groupBox1.SuspendLayout();
			this.SuspendLayout();
			// 
			// dgrd_WareData
			// 
			this.dgrd_WareData.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
				| System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.dgrd_WareData.CaptionVisible = false;
			this.dgrd_WareData.DataMember = "";
			this.dgrd_WareData.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dgrd_WareData.Location = new System.Drawing.Point(0, 74);
			this.dgrd_WareData.Name = "dgrd_WareData";
			this.dgrd_WareData.Size = new System.Drawing.Size(720, 352);
			this.dgrd_WareData.TabIndex = 3;
			this.dgrd_WareData.DoubleClick += new System.EventHandler(this.dgrd_WareData_DoubleClick);
			// 
			// toolBar1
			// 
			this.toolBar1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
																						this.tbarBtnSave,
																						this.tbarBtnDelete});
			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(720, 29);
			this.toolBar1.TabIndex = 4;
			this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
			// 
			// tbarBtnSave
			// 
			this.tbarBtnSave.ImageIndex = 0;
			this.tbarBtnSave.ToolTipText = "保存修改";
			// 
			// tbarBtnDelete
			// 
			this.tbarBtnDelete.ImageIndex = 1;
			this.tbarBtnDelete.ToolTipText = "刪除數據";
			// 
			// 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.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Controls.Add(this.txt_WareWord);
			this.groupBox1.Controls.Add(this.btn_Search);
			this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.groupBox1.Location = new System.Drawing.Point(1, 22);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(718, 50);
			this.groupBox1.TabIndex = 4;
			this.groupBox1.TabStop = false;
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(179, 22);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(64, 16);
			this.label1.TabIndex = 5;
			this.label1.Text = "商品拼音:";
			// 
			// txt_WareWord
			// 
			this.txt_WareWord.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.txt_WareWord.Location = new System.Drawing.Point(267, 18);
			this.txt_WareWord.Name = "txt_WareWord";
			this.txt_WareWord.Size = new System.Drawing.Size(200, 21);
			this.txt_WareWord.TabIndex = 1;
			this.txt_WareWord.Text = "";
			// 
			// btn_Search
			// 
			this.btn_Search.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.btn_Search.Location = new System.Drawing.Point(491, 17);
			this.btn_Search.Name = "btn_Search";
			this.btn_Search.Size = new System.Drawing.Size(48, 24);
			this.btn_Search.TabIndex = 2;
			this.btn_Search.Text = "查詢";
			this.btn_Search.Click += new System.EventHandler(this.btn_Search_Click);
			// 
			// WareDataManage
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(720, 421);
			this.Controls.Add(this.toolBar1);
			this.Controls.Add(this.groupBox1);
			this.Controls.Add(this.dgrd_WareData);
			this.Name = "WareDataManage";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "【商品信息維護】";
			((System.ComponentModel.ISupportInitialize)(this.dgrd_WareData)).EndInit();
			this.groupBox1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		//-----------設置表格格式----------
		private void DataGridStateControl(bool blReadOnly)
		{
			
			DataGridTableStyle ts = new DataGridTableStyle();
			ts.AlternatingBackColor = Color.LightGray;
			ts.MappingName = this.ds.Tables[0].TableName;
			ts.AllowSorting = false;
			
			int numCols = this.ds.Tables[0].Columns.Count;
			for (int i = 0;i< numCols;i++)//根據DataTable中的數據類型設置表格的樣式
			{
				if (blReadOnly == true)
				{
					if ( i == 4 )//先為【單位】字段添加下拉列表框
					{
						DataTable tempTable = new DataTable();
						tempTable.Columns.Add();
						object[] rowValues = new object[] {"包","瓶","盒","帶","箱"};
						for (int j=0;j<5;j++)
						{
							tempTable.Rows.Add(tempTable.NewRow());
							tempTable.Rows[j][0] = rowValues[j];
						}
						DataGridComboBoxColumn aComboBoxColumn = new DataGridComboBoxColumn(tempTable,0,0);
						aComboBoxColumn.MappingName = this.ds.Tables[0].Columns[i].ColumnName;
						aComboBoxColumn.HeaderText = this.ds.Tables[0].Columns[i].ColumnName;
						aComboBoxColumn.NullText = "";
						ts.GridColumnStyles.Add(aComboBoxColumn);
					}
					else//設置表格樣式,如果不是供選擇,則可以選中表中的一個單元
					{
						DataGridTextBoxColumn aColumnTextColumn = new DataGridTextBoxColumn();
						aColumnTextColumn.MappingName = this.ds.Tables[0].Columns[i].ColumnName;
						aColumnTextColumn.HeaderText = this.ds.Tables[0].Columns[i].ColumnName;
						aColumnTextColumn.NullText = "";
						aColumnTextColumn.Format = "F";
						ts.GridColumnStyles.Add(aColumnTextColumn);
					}
				}
								
				else//如果是供雙擊選擇商品名稱,則單擊任意一個單元都會選中整行
				{
					DataGridNoActiveCellColumn	aColumnTextColumn = new DataGridNoActiveCellColumn();
					aColumnTextColumn.MappingName = this.ds.Tables[0].Columns[i].ColumnName;
					aColumnTextColumn.HeaderText = this.ds.Tables[0].Columns[i].ColumnName;
					aColumnTextColumn.NullText = "";
					aColumnTextColumn.Format = "F";
					ts.GridColumnStyles.Add(aColumnTextColumn);
				}
			}
			this.dgrd_WareData.TableStyles.Add(ts);
		}

		//--------根據商品拼音編碼查詢商品-------------
		private void btn_Search_Click(object sender, System.EventArgs e)
		{
			string strSpellWord = this.txt_WareWord.Text.Trim();
			string tempStrSQL = "select * from 商品清單 where 拼音編碼 like '" + strSpellWord + "%'";
			this.link.SelectDataBase(tempStrSQL,sendTableName);
		}

		
		//--------------對數據的修改,保存等操作----------------
		private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
		{
			if (e.Button.ToolTipText == "保存修改")//保存對數據所作的修改
			{
				try
				{
					int row = this.dgrd_WareData.CurrentCell.RowNumber;
					//將當前所在行往下移動一行,為便于實現同步保存
					//(否則會出現修改的最后一行無法保存,因為它還處于編輯狀態)
					this.dgrd_WareData.CurrentCell = new DataGridCell(row+1,0); 
					if (this.ds.HasChanges())
					{
						this.link.UpdateDataBase(this.ds.GetChanges(),sendTableName);
						MessageBox.Show("數據修改成功!","信息");
					}
					else
					{
						MessageBox.Show("沒有需要修改的數據!");
						return;
					}
				}
				catch
				{
					MessageBox.Show("數據保存失敗,請確認所有信息輸入完整且正確!","提示");
					return;
				}
			}
			if (e.Button.ToolTipText == "刪除數據")//刪除某條數據
			{
				if (MessageBox.Show("確實要刪除這條記錄嗎?","詢問",MessageBoxButtons.YesNo) == DialogResult.Yes)
				{
					int intRowNumber = this.dgrd_WareData.CurrentCell.RowNumber;
					try
					{
						this.ds.Tables[0].Rows[intRowNumber].Delete();
						//此處傳入只包含被改動過的DataRow的DataSet,減少更新數據量,提高程序性能
						this.link.UpdateDataBase(this.ds.GetChanges(),sendTableName);
						MessageBox.Show("數據刪除成功!","信息");
					}
					catch
					{
						MessageBox.Show("該數據不能刪除!","提示");
						string tempStrSQL = "select * from " + sendTableName;
						this.link.SelectDataBase(tempStrSQL,sendTableName);
						return;
					}
				}
			}
		}

		//------------其他窗體調用商品信息窗體時,雙擊選擇商品信息--------------
		private void dgrd_WareData_DoubleClick(object sender, System.EventArgs e)
		{
			if (this.dgrd_WareData.ReadOnly == true) //判斷如果是在銷售單或者進貨單中生成的窗體則響應DataGrid的雙擊事件
			{
				int intCurrentRowNumber = this.dgrd_WareData.CurrentCell.RowNumber;
				string sendWareID,sendWareName,sendWareUnit;
				sendWareID = this.dgrd_WareData[intCurrentRowNumber,0].ToString().Trim();//保存商品編號
				sendWareName = this.dgrd_WareData[intCurrentRowNumber,3].ToString().Trim();//保存商品名
				sendWareUnit = this.dgrd_WareData[intCurrentRowNumber,4].ToString().Trim();//保存商品單位
				string [] sendArray = new string [] {sendWareID,sendWareName,sendWareUnit};
				if (blSellTableShow == true) //判斷當前是哪個表為當前表(銷售單還是售貨單)
				{
					SellTable.inputDataGridArray[0] = sendArray[0];
					SellTable.inputDataGridArray[1] = sendArray[1];
					SellTable.inputDataGridArray[2] = sendArray[2];
					
				}
				else
				{
					StockTable.inputDataGridArray[0] = sendArray[0];
					StockTable.inputDataGridArray[1] = sendArray[1];
					StockTable.inputDataGridArray[2] = sendArray[2];
				}
				this.Close();
			}
		}

		//---------如果是在雙擊選擇商品狀態,則表格為只讀-------------
		public void setDataGridReadOnly(bool blInSell)
		{
			this.dgrd_WareData.ReadOnly = true;
			if (blInSell == true)
				blSellTableShow = true;
			else
				blSellTableShow = false;
		}

	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩亚洲欧美一区二区三区| 欧美美女一区二区三区| 99re视频这里只有精品| 欧美日韩卡一卡二| 欧美日韩大陆在线| 精品无码三级在线观看视频| 国产成人精品一区二| 欧美日本一区二区三区| 国产精品久久久爽爽爽麻豆色哟哟 | 久久综合久久99| 亚洲综合色婷婷| 成人毛片视频在线观看| 日韩精品综合一本久道在线视频| 自拍偷自拍亚洲精品播放| 蜜乳av一区二区| 69堂国产成人免费视频| 一区二区在线看| 成人中文字幕合集| 欧美精品一区男女天堂| 五月天精品一区二区三区| 99re热视频这里只精品| 久久先锋影音av| 亚洲成人精品一区二区| 91蝌蚪porny成人天涯| 国产亚洲欧美在线| 男人的天堂亚洲一区| 欧美日韩小视频| 亚洲色图在线播放| 99久久99久久精品国产片果冻| 日韩精品一区二区三区蜜臀| 日产国产高清一区二区三区| 欧美伊人久久久久久久久影院| 亚洲天天做日日做天天谢日日欢 | 91精品国产高清一区二区三区| 亚洲综合视频在线观看| 色94色欧美sute亚洲13| 亚洲视频一区二区免费在线观看| 国产91综合一区在线观看| www久久精品| 黑人巨大精品欧美一区| 337p粉嫩大胆噜噜噜噜噜91av| 视频一区视频二区中文字幕| 欧美日韩精品一区二区在线播放| 亚洲第一福利视频在线| 欧美精品第一页| 狠狠色丁香久久婷婷综合丁香| 26uuu另类欧美| 国产成人啪午夜精品网站男同| 久久久久久久性| 成人在线视频一区二区| 国产精品毛片久久久久久| 91在线云播放| 亚洲国产欧美在线人成| 欧美一二三四在线| 国产在线精品一区二区| 国产精品大尺度| 欧美偷拍一区二区| 毛片基地黄久久久久久天堂| 久久久久综合网| 色妞www精品视频| 日韩电影在线免费观看| 国产婷婷一区二区| 在线观看视频一区二区| 蜜臀av国产精品久久久久| 国产日韩欧美高清| 欧美三级乱人伦电影| 国产乱码精品一区二区三区五月婷| 国产精品色一区二区三区| 在线视频你懂得一区| 久久精品国产99| 自拍偷在线精品自拍偷无码专区| 欧美无乱码久久久免费午夜一区| 狠狠v欧美v日韩v亚洲ⅴ| ...xxx性欧美| 日韩欧美久久一区| 色综合视频一区二区三区高清| 日韩成人av影视| 国产精品久久免费看| 91精品国产一区二区三区香蕉 | 欧美伦理影视网| 国产91精品入口| 天天影视网天天综合色在线播放| 久久天堂av综合合色蜜桃网| 色琪琪一区二区三区亚洲区| 国产精品一区二区久激情瑜伽| 亚洲午夜日本在线观看| 欧美国产精品一区二区三区| 欧美一区二视频| 欧美性生活大片视频| 成人av网在线| 国产精品影视在线观看| 麻豆国产欧美日韩综合精品二区 | 亚洲日本一区二区| 久久久99精品久久| 欧美一区二视频| 欧美日韩国产小视频在线观看| 成人av电影在线| 国产河南妇女毛片精品久久久| 丝袜诱惑制服诱惑色一区在线观看| 亚洲乱码一区二区三区在线观看| 国产亚洲精品免费| 欧美不卡一区二区三区| 国产精品系列在线播放| 视频一区二区三区入口| 中文字幕乱码日本亚洲一区二区 | 免费在线看成人av| 亚洲精品日韩一| 欧美videos中文字幕| 欧美色网站导航| 99精品视频一区二区三区| 狠狠狠色丁香婷婷综合激情 | 欧美tickling网站挠脚心| 色网站国产精品| 9人人澡人人爽人人精品| 国产精品一级片| 免费精品视频在线| 视频在线观看91| 性做久久久久久久免费看| 中文在线一区二区| 国产精品视频一二| 亚洲国产精品v| 欧美一二三区在线| 91福利资源站| 欧美日韩精品一二三区| 欧美性猛片aaaaaaa做受| 91免费版pro下载短视频| 成人精品高清在线| 国产精品一级黄| 99精品视频在线播放观看| 成人av午夜影院| voyeur盗摄精品| 91玉足脚交白嫩脚丫在线播放| www.99精品| 欧美三级三级三级爽爽爽| 欧美日韩一区三区| 欧美体内she精视频| 欧美日本一区二区| 制服丝袜国产精品| 5858s免费视频成人| 日韩一级免费一区| 国产日韩欧美精品一区| 欧美国产综合一区二区| 18欧美亚洲精品| 一区二区欧美视频| 亚洲高清免费在线| 亚洲一区在线视频观看| 亚洲日本va在线观看| 亚洲综合久久av| 男人的天堂久久精品| 成人福利视频在线看| 色综合久久久久久久| 欧美日韩在线精品一区二区三区激情 | 三级精品在线观看| 久久精品国产免费| 欧洲精品在线观看| 337p亚洲精品色噜噜| 久久夜色精品一区| 亚洲欧美综合在线精品| 亚洲国产精品人人做人人爽| 精品一区二区在线观看| 99re66热这里只有精品3直播| 欧洲精品中文字幕| 久久综合久久鬼色| 一区二区三区四区在线| 国产精品系列在线播放| 色婷婷一区二区三区四区| 欧美高清视频不卡网| 国产日韩欧美精品在线| 天天做天天摸天天爽国产一区| 国产一二精品视频| 在线观看免费亚洲| 中文字幕高清一区| 麻豆精品视频在线观看免费| 97久久超碰国产精品电影| 日韩精品一区二| 夜夜精品视频一区二区| 99在线精品免费| 欧美精品一区二区三区蜜臀| 亚洲欧洲av一区二区三区久久| 蜜桃在线一区二区三区| 成人avav影音| 久久久91精品国产一区二区三区| 亚洲第一成年网| 91小视频在线观看| 精品国产一区二区三区久久影院| 亚洲一区在线看| 91偷拍与自偷拍精品| 久久午夜免费电影| 奇米色一区二区| 99久久免费精品| 国产精品国产三级国产aⅴ原创| 久久精品国产色蜜蜜麻豆| 欧美丝袜自拍制服另类| 国产精品美女久久久久久久久| 青青草91视频| 欧美美女直播网站| 伊人婷婷欧美激情| 成人av在线一区二区| 中文字幕乱码亚洲精品一区| 国产老妇另类xxxxx|