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

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

?? popedommanage.cs

?? 完整的進銷存系統 本人已經測試 對系統的初學者很有幫助
?? CS
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace 進銷存管理系統
{
	/// <summary>
	/// PopedomManage 的摘要說明。
	/// </summary>
	public class PopedomManage : System.Windows.Forms.Form
	{
		//設置數據庫連接和適配器
		private DataSet ds = new DataSet();
		private	LinkDataBase link = new LinkDataBase();	
		private string sendTableName = "用戶清單";
		private string sendStrSQL = "SELECT * from 用戶清單 where 姓名<>'sys'";
		private DataTable popedomDataTable = new DataTable();
		private bool blInitial = true;

		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.CheckedListBox chkLst_Priority;
		private System.Windows.Forms.DataGrid dgrd_Popedom;
		/// <summary>
		/// 必需的設計器變量。
		/// </summary>
		private System.ComponentModel.Container components = null;

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

			//
			// 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.groupBox1 = new System.Windows.Forms.GroupBox();
			this.chkLst_Priority = new System.Windows.Forms.CheckedListBox();
			this.label2 = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.dgrd_Popedom = new System.Windows.Forms.DataGrid();
			this.groupBox1.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.dgrd_Popedom)).BeginInit();
			this.SuspendLayout();
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.chkLst_Priority);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Controls.Add(this.dgrd_Popedom);
			this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.groupBox1.Location = new System.Drawing.Point(0, 0);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(648, 357);
			this.groupBox1.TabIndex = 0;
			this.groupBox1.TabStop = false;
			// 
			// chkLst_Priority
			// 
			this.chkLst_Priority.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.chkLst_Priority.CheckOnClick = true;
			this.chkLst_Priority.Items.AddRange(new object[] {
																 "商品資料維護",
																 "供貨商資料維護",
																 "客戶資料維護",
																 "進貨單",
																 "銷售單",
																 "庫存查詢",
																 "權限管理"});
			this.chkLst_Priority.Location = new System.Drawing.Point(456, 52);
			this.chkLst_Priority.Name = "chkLst_Priority";
			this.chkLst_Priority.Size = new System.Drawing.Size(172, 276);
			this.chkLst_Priority.TabIndex = 2;
			this.chkLst_Priority.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.chkLst_Priority_ItemCheck);
			// 
			// label2
			// 
			this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
			this.label2.Location = new System.Drawing.Point(450, 28);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(100, 16);
			this.label2.TabIndex = 5;
			this.label2.Text = "權限:";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(33, 28);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(100, 16);
			this.label1.TabIndex = 4;
			this.label1.Text = "用戶:";
			// 
			// dgrd_Popedom
			// 
			this.dgrd_Popedom.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_Popedom.CaptionVisible = false;
			this.dgrd_Popedom.DataMember = "";
			this.dgrd_Popedom.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dgrd_Popedom.Location = new System.Drawing.Point(26, 52);
			this.dgrd_Popedom.Name = "dgrd_Popedom";
			this.dgrd_Popedom.ReadOnly = true;
			this.dgrd_Popedom.Size = new System.Drawing.Size(412, 274);
			this.dgrd_Popedom.TabIndex = 1;
			this.dgrd_Popedom.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dgrd_Popedom_MouseUp);
			// 
			// PopedomManage
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(648, 357);
			this.Controls.Add(this.groupBox1);
			this.Name = "PopedomManage";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "【權限管理】";
			this.Load += new System.EventHandler(this.PopedomManage_Load);
			this.groupBox1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dgrd_Popedom)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion
        //---------窗體創建時,將用戶的權限數據讀入并顯示-----------
		private void PopedomManage_Load(object sender, System.EventArgs e)
		{
			this.ds = this.link.SelectDataBase(sendStrSQL,sendTableName);
			this.dgrd_Popedom.DataSource = ds.Tables[0];
			this.DataGridStateControl();

			this.dgrd_Popedom.Select(0);//窗體生成后選中第一行
			string selectedUserID = this.ds.Tables[0].Rows[0][0].ToString();//默認選中用戶清單中的第一個用戶
			string tempStrSQL = "select 權限名稱 from 權限清單 " + " where 用戶編號 = '" + selectedUserID + "'";
			popedomDataTable = link.SelectDataBase(tempStrSQL);//讀入該用戶的權限
			for (int i=0;i<popedomDataTable.Rows.Count;i++)//根據權限設置ListBox
			{
				for (int j=0;j<this.chkLst_Priority.Items.Count;j++)
				{
					if (this.chkLst_Priority.Items[j].ToString().Trim() == popedomDataTable.Rows[i][0].ToString().Trim())
					{
						this.chkLst_Priority.SetItemChecked(j,true);
					}
				}
			}
		}

		//-------------設置顯示用戶信息的表---------------
		private void DataGridStateControl()
		{
			DataGridTableStyle ts = new DataGridTableStyle();
			DataGridNoActiveCellColumn aColumnTextColumn;//設置dataGrid格式
			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++)
			{
				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_Popedom.TableStyles.Add(ts);
		}

		
		//-------------改變用戶的權限,并向數據庫中提交----------------
		private void chkLst_Priority_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
		{
			//CheckedListBox控件中的Item的CheckedState屬性是由點擊CheckedListBox控件而改變時才響應該事件
			if (blInitial == false)
			{
				if (e.CurrentValue.ToString() == "Unchecked")
				{
					try
					{
						string strUserName = this.dgrd_Popedom[this.dgrd_Popedom.CurrentCell.RowNumber,0].ToString().Trim();
						string strPopedom = this.chkLst_Priority.SelectedItem.ToString();
						string tempSendStrSQL = "insert 權限清單 (用戶編號,權限名稱) values ('" + strUserName +"','"+ strPopedom +"')";
						this.link.UpdateDataBase(tempSendStrSQL);
					}
					catch
					{
						MessageBox.Show("數據庫中的權限修改出錯,請重試!","信息");
					}
				}
				else if (e.CurrentValue.ToString() == "Checked")
				{
					try
					{
						string strUserName = this.dgrd_Popedom[this.dgrd_Popedom.CurrentCell.RowNumber,0].ToString().Trim();
						string strPopedom = this.chkLst_Priority.SelectedItem.ToString();
						string tempSendStrSQL = "delete from 權限清單 where (用戶編號 = '" + strUserName +"'" +
							" and 權限名稱 = '" + strPopedom + "')";
						this.link.UpdateDataBase(tempSendStrSQL);
					}
					catch
					{
						MessageBox.Show("數據庫中的權限修改出錯!","信息");
					}
				}
			}
		}

		private void dgrd_Popedom_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			if (this.dgrd_Popedom.CurrentCell.RowNumber >= this.ds.Tables[0].Rows.Count)//防止出現所選的用戶不在數據表中的情況
			{
				return;
			}
			this.chkLst_Priority.Enabled = true;
			blInitial = true; //控制當【權限管理】窗體剛生成時和點擊其他用戶時使CheckedListBox控件中數據發生改變時不響應ItemCheck事件
			//以下代碼實現的是當dataGrid中所選用戶改變時,根據選中用戶權限重新設置listBox的功能
			for (int i=0;i<this.chkLst_Priority.Items.Count;i++)//將listBox中所有權限設為未選中
			{
				this.chkLst_Priority.SetItemChecked(i,false);
			}
			int intRowNumber = this.dgrd_Popedom.CurrentCell.RowNumber;
			string selectedUserID = this.ds.Tables[0].Rows[intRowNumber][0].ToString();
			string tempStrSQL = "select 權限名稱 from 權限清單 " + " where 用戶編號 = '" + selectedUserID + "'";
			popedomDataTable = link.SelectDataBase(tempStrSQL);//查詢所選用戶權限
			for (int i=0;i<popedomDataTable.Rows.Count;i++)//重新設置listBox
			{
				for (int j=0;j<this.chkLst_Priority.Items.Count;j++)
				{
					if (this.chkLst_Priority.Items[j].ToString().Trim() == popedomDataTable.Rows[i][0].ToString().Trim())
					{
						this.chkLst_Priority.SetItemChecked(j,true);
					}
				}
			}			
			blInitial = false;
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人激情小说网站| 老司机精品视频一区二区三区| 精品噜噜噜噜久久久久久久久试看| 色天天综合色天天久久| 99精品视频在线播放观看| eeuss鲁一区二区三区| 国产精品自在欧美一区| 国产成人在线电影| 成人国产精品视频| 99精品国产99久久久久久白柏| 成人午夜av电影| a4yy欧美一区二区三区| 色婷婷久久一区二区三区麻豆| 色老汉一区二区三区| 欧美午夜片在线观看| 欧美喷水一区二区| 欧美一级日韩免费不卡| 欧美www视频| 国产欧美一区在线| 亚洲男人都懂的| 日韩二区三区四区| 国产精品中文字幕欧美| 99r国产精品| 欧美日韩一区二区欧美激情| 欧美成人女星排名| 欧美国产日韩在线观看| 一区二区三区色| 美腿丝袜在线亚洲一区| 国产激情一区二区三区四区| 99久久精品久久久久久清纯| 欧美性大战久久久久久久 | 国产亚洲精久久久久久| 久久精品日产第一区二区三区高清版 | 亚洲女同一区二区| 视频一区欧美精品| 成人毛片老司机大片| 久久网站热最新地址| 日本一区免费视频| 性欧美疯狂xxxxbbbb| 国产高清视频一区| 91精品国产黑色紧身裤美女| 中文字幕第一区第二区| 日日夜夜免费精品视频| 国产99一区视频免费| 欧美一区二区三区视频在线| 综合久久久久综合| 精品一区二区三区不卡| 在线免费观看日本一区| 久久久久久久久久久久电影| 亚洲第四色夜色| 成人高清视频免费观看| 日韩视频一区二区三区| 亚洲小说春色综合另类电影| 成人免费看片app下载| 欧美刺激午夜性久久久久久久| 亚洲欧美偷拍卡通变态| 国产成人日日夜夜| 亚洲精品一区二区三区香蕉 | 欧美日韩激情一区二区三区| 国产精品电影一区二区三区| 精品在线免费视频| 日韩一区二区视频| 香蕉久久一区二区不卡无毒影院| 99国产精品国产精品毛片| 国产日韩v精品一区二区| 欧美视频在线一区| 亚洲同性同志一二三专区| 粉嫩欧美一区二区三区高清影视| 亚洲精品一区二区三区蜜桃下载| 日韩在线一区二区三区| 欧美日韩黄色一区二区| 亚洲综合自拍偷拍| 色婷婷狠狠综合| 亚洲乱码精品一二三四区日韩在线| 成人综合在线观看| 欧美韩国日本一区| 成人免费av资源| 成人免费在线播放视频| 99在线热播精品免费| 国产精品福利一区| 91麻豆免费观看| 一区二区欧美国产| 欧美午夜电影在线播放| 午夜精品在线看| 欧美一级久久久久久久大片| 蜜臀精品一区二区三区在线观看| 日韩一区二区在线观看视频| 麻豆精品视频在线观看视频| 精品日产卡一卡二卡麻豆| 国模大尺度一区二区三区| 日本一区二区三区在线观看| 本田岬高潮一区二区三区| 亚洲乱码中文字幕综合| 一区精品在线播放| 色av综合在线| 午夜精品久久久久久久久久| 欧美一区二区三区四区在线观看 | 免费观看成人鲁鲁鲁鲁鲁视频| 91精品福利在线一区二区三区 | 成人黄色电影在线| 一区二区欧美视频| 欧美第一区第二区| 成人午夜av电影| 亚洲va韩国va欧美va精品| 日韩欧美123| aaa亚洲精品一二三区| 天堂va蜜桃一区二区三区| 欧美精品一区二区精品网| 成人高清视频在线| 蜜桃一区二区三区在线| 国产精品色呦呦| 欧美情侣在线播放| 成人av网站免费| 三级欧美在线一区| 国产精品国产三级国产| 欧美伦理视频网站| 成人午夜在线播放| 秋霞av亚洲一区二区三| 亚洲欧洲另类国产综合| 日韩欧美国产wwwww| 99re8在线精品视频免费播放| 日本中文一区二区三区| 亚洲欧美另类图片小说| 欧美成人bangbros| 欧洲亚洲精品在线| 国产v综合v亚洲欧| 麻豆专区一区二区三区四区五区| 亚洲欧美另类在线| 欧美极品少妇xxxxⅹ高跟鞋| 欧美精品一二三区| 在线中文字幕一区二区| 丁香婷婷综合五月| 久久99精品久久久久久| 亚洲高清视频中文字幕| 一区二区中文字幕在线| 国产偷国产偷亚洲高清人白洁| 911精品产国品一二三产区| 日本韩国精品在线| 成人91在线观看| 国产成人欧美日韩在线电影| 免费成人小视频| av电影在线观看不卡| 精品制服美女久久| 免费观看91视频大全| 偷拍自拍另类欧美| 夜夜嗨av一区二区三区四季av| 亚洲欧洲美洲综合色网| 国产日产亚洲精品系列| 久久综合色婷婷| 欧美精品一区二区久久婷婷| 日韩欧美高清在线| 日韩精品一区二区三区老鸭窝| 3751色影院一区二区三区| 欧美猛男gaygay网站| 欧美日韩国产首页| 51精品国自产在线| 欧美一级免费大片| 精品国产乱码久久久久久闺蜜| 日韩一级成人av| 精品少妇一区二区三区日产乱码| 欧美一区二区播放| www国产精品av| 欧美激情在线观看视频免费| 国产精品乱码人人做人人爱| 欧美韩日一区二区三区四区| 国产精品久久久久久一区二区三区 | 91精品欧美久久久久久动漫| 欧美日韩一区二区三区视频| 欧美精品777| 26uuu精品一区二区| 国产夜色精品一区二区av| 国产欧美日韩视频一区二区| 中文字幕一区二区在线播放| 一区二区三区四区不卡在线| 丝袜美腿高跟呻吟高潮一区| 乱中年女人伦av一区二区| 国产东北露脸精品视频| 欧美成人一区二区三区| 国产亚洲欧美日韩日本| 亚洲女同女同女同女同女同69| 天天色天天操综合| 狠狠色丁香婷婷综合久久片| 成人午夜伦理影院| 欧美在线999| 久久久精品影视| 亚洲曰韩产成在线| 狠狠v欧美v日韩v亚洲ⅴ| 波多野结衣在线aⅴ中文字幕不卡| www.欧美日韩| 91精品国产手机| 国产精品电影院| 精品在线一区二区| 91国模大尺度私拍在线视频| 日韩精品一区二区三区三区免费| 中文字幕制服丝袜成人av| 日韩电影一区二区三区四区| 不卡的av网站| 欧美成人一区二区三区| 午夜日韩在线电影| eeuss影院一区二区三区 |