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

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

?? 主界面.cs

?? 管理學院機房計費系統,VISUAL STUDIO .NET 2003 c# 語言實現,SQL SERVER 2000數據庫. 現運行正常.
?? CS
?? 第 1 頁 / 共 5 頁
字號:
		private void groupBox2_Enter(object sender, System.EventArgs e)
		{
		
		}
	
		private void textBox1_TextChanged(object sender, System.EventArgs e)
		{

		}

	
		private void shangji()
		{
			//判斷機房是否為滿狀態
			string strJfNumber=htComputerNum[this.comboBox1.Text].ToString();			
			if(this.SjNum(this.comboBox1.Text)>=int.Parse(strJfNumber))
			{
				MessageBox.Show("本機房已滿,不能上機!","計費系統",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
				goto shangjiFinish;
			}

			this.textBox6.Clear();
			now=DateTime.Now;
			String sql1="insert into 流水帳表 (條形碼,上機時間,上機狀態,上機區域,值班教師) values('"+ this.textBox1.Text +"','"+ now.ToString() +"','1','"+ this.comboBox1.Text +"','"+ frmMain.strTeacher +"')";
			SqlCommand cmd=new SqlCommand(sql1,this.sqlConnection1);
			this.sqlConnection1.Open();
			numAff=cmd.ExecuteNonQuery();
			if(numAff==1)
				MessageBox.Show("開始計時!","上機",MessageBoxButtons.OK,MessageBoxIcon.Information);
			this.sqlConnection1.Close();
			
			this.textBox1.SelectAll();
			shangjiFinish:;
		}

		private void xiaji()
		{
			String strPrice;
			float floPrice;
			int i=this.comboBox1.SelectedIndex;
			
			//獲取上機區域
			String sqlSjqy="select 上機區域 from 流水帳表 where 條形碼='"+ this.textBox1.Text +"' and 上機狀態='1'";
			SqlCommand cmdSjqy=new SqlCommand(sqlSjqy,this.sqlConnection1);
			this.sqlConnection1.Open();
			SqlDataReader readerSjqy=cmdSjqy.ExecuteReader();
			readerSjqy.Read();
			string strSjqy=readerSjqy.GetString(0);
			readerSjqy.Close();
			this.sqlConnection1.Close();

			this.comboBox1.SelectedIndex=this.comboBox1.FindString(strSjqy);
			strPrice=this.comboBox1.SelectedValue.ToString();
			this.comboBox1.SelectedIndex=i;
			floPrice=float.Parse(strPrice);
			String strMsg;
			String barCode=this.textBox1.Text;
			String sql1="select * from 流水帳表 where 條形碼='"+ this.textBox1.Text +"' and 上機狀態='1'";
			Decimal bal=Decimal.Parse(this.textBox4.Text); //余額
			Decimal cost;//花費
			
			SqlCommand cmd=new SqlCommand(sql1,this.sqlConnection1);
			this.sqlConnection1.Open();
			SqlDataReader reader1=cmd.ExecuteReader();
			if(reader1.Read())
			{
				timeSj=reader1.GetDateTime(2);
			}
			reader1.Close();
			this.sqlConnection1.Close();
			timeXj=DateTime.Now;
			TimeSpan ts=timeXj-timeSj;
			
			//計算花費
			float cost1=float.Parse(ts.Minutes.ToString())*floPrice/60+float.Parse(ts.Hours.ToString())*floPrice+float.Parse(ts.Days.ToString())*floPrice*24;
			cost=(Decimal)cost1;  
			int intStrHours=ts.Days*24+ts.Hours;

			//提示信息
			strMsg="上機"+ intStrHours.ToString() +"小時"+ ts.Minutes.ToString() +"分鐘,花費"+cost.ToString()+"元。";
			
			//計算余額
			bal=Decimal.Parse(this.textBox4.Text)-cost;
			
			//更新流水帳表
			sql1="update 流水帳表 set 下機時間='"+ timeXj.ToString() +"',花費='"+ cost.ToString() +"',上機狀態='0' where 條形碼='"+ this.textBox1.Text +"' and 上機狀態='1'";
			SqlCommand cmd1=new SqlCommand(sql1,this.sqlConnection1);
			this.sqlConnection1.Open();
			cmd1.ExecuteNonQuery();
			this.sqlConnection1.Close();
			
			//更新帳戶表
			sql1="update 帳戶表 set 余額='"+ bal.ToString() +"'where 條形碼='"+ barCode +"'";
			SqlCommand cmd2=new SqlCommand(sql1,this.sqlConnection1);
			this.sqlConnection1.Open();
			cmd2.ExecuteNonQuery();
			this.sqlConnection1.Close();

			//更新主界面
			this.textBox4.Text=bal.ToString();
			this.textBox6.Text=cost.ToString();
			
			//余額不足者,鎖定
			if(bal<=0)
			{
				sql1="update 帳戶表 set 鎖定='1' where 條形碼='"+ barCode +"'";
				SqlCommand cmd3=new SqlCommand(sql1,this.sqlConnection1);
				this.sqlConnection1.Open();
				cmd3.ExecuteNonQuery();
				this.sqlConnection1.Close();
				strMsg+="余額不足,賬戶鎖定!";
			}
			
			//提示信息框
			MessageBox.Show(strMsg,"下機",MessageBoxButtons.OK,MessageBoxIcon.Information);

			//激活textBox1
			this.textBox1.Focus();
			this.textBox1.SelectAll();
		}

		private bool sjzt()
		{
			//返回上機人的狀態
			bool m;
			String sql1="select * from 流水帳表 where 條形碼='"+ this.textBox1.Text +"' and 上機狀態='1'";
			SqlCommand cmd=new SqlCommand(sql1,this.sqlConnection1);
			this.sqlConnection1.Open();
			SqlDataReader reader1=cmd.ExecuteReader();
			m=reader1.Read();
			reader1.Close();
			this.sqlConnection1.Close();
			if(m)
			{
				return true;
			}
			else
			{
				return false;
			}
			
		}

		private void button6_Click(object sender, System.EventArgs e)
		{
			this.textBox1.Focus();
			 DialogResult result=MessageBox.Show("確定要全部下機嗎?","集體下機",MessageBoxButtons.OKCancel,MessageBoxIcon.Question);
			if(result==DialogResult.Cancel)
			{
				goto finish;
			}
			//取操作時間,以此時間為下機時間
			string strJtxjMsg="%下機統計%\n";
			//打開上機流水表
			string sqlJtxj="select 條形碼 from 流水帳表 where 上機狀態=1 and 上機區域='"+ this.comboBox1.Text +"'";
			SqlCommand cmdJtxj=new SqlCommand(sqlJtxj,this.sqlConnection2);
			this.sqlConnection2.Open();
			SqlDataReader rdJtxj=cmdJtxj.ExecuteReader();
			try
			{
				while(rdJtxj.Read())
				{
					//對每一條記錄實施下機操作
					DateTime dtNow=DateTime.Now;
					string stuBarcode=rdJtxj.GetString(0);
					strJtxjMsg+=this.Jtxj(dtNow,stuBarcode);
					strJtxjMsg+="\n";
					
				}
				if(strJtxjMsg=="%下機統計%\n")
					strJtxjMsg="機房已空!";
			}
			catch(SqlException exe)
			{
				MessageBox.Show("意外中斷,請管理員處理!");
				this.sqlConnection2.Close();
			}
			finally
			{
				rdJtxj.Close();
				this.sqlConnection2.Close();
				MessageBox.Show(strJtxjMsg,"計費系統",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
			finish:;

		}

		private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if(e.KeyChar == (char)13)
			{
				bool i;//判斷用戶是否處于鎖定狀態
				sql="select * from 帳戶表 where 條形碼='"+ this.textBox1.Text +"'";
				SqlCommand cmd=new SqlCommand(sql,this.sqlConnection1);
				this.sqlConnection1.Open();
				SqlDataReader reader=cmd.ExecuteReader();
			
				try
				{
					if(reader.Read())
					{
					
						this.textBox2.Text=reader.GetString(1);
						this.textBox3.Text=reader.GetString(2);
						this.balance=(Decimal)reader.GetSqlDecimal(3);
						this.textBox4.Text=this.balance.ToString();
						i=reader.GetBoolean(4);
					}

					else
					{
						reader.Close();
						this.sqlConnection1.Close();
						MessageBox.Show("無此用戶,請開戶!","計費系統",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
						goto Finish;
					}
				}
				catch(SqlException exe)
				{
					MessageBox.Show("數據庫出現錯誤!","計費系統",MessageBoxButtons.OK,MessageBoxIcon.Error);
					reader.Close();
					this.sqlConnection1.Close();
					goto Finish;
				}
				finally
				{
					reader.Close();
					this.sqlConnection1.Close();
				}
		
				//string strJfNumber=htComputerNum[this.comboBox1.Text].ToString();			
				//if(this.SjNum(this.comboBox1.Text)>=int.Parse(strJfNumber))
				//{
				//	MessageBox.Show("本機房已滿,不能上機!","計費系統",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
				//	goto Finish;
				//}
				if(i==false)//判斷是否被鎖定
				{
					//計費模塊
					if(this.sjzt())
					{
						//下機
						this.xiaji();
					}
					else
					{
						//上機
						this.shangji();
					}
				}
					
				else
				{
					MessageBox.Show("用戶鎖定,不能上機!","計費系統",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
					goto Finish;
						
				}
			Finish:this.textBox1.Clear();
				this.textBox1.SelectAll();
				this.label15.Text=numDqrs(this.comboBox1.Text);
				this.label16.Text=numLjrs(this.comboBox1.Text);
			}
		}

		private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			//strCurRoom=this.comboBox1.Text;
			this.textBox1.Focus();
			this.textBox1.SelectAll();
			this.label16.Text=numLjrs(this.comboBox1.Text);
			this.label15.Text=numDqrs(this.comboBox1.Text);
		}
	
		public string Jtxj(DateTime dt,string StuBarcode)//下機操作,本程序中被集體下機按鈕調用
		{
			DateTime timeXj=dt;
			String strPrice;
			float floPrice;
			strPrice=this.comboBox1.SelectedValue.ToString();
			floPrice=float.Parse(strPrice);
			String strMsg=StuBarcode+" ";
			String barCode=StuBarcode;
			Decimal bal=0; //余額
			Decimal cost=0;//花費

			//讀出帳戶余額
			String sql1="select 余額,姓名 from 帳戶表 where 條形碼='"+ barCode +"'";
			SqlCommand cmd0=new SqlCommand(sql1,this.sqlConnection1);
			this.sqlConnection1.Open();
			SqlDataReader reader0=cmd0.ExecuteReader();
			reader0.Read();
			bal=(Decimal)reader0.GetSqlDecimal(0);
			strMsg+=reader0.GetString(1);
			reader0.Close();
			this.sqlConnection1.Close();
		
			//讀出上機時間,計算時間差
			sql1="select * from 流水帳表 where 條形碼='"+ barCode +"' and 上機狀態='1'";
			SqlCommand cmd=new SqlCommand(sql1,this.sqlConnection1);
			this.sqlConnection1.Open();
			SqlDataReader reader1=cmd.ExecuteReader();
			if(reader1.Read())
			{
				timeSj=reader1.GetDateTime(2);
				//MessageBox.Show(timeSj.ToString());
			}
			reader1.Close();
			this.sqlConnection1.Close();
			TimeSpan ts=timeXj-timeSj;
			
			//計算花費
			float cost1=float.Parse(ts.Minutes.ToString())*floPrice/60+float.Parse(ts.Hours.ToString())*floPrice+float.Parse(ts.Days.ToString())*floPrice*24;
			cost=(Decimal)cost1;  
			
			int intSjHour=ts.Days*24+ts.Hours;
			//提示信息
			strMsg+="上機"+intSjHour.ToString()+"小時"+ ts.Minutes.ToString() +"分鐘,花費"+cost.ToString()+"元 ";
			
			//計算余額
			bal=bal-cost;
			
			//更新流水帳表
			sql1="update 流水帳表 set 下機時間='"+ timeXj.ToString() +"',花費='"+ cost.ToString() +"',上機狀態='0' where 條形碼='"+ barCode +"' and 上機狀態='1'";
			//sql1="update 流水帳表 set 下機時間 ='"+ timeXj.ToString() +"',上機狀態='0' where 條形碼='"+ barCode +"' and 上機狀態='1'";
			//MessageBox.Show(sql1);
			SqlCommand cmd1=new SqlCommand(sql1,this.sqlConnection1);
			this.sqlConnection1.Open();
			cmd1.ExecuteNonQuery();
			this.sqlConnection1.Close();
			
			//更新帳戶表
			sql1="update 帳戶表 set 余額='"+ bal.ToString() +"'where 條形碼='"+ barCode +"'";
			SqlCommand cmd2=new SqlCommand(sql1,this.sqlConnection1);
			this.sqlConnection1.Open();
			cmd2.ExecuteNonQuery();
			this.sqlConnection1.Close();
			
			//余額不足者,鎖定
			if(bal<=0)
			{
				sql1="update 帳戶表 set 鎖定='1' where 條形碼='"+ barCode +"'";
				SqlCommand cmd3=new SqlCommand(sql1,this.sqlConnection1);
				this.sqlConnection1.Open();
				cmd3.ExecuteNonQuery();
				this.sqlConnection1.Close();
				strMsg+="余額不足,賬戶鎖定!";
			}
			
			//提示信息框
			//MessageBox.Show(strMsg,"下機",MessageBoxButtons.OK,MessageBoxIcon.Information);

			return strMsg;
		}
	
	

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲麻豆国产自偷在线| 国产精品短视频| 欧美自拍偷拍一区| 99re这里只有精品视频首页| 国产综合一区二区| 国产精品99精品久久免费| 免费在线观看日韩欧美| 精一区二区三区| 国产在线精品视频| 国产精品一区二区在线播放| 国产成人精品亚洲日本在线桃色| 国产原创一区二区| 成人一区二区三区在线观看| 丁香婷婷综合激情五月色| 成人精品小蝌蚪| 91免费视频观看| 538在线一区二区精品国产| 日韩天堂在线观看| 国产性天天综合网| 一区二区三区四区乱视频| 午夜精品福利一区二区蜜股av| 午夜精品视频一区| 国产精品一卡二| 337p亚洲精品色噜噜狠狠| 欧美一区二区久久久| 日韩欧美第一区| 国产精品免费av| 亚洲成va人在线观看| 韩国三级中文字幕hd久久精品| 99re视频这里只有精品| 欧美日本韩国一区二区三区视频| 欧美一级理论片| 亚洲人亚洲人成电影网站色| 日韩黄色免费电影| av激情综合网| 日韩女优制服丝袜电影| 亚洲黄色av一区| 国产尤物一区二区在线| 欧美三级一区二区| 国产精品久久久久永久免费观看 | 日韩欧美二区三区| 中文字幕一区二区三区在线播放 | 日韩视频在线你懂得| 国产精品毛片无遮挡高清| 亚洲影院在线观看| 国产.精品.日韩.另类.中文.在线.播放| 91亚洲永久精品| 精品国产一区二区三区av性色| 亚洲欧美成人一区二区三区| 国产一区在线观看视频| 欧美日韩精品专区| 亚洲色图一区二区| 成人免费毛片嘿嘿连载视频| 日韩一级黄色片| 免费观看一级欧美片| 91天堂素人约啪| 国产调教视频一区| 国产一区二区三区黄视频| 欧美日韩国产美| 亚洲小说欧美激情另类| 91免费版在线| 亚洲免费伊人电影| 91捆绑美女网站| 亚洲视频小说图片| 本田岬高潮一区二区三区| 久久噜噜亚洲综合| 国产精品一级二级三级| 精品国产一区久久| 国产毛片精品一区| 精品国产伦一区二区三区观看体验| 一区二区三区日韩| 欧美在线视频日韩| 亚洲国产色一区| 在线观看国产一区二区| 亚洲高清免费视频| 欧美日本国产视频| 久热成人在线视频| 日韩精品中文字幕一区二区三区 | 亚洲一区在线免费观看| 色偷偷久久人人79超碰人人澡| 中文字幕在线观看一区二区| 成人一区二区视频| 亚洲欧美怡红院| 日本福利一区二区| 亚洲国产成人av网| 欧美电影免费观看高清完整版在 | 国产精品毛片无遮挡高清| av成人动漫在线观看| 亚洲天堂av老司机| 欧美精品三级日韩久久| 精品制服美女丁香| 中文字幕亚洲综合久久菠萝蜜| 一本久道久久综合中文字幕| 亚洲国产精品影院| 欧美α欧美αv大片| 成人av在线播放网址| 亚洲色图视频网| 91精品欧美福利在线观看| 国产在线精品一区二区| 亚洲特级片在线| 欧美一区在线视频| 国产成人啪免费观看软件| 一区二区三区精品视频在线| 欧美一区二区三区免费| 99久久精品国产导航| 天天色综合天天| 国产精品久久久久一区| 在线不卡欧美精品一区二区三区| 精品亚洲国产成人av制服丝袜| 一区在线播放视频| 欧美精品第一页| 成人网在线免费视频| 午夜精品福利一区二区三区av| 久久精品水蜜桃av综合天堂| 97se亚洲国产综合自在线观| 亚洲6080在线| 亚洲欧美综合网| 欧美精品一区二区高清在线观看| 色先锋久久av资源部| 国产成人综合视频| 免费成人性网站| 亚洲精选一二三| 国产婷婷色一区二区三区四区| 欧美人狂配大交3d怪物一区| 成人av网站在线观看免费| 久久精品av麻豆的观看方式| 国产99一区视频免费 | 精品一区二区在线免费观看| 亚洲精品国产a| 日本一区二区动态图| 欧美不卡一区二区三区| 欧美日韩黄色一区二区| 91网站在线播放| 波多野结衣亚洲一区| 国产91在线|亚洲| 国产在线播放一区| 日本视频在线一区| 亚洲大片在线观看| 亚洲乱码中文字幕| 中文字幕一区免费在线观看| 久久免费午夜影院| 精品日韩一区二区三区免费视频| 欧美巨大另类极品videosbest| 色婷婷综合久久久中文字幕| 9色porny自拍视频一区二区| 丰满少妇久久久久久久| 国产精品一品二品| 国产成人综合在线| 国产伦精品一区二区三区免费 | 欧洲av在线精品| 91网站视频在线观看| 91麻豆国产精品久久| 99久久婷婷国产精品综合| 国产98色在线|日韩| 不卡av电影在线播放| 国产精品18久久久久久久久| 国产精品一区二区在线观看网站| 国产一区二区在线观看视频| 日韩av不卡在线观看| 麻豆一区二区在线| 久久99精品国产麻豆不卡| 国产自产v一区二区三区c| 国产精品一级黄| 91丨porny丨国产| 色94色欧美sute亚洲线路一ni | 成人免费小视频| 亚洲视频电影在线| 亚洲午夜久久久| 久久99国产精品成人| 成人av网址在线观看| 欧美亚洲一区二区在线| 欧美一级欧美一级在线播放| 久久久蜜臀国产一区二区| 中文字幕在线不卡一区二区三区| 亚洲综合色婷婷| 麻豆91在线播放免费| 国产91清纯白嫩初高中在线观看| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 男女性色大片免费观看一区二区 | 国产女人水真多18毛片18精品视频| 久久一区二区三区四区| 日韩理论片网站| 久久精品国产精品亚洲综合| 成人激情黄色小说| 在线综合亚洲欧美在线视频| 亚洲精品在线观看视频| 亚洲免费观看高清在线观看| 视频一区中文字幕| 成人午夜免费av| 91麻豆精品久久久久蜜臀| 欧美国产一区二区| 日韩福利电影在线观看| 成人看片黄a免费看在线| 欧美精品色一区二区三区| 国产区在线观看成人精品| 亚洲成人动漫在线免费观看| 国产成人久久精品77777最新版本| 欧洲精品在线观看| 国产精品美女久久久久av爽李琼 | av一二三不卡影片|