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

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

?? waredatamanage.cs

?? Csharp進銷存軟件源代碼
?? CS
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace 進銷存管理系統(tǒng)
{
	/// <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, 規(guī)格, 產地, 類別, 最低售價 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 調用后添加任何構造函數(shù)代碼
			//
		}

		//--------重載構造函數(shù)-----------
		public WareDataManage(bool blShowToolBar)
		{	
			//
			// Windows 窗體設計器支持所必需的
			//
			InitializeComponent();
			//
			// TODO: 在 InitializeComponent 調用后添加任何構造函數(shù)代碼
			//
			this.ds = link.SelectDataBase(sendStrSQL,sendTableName);//創(chuàng)建數(shù)據庫連接
			//如果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 = "刪除數(shù)據";
			// 
			// 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中的數(shù)據類型設置表格的樣式
			{
				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);
		}

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

		//---------如果是在雙擊選擇商品狀態(tài),則表格為只讀-------------
		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一区二区三区免费野_久草精品视频
一本一道久久a久久精品| 欧美一区二区在线看| 国产亚洲欧美一区在线观看| 理论电影国产精品| 2020国产成人综合网| 国产精品一区在线| 欧美激情中文不卡| 一本到不卡免费一区二区| 亚洲一区二区欧美激情| 欧美精品久久99久久在免费线 | 国产精品私人影院| av成人免费在线| 亚洲精品久久嫩草网站秘色| 欧美系列一区二区| 精品一区二区三区欧美| 欧美极品另类videosde| 日本高清不卡一区| 免费观看在线色综合| 久久综合久久99| 91视频.com| 日韩avvvv在线播放| 久久久电影一区二区三区| 91麻豆自制传媒国产之光| 五月天中文字幕一区二区| 精品国产自在久精品国产| av一区二区久久| 视频一区视频二区中文字幕| 国产目拍亚洲精品99久久精品| 色综合久久99| 国产一区二区不卡| 亚洲精品自拍动漫在线| 日韩精品专区在线影院观看| 成人免费福利片| 亚洲成人你懂的| 中文字幕av在线一区二区三区| 91.麻豆视频| av在线一区二区三区| 日本美女视频一区二区| 亚洲视频免费在线观看| 欧美草草影院在线视频| 色欧美乱欧美15图片| 国精产品一区一区三区mba视频| 一区二区三区四区不卡在线| 亚洲精品一区二区三区99| 欧美在线视频不卡| 高清在线观看日韩| 免费一级欧美片在线观看| 亚洲卡通欧美制服中文| 国产精品网曝门| 日韩免费视频一区| 欧美四级电影在线观看| 懂色av中文字幕一区二区三区| 日日夜夜一区二区| 一区二区三区四区亚洲| 中文字幕在线一区免费| 精品成a人在线观看| 欧美精品色一区二区三区| 97精品国产97久久久久久久久久久久| 麻豆成人综合网| 亚洲gay无套男同| 亚洲欧美日韩人成在线播放| 国产午夜亚洲精品不卡| 日韩女同互慰一区二区| 91精品视频网| 欧美日韩久久一区| 欧美三级电影网| 91国偷自产一区二区三区观看| 成人激情动漫在线观看| 国产精品自拍毛片| 国产一区二区日韩精品| 免费成人av在线| 日韩精品五月天| 首页综合国产亚洲丝袜| 首页亚洲欧美制服丝腿| 午夜成人免费电影| 午夜av电影一区| 青青草国产成人av片免费| 天天色天天爱天天射综合| 亚洲一区二区三区四区的| 亚洲欧美国产三级| 玉米视频成人免费看| 一区二区三区四区视频精品免费 | 国产精品66部| 精品系列免费在线观看| 极品少妇一区二区三区精品视频| 蜜臀久久99精品久久久画质超高清 | 不卡视频一二三| 国产成人a级片| 国产·精品毛片| 99久久国产综合精品色伊| 91麻豆视频网站| 欧美日韩一区三区| 日韩一区二区三区免费观看| 欧美变态口味重另类| 精品福利av导航| 日本一区二区免费在线观看视频 | 91日韩在线专区| 欧美视频自拍偷拍| 欧美一区二区视频在线观看| 日韩视频在线一区二区| 国产午夜精品一区二区三区嫩草| 中文字幕免费不卡在线| 综合久久国产九一剧情麻豆| 亚洲综合999| 日本免费新一区视频| 国产在线播放一区三区四| 国产91富婆露脸刺激对白| 99r精品视频| 69久久99精品久久久久婷婷 | 日韩毛片精品高清免费| 亚洲国产精品人人做人人爽| 麻豆91免费观看| 9色porny自拍视频一区二区| 欧美三片在线视频观看 | 国产免费成人在线视频| 亚洲综合色自拍一区| 免费久久精品视频| 成人免费视频一区| 欧美日韩精品欧美日韩精品| 日韩精品一区二区三区蜜臀| 亚洲欧洲精品一区二区三区不卡| 亚洲综合偷拍欧美一区色| 久久爱www久久做| 色综合激情五月| 欧美不卡一区二区| 亚洲综合色噜噜狠狠| 国产一区 二区| 在线视频你懂得一区| 久久色成人在线| 亚洲国产精品自拍| 成人小视频在线| 日韩亚洲电影在线| 亚洲精品免费电影| 国产一区二区导航在线播放| 欧美午夜不卡视频| 国产精品麻豆久久久| 经典三级视频一区| 欧美日韩国产首页| 亚洲色图欧洲色图婷婷| 久久精品国产第一区二区三区| 91蝌蚪国产九色| 国产色婷婷亚洲99精品小说| 日本不卡免费在线视频| 色婷婷激情一区二区三区| 国产色综合久久| 国内精品国产成人国产三级粉色| 欧美在线高清视频| 国产精品夫妻自拍| 国产精品一区二区在线看| 在线综合+亚洲+欧美中文字幕| 亚洲天堂精品在线观看| 国产高清精品在线| 欧美不卡在线视频| 蜜桃久久久久久久| 欧美日韩国产小视频| 一区二区三区免费看视频| yourporn久久国产精品| 国产日韩精品久久久| 国内精品伊人久久久久av影院 | 精品一区二区影视| 在线成人av网站| 午夜精品久久久久久久99水蜜桃| 91丨porny丨蝌蚪视频| 中文字幕永久在线不卡| 成人丝袜视频网| 国产精品美女久久久久久 | 色婷婷久久久久swag精品| 国产日韩在线不卡| 国产91丝袜在线播放0| 欧美激情资源网| 成人免费观看av| 亚洲丝袜精品丝袜在线| 92国产精品观看| 一区二区三区在线视频观看 | 欧美在线短视频| 亚洲综合一二区| 欧美日韩激情一区二区| 亚洲va韩国va欧美va精品| 69堂精品视频| 精品午夜久久福利影院| 久久精品夜色噜噜亚洲aⅴ| 国产成人av电影在线播放| 国产精品久久久久久久久久久免费看| 成人av动漫网站| 一区二区三区欧美久久| 欧美一区二区黄| 国产一区二区三区四区五区入口 | 亚洲国产三级在线| 欧美日韩视频不卡| 裸体歌舞表演一区二区| 亚洲国产精品成人综合色在线婷婷 | 久久99国产精品尤物| 久久九九久久九九| 色一区在线观看| 丝袜亚洲另类丝袜在线| 精品久久久久久亚洲综合网 | 一本色道久久综合亚洲aⅴ蜜桃 | 日本va欧美va欧美va精品| 欧美精品一区二区三区蜜桃视频 | av欧美精品.com|