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

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

?? test_info.cs

?? 學生管理系統
?? CS
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;

namespace chaxun
{
	/// <summary>
	/// Test_info 的摘要說明。
	/// </summary>
	public class Test_info : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.DataGrid dataGrid1;
		private SqlDataAdapter thisAdapter;
		private DataSet mydataset;		
		private System.Windows.Forms.TextBox txtID;
		private System.Windows.Forms.TextBox txtName;
		private System.Windows.Forms.Button btnIncrease;
		private System.Windows.Forms.Button btnModification;
		private System.Windows.Forms.Button btndelete;
		private System.Windows.Forms.Button btnnext;
		private System.Windows.Forms.Button btnbefore;
		private System.Windows.Forms.Button button1;
		BindingManagerBase bManager;

		private System.Windows.Forms.CurrencyManager cmAmend;
		/// <summary>
		/// 必需的設計器變量。
		/// </summary>
		/// 
		
		private System.ComponentModel.Container components = null;

		public Test_info()
		{
			//
			// Windows 窗體設計器支持所必需的
			//
			InitializeComponent();
			SqlConnection thisConnection=new SqlConnection("integrated security=SSPI;data source=.;persist security info=False;initial catalog=xxgcx");  
			thisAdapter=new SqlDataAdapter("	SELECT Test_Id as 課程編號,Test_name as 課程名稱 from test",thisConnection);
			SqlCommandBuilder thisBuilder=new SqlCommandBuilder(thisAdapter);
			mydataset=new DataSet();
			thisAdapter.Fill(mydataset,"test");
			
			

			//
			// 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.label2 = new System.Windows.Forms.Label();
			this.txtID = new System.Windows.Forms.TextBox();
			this.label3 = new System.Windows.Forms.Label();
			this.txtName = new System.Windows.Forms.TextBox();
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.dataGrid1 = new System.Windows.Forms.DataGrid();
			this.btnIncrease = new System.Windows.Forms.Button();
			this.btnModification = new System.Windows.Forms.Button();
			this.btndelete = new System.Windows.Forms.Button();
			this.btnnext = new System.Windows.Forms.Button();
			this.btnbefore = new System.Windows.Forms.Button();
			this.button1 = new System.Windows.Forms.Button();
			this.groupBox1.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
			this.SuspendLayout();
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(8, 26);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(80, 23);
			this.label2.TabIndex = 1;
			this.label2.Text = "課程編號";
			// 
			// txtID
			// 
			this.txtID.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.txtID.Location = new System.Drawing.Point(96, 24);
			this.txtID.Name = "txtID";
			this.txtID.Size = new System.Drawing.Size(120, 25);
			this.txtID.TabIndex = 2;
			this.txtID.Text = "";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(232, 26);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(72, 23);
			this.label3.TabIndex = 3;
			this.label3.Text = "課程名稱";
			// 
			// txtName
			// 
			this.txtName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.txtName.Location = new System.Drawing.Point(320, 24);
			this.txtName.Name = "txtName";
			this.txtName.Size = new System.Drawing.Size(136, 25);
			this.txtName.TabIndex = 4;
			this.txtName.Text = "";
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.txtID);
			this.groupBox1.Controls.Add(this.txtName);
			this.groupBox1.Controls.Add(this.label3);
			this.groupBox1.Location = new System.Drawing.Point(16, 288);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(464, 56);
			this.groupBox1.TabIndex = 9;
			this.groupBox1.TabStop = false;
			// 
			// dataGrid1
			// 
			this.dataGrid1.DataMember = "";
			this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataGrid1.Location = new System.Drawing.Point(16, 0);
			this.dataGrid1.Name = "dataGrid1";
			this.dataGrid1.PreferredColumnWidth = 210;
			this.dataGrid1.ReadOnly = true;
			this.dataGrid1.Size = new System.Drawing.Size(464, 288);
			this.dataGrid1.TabIndex = 10;
			// 
			// btnIncrease
			// 
			this.btnIncrease.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnIncrease.Location = new System.Drawing.Point(16, 360);
			this.btnIncrease.Name = "btnIncrease";
			this.btnIncrease.Size = new System.Drawing.Size(64, 29);
			this.btnIncrease.TabIndex = 11;
			this.btnIncrease.Text = "添加";
			this.btnIncrease.Click += new System.EventHandler(this.btnIncrease_Click);
			// 
			// btnModification
			// 
			this.btnModification.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnModification.Location = new System.Drawing.Point(88, 360);
			this.btnModification.Name = "btnModification";
			this.btnModification.Size = new System.Drawing.Size(64, 29);
			this.btnModification.TabIndex = 12;
			this.btnModification.Text = "修改";
			this.btnModification.Click += new System.EventHandler(this.btnModification_Click);
			// 
			// btndelete
			// 
			this.btndelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btndelete.Location = new System.Drawing.Point(160, 360);
			this.btndelete.Name = "btndelete";
			this.btndelete.Size = new System.Drawing.Size(64, 29);
			this.btndelete.TabIndex = 13;
			this.btndelete.Text = "刪除";
			this.btndelete.Click += new System.EventHandler(this.btndelete_Click);
			// 
			// btnnext
			// 
			this.btnnext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnnext.Location = new System.Drawing.Point(400, 360);
			this.btnnext.Name = "btnnext";
			this.btnnext.Size = new System.Drawing.Size(75, 30);
			this.btnnext.TabIndex = 19;
			this.btnnext.Text = "下一條";
			this.btnnext.Click += new System.EventHandler(this.btnnext_Click);
			// 
			// btnbefore
			// 
			this.btnbefore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnbefore.Location = new System.Drawing.Point(320, 360);
			this.btnbefore.Name = "btnbefore";
			this.btnbefore.Size = new System.Drawing.Size(74, 29);
			this.btnbefore.TabIndex = 18;
			this.btnbefore.Text = "上一條";
			this.btnbefore.Click += new System.EventHandler(this.btnbefore_Click);
			// 
			// button1
			// 
			this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.button1.Location = new System.Drawing.Point(232, 360);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(75, 29);
			this.button1.TabIndex = 15;
			this.button1.Text = "取消";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// Test_info
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(8, 18);
			this.ClientSize = new System.Drawing.Size(498, 409);
			this.Controls.Add(this.btnnext);
			this.Controls.Add(this.btnbefore);
			this.Controls.Add(this.button1);
			this.Controls.Add(this.btnIncrease);
			this.Controls.Add(this.btnModification);
			this.Controls.Add(this.btndelete);
			this.Controls.Add(this.dataGrid1);
			this.Controls.Add(this.groupBox1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.MaximizeBox = false;
			this.Name = "Test_info";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "課程信息";
			this.Load += new System.EventHandler(this.Test_info_Load);
			this.groupBox1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void Test_info_Load(object sender, System.EventArgs e)
		{
			//			thisAdapter.Fill(mydataset,"test");
			dataGrid1.SetDataBinding(mydataset,"test");
			txtID.DataBindings.Add("text",mydataset,"test.課程編號");
			txtName.DataBindings.Add("text",mydataset,"test.課程名稱");
			bManager = this.BindingContext[mydataset,"test"];
		}

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

		private void btnIncrease_Click(object sender, System.EventArgs e)
		{
			try
			{
				DataTable dt = mydataset.Tables["test"];			
				DataRow newRow = dt.NewRow();
				newRow["課程編號"] = txtID.Text.Trim();			
				newRow["課程名稱"] = txtName.Text.Trim();									
				dt.Rows.Add(newRow);
				thisAdapter.Update(mydataset,"test");
				dt.AcceptChanges();
				MessageBox.Show("你的信息已經被成功的保存到數據庫","恭喜");
				
			}
			catch(Exception e1)
			{
				//					MessageBox.Show("數據庫'用戶名'被占用,本窗體將關閉","出錯");					
				MessageBox.Show(e1.Message);
				this.Close();				
				return;
			}
		}

		private void btndelete_Click(object sender, System.EventArgs e)
		{
			DialogResult result = MessageBox.Show("你是否真的要刪除該項","注意",MessageBoxButtons.YesNo,MessageBoxIcon.Stop);
			if(result == DialogResult.Yes)
			{
				try
				{				
					DataTable dataTable = mydataset.Tables["test"];					
					int c = dataGrid1.CurrentRowIndex;
					dataTable.Rows[c].Delete();
					int nRows = thisAdapter.Update(mydataset,"test");
					mydataset.AcceptChanges();
					dataGrid1.SetDataBinding(mydataset,"test");	
				}
				catch(Exception e1)
				{
					MessageBox.Show(e1.Message);
				}
			}
		}

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

		private void btnModification_Click(object sender, System.EventArgs e)
		{
			try
			{
				SqlConnection thisConnection=new SqlConnection("integrated security=SSPI;data source=.;persist security info=False;initial catalog=Score_mange");
				SqlDataAdapter da = new SqlDataAdapter("update test set Test_name='"+this.txtName.Text.Trim()+"' where Test_Id = '"+this.txtID.Text.Trim()+"'",thisConnection);
				DataSet ds = new DataSet();			
				da.Fill(ds,"test");
				MessageBox.Show("恭喜 ,修改成功");
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}

		private void btnbefore_Click(object sender, System.EventArgs e)
		{
			bManager.Position -=1;	
			
//			if(cmAmend.Position>0)
//			{
//				this.dataGrid1.UnSelect(cmAmend.Position);
//				cmAmend.Position--;
//				this.dataGrid1.Select(cmAmend.Position);
//				this.dataGrid1.CurrentRowIndex=cmAmend.Position;
//			}
//			return;
		}

		private void btnnext_Click(object sender, System.EventArgs e)
		{
			bManager.Position +=1;
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区av电影| 欧美大胆一级视频| 一区二区三区在线观看欧美| 91香蕉视频黄| 亚洲精品欧美综合四区| 在线免费观看日韩欧美| 婷婷中文字幕一区三区| 欧美一二区视频| 国产91色综合久久免费分享| 亚洲欧洲国产日本综合| 欧美亚洲综合另类| 免费成人小视频| 国产精品网曝门| 欧美午夜片在线观看| 精品一区二区三区欧美| 国产精品无人区| 欧美日本国产视频| 国产成人免费视| 亚洲福利视频三区| 国产亚洲精品免费| 91福利在线导航| 久草精品在线观看| 综合久久久久久久| 欧美一级日韩免费不卡| 成人一区二区三区视频在线观看| 一区2区3区在线看| 久久久久久久久久美女| 色菇凉天天综合网| 国产综合色精品一区二区三区| 亚洲欧美日韩综合aⅴ视频| 91精品国产综合久久蜜臀| 成人小视频在线观看| 婷婷一区二区三区| 亚洲丝袜精品丝袜在线| 欧美电影免费观看高清完整版在线观看| 成人美女在线观看| 日本欧美一区二区| 一区二区三区四区不卡在线| 2024国产精品视频| 欧美日本视频在线| 91视频免费看| 国产精品综合一区二区三区| 亚洲成人一二三| 国产精品乱码人人做人人爱| 欧美一区二区三区在线视频 | 91精品国产入口| 成人18精品视频| 九色综合国产一区二区三区| 亚洲美女在线国产| 中文字幕中文乱码欧美一区二区 | 精品国产91洋老外米糕| 欧美专区亚洲专区| 国产精品996| 另类人妖一区二区av| 一区二区三区在线观看视频| 国产精品色婷婷久久58| 精品少妇一区二区三区| 欧美高清一级片在线| 日本二三区不卡| 不卡一区二区三区四区| 国内精品伊人久久久久av影院| 亚洲第一主播视频| 亚洲一区二区三区中文字幕在线| 国产女人18水真多18精品一级做| 久久夜色精品国产噜噜av| 日韩欧美不卡在线观看视频| 日本一区二区在线不卡| 欧美日韩一区二区三区四区| 色综合网色综合| 99久久国产综合色|国产精品| 国产精品18久久久久| 久久99久久99精品免视看婷婷 | 一区二区三区在线免费视频| 日韩毛片在线免费观看| ●精品国产综合乱码久久久久| 国产精品国产自产拍高清av| 中文字幕精品—区二区四季| 久久这里只有精品视频网| 亚洲精品一线二线三线无人区| 精品精品欲导航| 久久久99久久| 国产精品美女久久久久久| 综合激情成人伊人| 亚洲自拍偷拍欧美| 天堂在线一区二区| 蜜桃视频免费观看一区| 久久精品国产第一区二区三区| 另类人妖一区二区av| 国产乱码字幕精品高清av| 国产美女在线精品| 丁香六月综合激情| 色综合久久综合中文综合网| 91福利视频久久久久| 欧美日韩日日骚| 精品日本一线二线三线不卡| 久久久久88色偷偷免费| 国产精品久久久久影院老司| 亚洲免费观看高清完整版在线| 亚洲国产精品久久人人爱蜜臀| 日韩中文字幕区一区有砖一区| 韩国精品在线观看| 99精品视频一区二区三区| 欧美在线综合视频| 欧美成人免费网站| 日韩理论片一区二区| 美女免费视频一区二区| 中文字幕不卡的av| 国产精品素人一区二区| 亚洲三级小视频| 日韩精品色哟哟| 国产精品1区2区3区| 欧美艳星brazzers| wwwwww.欧美系列| 亚洲欧洲制服丝袜| 97精品视频在线观看自产线路二| 亚洲影院理伦片| 肉色丝袜一区二区| 黄色小说综合网站| 欧美日韩五月天| 欧美中文字幕一区| 日韩精品一区在线| 成人午夜精品在线| 日本在线不卡视频一二三区| 国产精品美女久久久久久久| 久久中文娱乐网| 亚洲欧美日韩久久精品| 中文字幕日韩精品一区| 国产精品入口麻豆原神| 中文字幕中文乱码欧美一区二区| 亚洲天堂2014| 亚洲第一精品在线| 另类小说图片综合网| 国产很黄免费观看久久| 91在线视频18| 欧美日韩1区2区| 久久综合色鬼综合色| 国产精品全国免费观看高清| 综合婷婷亚洲小说| 日韩专区在线视频| 国内精品在线播放| 91福利社在线观看| 欧美一区二区三区视频在线| 欧美激情一区二区| 亚洲综合成人在线视频| 免播放器亚洲一区| 不卡一卡二卡三乱码免费网站| 欧洲国产伦久久久久久久| 日韩一区二区三区在线视频| 国产精品情趣视频| 日韩高清不卡在线| 成人激情动漫在线观看| 欧美日韩在线播放| 久久婷婷一区二区三区| 亚洲欧美日韩在线| 激情文学综合插| 在线观看日韩电影| 久久久久久久性| 亚洲成a人v欧美综合天堂| 国产精品性做久久久久久| 91福利视频久久久久| 久久免费的精品国产v∧| 一区二区三区在线观看国产| 久久国产夜色精品鲁鲁99| 99国产精品久久久| 日韩欧美一级特黄在线播放| 亚洲欧洲日韩一区二区三区| 秋霞电影网一区二区| 色悠悠亚洲一区二区| 国产三级一区二区| 日本aⅴ亚洲精品中文乱码| 99精品视频免费在线观看| 日韩精品一区国产麻豆| 亚洲成人av免费| 91网站黄www| 国产日本一区二区| 蜜臀av性久久久久蜜臀aⅴ流畅 | 中文字幕不卡在线播放| 日本色综合中文字幕| 日本丶国产丶欧美色综合| 久久久www免费人成精品| 久久99久久99| 欧美一区二区三区四区五区| 一区二区三区加勒比av| 国产福利一区二区| 精品处破学生在线二十三| 日韩精品电影一区亚洲| 在线观看免费亚洲| 亚洲色图清纯唯美| 成人精品免费看| 亚洲国产高清aⅴ视频| 国产综合久久久久久久久久久久| 777色狠狠一区二区三区| 亚洲一区二区三区美女| 91麻豆国产在线观看| 亚洲欧美国产77777| 99视频精品在线| 最新不卡av在线| 99精品视频在线观看免费| 亚洲免费观看高清完整版在线 | 91精品国产91综合久久蜜臀|