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

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

?? sortform.cs

?? 《數據庫原理及應用》-劉玉寶主編-源代碼
?? CS
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data;

namespace KTMIS
{
	/// <summary>
	/// Sort 的摘要說明。
	/// </summary>
	public class Sort : System.Windows.Forms.Form
	{
		private System.Windows.Forms.DataGrid SortdataGrid;
		private SqlConnection SortConnection = null;
		private SqlCommand SortSelectCommand = null;
		private SqlCommand SortDeleteCommand = null;
		private SqlDataAdapter SortDataAdapter = null;
		private DataSet ds = null;
		private string sqlString = null; 
		private int Row = -1;
		private System.Windows.Forms.Button addBtn;
		private System.Windows.Forms.Button updateBtn;
		private System.Windows.Forms.Button deleteBtn;
		private System.Windows.Forms.Button selectBtn;
		private System.Windows.Forms.TextBox FLMtextBox;
		private System.Windows.Forms.Label FLMlabel;
		private System.Windows.Forms.Button returnBtn;
		/// <summary>
		/// 必需的設計器變量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Sort()
		{
			//
			// 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.addBtn = new System.Windows.Forms.Button();
			this.updateBtn = new System.Windows.Forms.Button();
			this.deleteBtn = new System.Windows.Forms.Button();
			this.selectBtn = new System.Windows.Forms.Button();
			this.FLMtextBox = new System.Windows.Forms.TextBox();
			this.FLMlabel = new System.Windows.Forms.Label();
			this.SortdataGrid = new System.Windows.Forms.DataGrid();
			this.returnBtn = new System.Windows.Forms.Button();
			((System.ComponentModel.ISupportInitialize)(this.SortdataGrid)).BeginInit();
			this.SuspendLayout();
			// 
			// addBtn
			// 
			this.addBtn.Location = new System.Drawing.Point(32, 32);
			this.addBtn.Name = "addBtn";
			this.addBtn.Size = new System.Drawing.Size(120, 32);
			this.addBtn.TabIndex = 0;
			this.addBtn.Text = "添加";
			this.addBtn.Click += new System.EventHandler(this.addBtn_Click);
			// 
			// updateBtn
			// 
			this.updateBtn.Location = new System.Drawing.Point(200, 32);
			this.updateBtn.Name = "updateBtn";
			this.updateBtn.Size = new System.Drawing.Size(120, 32);
			this.updateBtn.TabIndex = 1;
			this.updateBtn.Text = "修改";
			this.updateBtn.Click += new System.EventHandler(this.updateBtn_Click);
			// 
			// deleteBtn
			// 
			this.deleteBtn.Location = new System.Drawing.Point(368, 32);
			this.deleteBtn.Name = "deleteBtn";
			this.deleteBtn.Size = new System.Drawing.Size(120, 32);
			this.deleteBtn.TabIndex = 2;
			this.deleteBtn.Text = "刪除";
			this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click);
			// 
			// selectBtn
			// 
			this.selectBtn.Location = new System.Drawing.Point(536, 80);
			this.selectBtn.Name = "selectBtn";
			this.selectBtn.Size = new System.Drawing.Size(96, 32);
			this.selectBtn.TabIndex = 3;
			this.selectBtn.Text = "查詢";
			this.selectBtn.Click += new System.EventHandler(this.selectBtn_Click);
			// 
			// FLMtextBox
			// 
			this.FLMtextBox.Location = new System.Drawing.Point(312, 80);
			this.FLMtextBox.Name = "FLMtextBox";
			this.FLMtextBox.Size = new System.Drawing.Size(200, 30);
			this.FLMtextBox.TabIndex = 4;
			this.FLMtextBox.Text = "";
			// 
			// FLMlabel
			// 
			this.FLMlabel.Location = new System.Drawing.Point(24, 80);
			this.FLMlabel.Name = "FLMlabel";
			this.FLMlabel.Size = new System.Drawing.Size(280, 32);
			this.FLMlabel.TabIndex = 5;
			this.FLMlabel.Text = "請輸入所要查詢的分類名:";
			// 
			// SortdataGrid
			// 
			this.SortdataGrid.DataMember = "";
			this.SortdataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.SortdataGrid.Location = new System.Drawing.Point(16, 128);
			this.SortdataGrid.Name = "SortdataGrid";
			this.SortdataGrid.ReadOnly = true;
			this.SortdataGrid.Size = new System.Drawing.Size(664, 328);
			this.SortdataGrid.TabIndex = 6;
			this.SortdataGrid.MouseDown += new System.Windows.Forms.MouseEventHandler(this.SortdataGrid_MouseDown);
			this.SortdataGrid.MouseUp += new System.Windows.Forms.MouseEventHandler(this.SortdataGrid_MouseUp);
			// 
			// returnBtn
			// 
			this.returnBtn.Location = new System.Drawing.Point(544, 32);
			this.returnBtn.Name = "returnBtn";
			this.returnBtn.Size = new System.Drawing.Size(120, 32);
			this.returnBtn.TabIndex = 7;
			this.returnBtn.Text = "返回";
			this.returnBtn.Click += new System.EventHandler(this.returnBtn_Click);
			// 
			// Sort
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(11, 23);
			this.ClientSize = new System.Drawing.Size(696, 470);
			this.Controls.Add(this.returnBtn);
			this.Controls.Add(this.SortdataGrid);
			this.Controls.Add(this.FLMlabel);
			this.Controls.Add(this.FLMtextBox);
			this.Controls.Add(this.selectBtn);
			this.Controls.Add(this.deleteBtn);
			this.Controls.Add(this.updateBtn);
			this.Controls.Add(this.addBtn);
			this.Font = new System.Drawing.Font("宋體", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.Name = "Sort";
			this.Text = "分類信息維護";
			this.Load += new System.EventHandler(this.Sort_Load);
			((System.ComponentModel.ISupportInitialize)(this.SortdataGrid)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void Sort_Load(object sender, System.EventArgs e)
		{ 
			//string connString = "user id=sa;data source=\".\";initial catalog=KTMIS";
			//SortConnection = new SqlConnection(connString);
			SortSelectCommand = new SqlCommand("",SortConnection);
			SortDeleteCommand = new SqlCommand("DeleteSort",SortConnection); 
			sqlString = "select SortNa as 分類名稱,SortPY as 分類拼音縮寫 from Sort"; 
			ds = new DataSet();
			try
			{
				SortDataAdapter = new SqlDataAdapter(sqlString,SortConnection);
				SortDataAdapter.Fill(ds,"Sort");
			}
			catch(Exception ex)
			{
				MessageBox.Show("載入錯誤!原因是"+ex.ToString(),"系統提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
				return;
			}
			SortdataGrid.SetDataBinding(ds,"Sort");
		}


		private void addBtn_Click(object sender, System.EventArgs e)
		{
			addSort aSort = new addSort();
			aSort.Connection = this.SortConnection;
			aSort.ShowDialog();
			Initial();
		}

		private void updateBtn_Click(object sender, System.EventArgs e)
		{
			string name = null;
			string py = null;
			DataTable dt = ds.Tables["Sort"];
			for(int i = 0;i<dt.Rows.Count;i++)
			{
				if(SortdataGrid.IsSelected(i))
				{
					name = dt.Rows[i][0].ToString();
					py = dt.Rows[i][1].ToString();
					break;
				}
			}
			if(name==null)
			{
				MessageBox.Show("請選擇在表框中所要修改的分類的行!","系統提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
				return;
			}
			string sortCo = null;
			string selectString = "select SortCo from Sort where SortNa=\'"+name+"\' and SortPY=\'"+py+"\'";
			SortSelectCommand.CommandText = selectString;
			try
			{
				SortConnection.Open();
				SqlDataReader dr = SortSelectCommand.ExecuteReader();
				while(dr.Read())
				{
					sortCo = dr.GetValue(0).ToString();
					break;
				}
			}
			catch(Exception ex)
			{
				MessageBox.Show(" 讀取數據失敗!原因是"+ex.ToString(),"系統提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
				return;
			}
			finally
			{
				SortConnection.Close();
			}
			if(sortCo==null)
			{
				MessageBox.Show("操作失敗,請重試!","系統提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
				return;
			}
			addSort aSort = new addSort();
			aSort.SetBtnText("修改");
			aSort.SetSortCoText(sortCo.ToString());
			aSort.SetSNText(name);
			aSort.SetSNPYText(py);
			aSort.SetFormTital("修改分類");
			aSort.ShowDialog();
			Initial();
		}

		private void Initial()
		{
			ds.Clear();
			SortDataAdapter.SelectCommand.CommandText = sqlString;
			try
			{
				SortConnection.Open();
				SortDataAdapter.Fill(ds,"Sort");
				SortdataGrid.SetDataBinding(ds,"Sort");
			}
			catch(Exception e)
			{
				MessageBox.Show("初始化錯誤!原因是"+e.ToString(),"系統提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
			finally
			{
				SortConnection.Close();
			}
		}

		private void SortdataGrid_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			DataGrid myGrid = (DataGrid) sender;
			DataGrid.HitTestInfo hti;
			hti = myGrid.HitTest(e.X, e.Y);
			if(hti.Type==DataGrid.HitTestType.Cell)
			{
				Row = hti.Row;
			}
			else
			{
				Row = -1;
			}
		}

		private void deleteBtn_Click(object sender, System.EventArgs e)
		{
			string questionStr = "若刪除該分類信息,與其相關的課題信息亦將同時被刪除!\n\n是否繼續?";
			DialogResult dialogResult = MessageBox.Show(questionStr, "系統提問", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
			if(dialogResult == DialogResult.No)
			{
				return;
			}

			string name = null;
			string py = null;
			DataTable dt = ds.Tables["Sort"];
			for(int i = 0;i<dt.Rows.Count;i++)
			{
				if(SortdataGrid.IsSelected(i))
				{
					name = dt.Rows[i][0].ToString();
					py = dt.Rows[i][1].ToString();
					break;
				}
			}
			if(name==null)
			{
				MessageBox.Show("請選擇在表框中所要修改的分類的行!","系統提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
				return;
			}
			string sortCo = null;
			string selectString = "select SortCo from Sort where SortNa=\'"+name+"\' and SortPY=\'"+py+"\'";
			SortSelectCommand.CommandText = selectString;
			try
			{
				SortConnection.Open();
				SqlDataReader dr = SortSelectCommand.ExecuteReader();
				while(dr.Read())
				{
					sortCo = dr.GetValue(0).ToString();
					break;
				}
			}
			catch(Exception ex)
			{
				MessageBox.Show(" 讀取數據失敗!原因是"+ex.ToString(),"系統提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
			finally
			{
				SortConnection.Close();
			}
			if(sortCo==null)
			{
				MessageBox.Show("操作失敗,請重試!","系統提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
				return;
			}
			SortDeleteCommand.CommandType = CommandType.StoredProcedure;
			SortDeleteCommand.Parameters.Clear();
			SortDeleteCommand.Parameters.Add("@SortCo",SqlDbType.Int);
			SortDeleteCommand.Parameters["@SortCo"].Value = Convert.ToInt16(sortCo.Trim());
			try
			{
				SortConnection.Open();
				SortDeleteCommand.ExecuteNonQuery();
				MessageBox.Show("刪除成功!","系統提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
			catch(Exception ex)
			{
				MessageBox.Show("刪除失敗,原因是:"+ex.ToString(),"系統提示",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
				return;
			}
			finally
			{
				SortConnection.Close();
			}
			
			Initial();
		}

		private void SortdataGrid_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			if(Row!=-1)
			{
				SortdataGrid.Select(Row);
			}
		}

		private void selectBtn_Click(object sender, System.EventArgs e)
		{
			string sqlStr = "select SortNa as 分類名稱,SortPY as 分類拼音縮寫 from Sort where SortNa like \'%" +FLMtextBox.Text.Trim()+"%\'"; 
			ds.Clear();
			try
			{
				SortDataAdapter.SelectCommand.CommandText = sqlStr;
				SortDataAdapter.Fill(ds,"Sort");
			}
			catch(Exception ex)
			{
				MessageBox.Show("載入錯誤!原因是"+ex.ToString(),"系統提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
			SortdataGrid.SetDataBinding(ds,"Sort");
		}

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

		public System.Data.SqlClient.SqlConnection Connection
		{
			set
			{
				this.SortConnection = value;
			}
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国产精品免费| 久久久www免费人成精品| 欧美国产日韩一二三区| 激情综合五月婷婷| 欧美tickling网站挠脚心| 婷婷综合在线观看| 欧美精品自拍偷拍| 亚洲成av人片一区二区| 色综合色综合色综合| 亚洲三级视频在线观看| 风间由美性色一区二区三区| 久久精品夜夜夜夜久久| 国产激情91久久精品导航| 精品国产一区二区三区av性色 | 香蕉影视欧美成人| 欧美午夜片在线观看| 亚洲第一电影网| 制服丝袜亚洲播放| 国产酒店精品激情| 中文字幕不卡一区| 色婷婷精品久久二区二区蜜臀av| 日韩一区在线看| 欧美亚洲国产bt| 免费观看一级特黄欧美大片| 亚洲精品一线二线三线| 国产成人一区在线| 综合精品久久久| 欧美喷潮久久久xxxxx| 亚洲国产成人高清精品| 欧美mv和日韩mv的网站| 丁香另类激情小说| 亚洲不卡在线观看| xnxx国产精品| av激情综合网| 青草国产精品久久久久久| 精品国产乱码久久久久久浪潮| 国产成人综合在线观看| 亚洲一区视频在线观看视频| 欧美日韩国产综合草草| 精品一区二区三区在线播放| 中文字幕亚洲在| 欧美高清视频不卡网| 国产一区二三区好的| 中文字幕亚洲一区二区va在线| 欧美三级在线播放| 国产成人精品综合在线观看| 中文字幕佐山爱一区二区免费| 欧美综合天天夜夜久久| 激情图片小说一区| 亚洲精品免费播放| 欧美mv和日韩mv国产网站| 波多野结衣精品在线| 天使萌一区二区三区免费观看| 不卡欧美aaaaa| 国产精品你懂的| 日韩女优视频免费观看| 欧美日韩成人在线一区| 91麻豆高清视频| 99久久精品国产毛片| 国产成人精品aa毛片| 国产综合色产在线精品| 男女视频一区二区| 石原莉奈在线亚洲二区| 亚洲午夜精品久久久久久久久| 综合激情成人伊人| 国产精品久久久久9999吃药| 久久一二三国产| 精品久久久三级丝袜| 欧美一区二区三区喷汁尤物| 欧美日韩国产系列| 在线观看91av| 欧美日韩视频在线观看一区二区三区| 色av一区二区| 欧美在线一二三四区| 91在线视频播放| 91久久久免费一区二区| 一本久道中文字幕精品亚洲嫩| 91同城在线观看| 91国产免费看| 欧美三级日韩三级国产三级| 欧美视频一区二区三区在线观看| 欧美主播一区二区三区| 欧美日韩免费高清一区色橹橹| 欧美性猛交xxxxxxxx| 欧美高清精品3d| 欧美va在线播放| 国产日韩欧美麻豆| 亚洲人午夜精品天堂一二香蕉| 亚洲日本韩国一区| 亚洲成av人综合在线观看| 日韩电影一区二区三区四区| 久久99久久99小草精品免视看| 久久99久久99精品免视看婷婷 | 色噜噜狠狠色综合中国 | 精品视频一区二区不卡| 欧美精品18+| 久久久www成人免费无遮挡大片| 国产清纯在线一区二区www| 国产精品初高中害羞小美女文| 亚洲素人一区二区| 偷拍亚洲欧洲综合| 国内久久精品视频| 91亚洲精华国产精华精华液| 欧美亚洲图片小说| 2014亚洲片线观看视频免费| 国产精品女主播在线观看| 亚洲自拍偷拍麻豆| 激情另类小说区图片区视频区| 国产a级毛片一区| 日本韩国精品在线| 欧美成人性福生活免费看| 国产精品久久久久永久免费观看| 亚洲国产日韩综合久久精品| 精品亚洲porn| 91麻豆123| 久久影音资源网| 亚洲一区二区三区四区在线免费观看 | 亚洲最大色网站| 麻豆极品一区二区三区| 成人91在线观看| 日韩视频一区在线观看| 中文字幕一区二区三区色视频| 日本成人在线电影网| www.日韩精品| 日韩欧美国产精品| 亚洲高清在线视频| 成人综合婷婷国产精品久久| 欧美精品xxxxbbbb| 亚洲精品大片www| 国产高清不卡一区| 91麻豆精品国产91久久久资源速度| 欧美国产激情一区二区三区蜜月| 亚洲成人av中文| 99国产欧美另类久久久精品| 精品久久人人做人人爱| 亚洲v精品v日韩v欧美v专区 | 极品少妇一区二区| 在线精品视频一区二区| 欧美国产日韩在线观看| 麻豆国产精品官网| 欧美福利视频一区| 一区二区成人在线视频| 成人国产精品免费观看| 久久综合给合久久狠狠狠97色69| 亚洲在线成人精品| 91免费观看国产| 中文一区在线播放| 国产尤物一区二区在线| 日韩欧美国产一区二区在线播放| 亚洲国产综合在线| 色丁香久综合在线久综合在线观看| 欧美国产日本韩| 久久爱另类一区二区小说| 91麻豆精品国产91久久久久久久久 | 欧美哺乳videos| 亚洲成人av在线电影| 欧美性猛交一区二区三区精品| 亚洲欧洲日本在线| 成人性视频网站| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 国产在线不卡一卡二卡三卡四卡| 欧美日韩欧美一区二区| 亚洲人成电影网站色mp4| 成人免费看片app下载| 国产无人区一区二区三区| 国产精品综合一区二区| 久久这里只精品最新地址| 韩国v欧美v亚洲v日本v| 26uuu久久综合| 国产精品一区二区免费不卡| 久久久精品影视| 国产v综合v亚洲欧| 国产精品每日更新在线播放网址| 色婷婷精品久久二区二区蜜臀av | 日韩精品一区二区三区中文不卡| 午夜国产不卡在线观看视频| 欧美日韩国产高清一区二区三区 | 91极品视觉盛宴| 亚洲va中文字幕| 日韩一区二区三区电影 | 亚洲女与黑人做爰| 色噜噜夜夜夜综合网| 日韩电影一区二区三区| 久久亚洲精品小早川怜子| 粉嫩绯色av一区二区在线观看| 国产精品高清亚洲| 欧美午夜精品一区二区三区| 奇米影视在线99精品| 久久美女艺术照精彩视频福利播放 | 中文字幕中文字幕一区二区| 在线免费观看视频一区| 午夜天堂影视香蕉久久| 日韩免费电影一区| 成人一区在线观看| 一区二区三区免费在线观看| 欧美日韩国产综合一区二区| 国产在线精品一区二区不卡了| 中文字幕一区二区三区四区不卡| 欧美日韩午夜在线| 国产激情一区二区三区四区|