⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 displaytable.cs

📁 排课系统
💻 CS
📖 第 1 页 / 共 3 页
字号:
						//MessageBox.Show("afsasdf");
						//						this.dataGrid1.DataMember = "novaluation";
					}
					catch(Exception e)
					{
						MessageBox.Show(e.Message);
					}
					break;
			}
			conn.Close();
		}
		private string changeTime(string classTime,int weekCent,string No)
		{
			string ct = classTime;
			string strct = "";
			if (ct.Length == 2)
			{
				strct+=ct.Substring(1,1);
				strct+=ct.Substring(0,1);
			}
			classTime = strct;
			strct = "";
			if (ct.Length == 4)
			{
				strct+=ct.Substring(1,1);
				strct+=ct.Substring(0,1);
				strct+=ct.Substring(3,1);
				strct+=ct.Substring(2,1);
			}
			classTime = strct;
			if (weekCent == 2&&classTime.Length == 2)
			{
				switch (classTime)
				{
					case "00":
						this.c00.Text += No;
						return "一1-2";
					case "01":
						this.c01.Text += No;
						return "二1-2";
					case "02":
						this.c02.Text += No;
						return "三1-2";
					case "03":
						this.c03.Text += No;
						return "四1-2";
					case "04":
						this.c04.Text += No;
						return "五1-2";
					case "10":
						this.c10.Text += No;
						return "一3-4";
					case "11":
						this.c11.Text += No;
						return "二3-4";
					case "12":
						this.c12.Text += No;
						return "三3-4";
					case "13":
						this.c13.Text += No;
						return "四3-4";
					case "14":
						this.c14.Text += No;
						return "五3-4";
				}
			}
			if (classTime.Length == 2&&weekCent == 3)
			{
				switch (classTime)
				{
					case "10":
						this.c10.Text += No;
						return "一3-5";
					case "11":
						this.c11.Text += No;
						return "二3-5";
					case "12":
						this.c12.Text += No;
						return "三3-5";
					case "13":
						this.c13.Text += No;
						return "四3-5";
					case "14":
						this.c14.Text += No;
						return "五3-5";
					case "20":
						this.c20.Text += No;
						return "一6-8";
					case "21":
						this.c21.Text += No;
						return "二6-8";
					case "22":
						this.c22.Text += No;
						return "三6-8";
					case "23":
						this.c23.Text += No;
						return "四6-8";
					case "24":
						this.c24.Text += No;
						return "五6-8";
				}
			}
			if (classTime.Length == 4&&weekCent == 5)
			{
				string str5 = "";
				switch (classTime.Substring(0,2))
				{
					case "00":
						this.c00.Text += No;
						str5 = "一1-2";
						break;
					case "01":
						this.c01.Text += No;
						str5 = "二1-2";
						break;
					case "02":
						this.c02.Text += No;
						str5 = "三1-2";
						break;
					case "03":
						this.c03.Text += No;
						str5 = "四1-2";
						break;
					case "04":
						this.c04.Text += No;
						str5 = "五1-2";
						break;
					case "10":
						this.c10.Text += No;
						str5 = "一3-4";
						break;
					case "11":
						this.c11.Text += No;
						str5 = "二3-4";
						break;
					case "12":
						this.c12.Text += No;
						str5 = "三3-4";
						break;
					case "13":
						this.c13.Text += No;
						str5 = "四3-4";
						break;
					case "14":
						this.c14.Text += No;
						str5 = "五3-4";
						break;
				}
				switch (classTime.Substring(2,2))
				{
					case "10":
						this.c10.Text += No;
						str5 += "一3-5";
						break;
					case "11":
						this.c11.Text += No;
						str5 +=  "二3-5";
						break;
					case "12":
						this.c12.Text += No;
						str5 +=  "三3-5";
						break;
					case "13":
						this.c13.Text += No;
						str5 += "四3-5";
						break;
					case "14":
						this.c14.Text += No;
						str5 += "五3-5";
						break;
					case "20":
						this.c20.Text += No;
						str5 += "一6-8";
						break;
					case "21":
						this.c21.Text += No;
						str5 += "二6-8";
						break;
					case "22":
						this.c22.Text += No;
						str5 += "三6-8";
						break;
					case "23":
						this.c23.Text += No;
						str5 +=  "四6-8";
						break;
					case "24":
						this.c24.Text += No;
						str5 += "五6-8";
						break;
				}
				return str5;
			}
			if (classTime.Length == 4&&weekCent == 4)
			{
				string str = "";
				string strTime = "";
				for (int j = 0;j < 2;j++)
				{
					if (j==0)
						strTime = classTime.Substring(0,2);
					if (j==1)
						strTime = classTime.Substring(2,2);
					switch (strTime)
					{
						case "00":
							this.c00.Text += No;
							str+= "一1-2";
							break;
						case "01":
							this.c01.Text += No;
							str+= "二1-2";
							break;
						case "02":
							this.c02.Text += No;
							str+= "三1-2";
							break;
						case "03":
							this.c03.Text += No;
							str+= "四1-2";
							break;
						case "04":
							this.c04.Text += No;
							str+= "五1-2";
							break;
						case "10":
							this.c10.Text += No;
							str+="一3-4";
							break;
						case "11":
							this.c11.Text += No;
							str+= "二3-4";
							break;
						case "12":
							this.c12.Text += No;
							str+= "三3-4";
							break;
						case "13":
							this.c13.Text += No;
							str+= "四3-4";
							break;
						case "14":
							this.c14.Text += No;
							str+= "五3-4";
							break;
					}
				}
				return str;
			}
			if (classTime.Length == 4&&weekCent == 6)
			{
				string str6 = "";
				string strTime6 = "";
				for (int k = 0;k < 2;k++)
				{
					if (k==0)
						strTime6 = classTime.Substring(0,2);
					if (k==1)
						strTime6 = classTime.Substring(2,2);
					switch (strTime6)
					{
						case "10":
							this.c10.Text += No;
							str6+= "一3-5";
							break;
						case "11":
							this.c11.Text += No;
							str6+= "二3-5";
							break;
						case "12":
							this.c12.Text += No;
							str6+= "三3-5";
							break;
						case "13":
							this.c13.Text += No;
							str6+= "四3-5";
							break;
						case "14":
							this.c14.Text += No;
							str6+= "五3-5";
							break;
						case "20":
							this.c20.Text += No;
							str6+="一6-8";
							break;
						case "21":
							this.c21.Text += No;
							str6+= "二6-8";
							break;
						case "22":
							this.c22.Text += No;
							str6+= "三6-8";
							break;
						case "23":
							this.c23.Text += No;
							str6+= "四3-4";
							break;
						case "24":
							this.c24.Text += No;
							str6+= "五6-8";
							break;
					}
				}
				return str6;
			}
			return ct;
		}
		private string rTeacherName(string teacherNo)
		{
			Connection c = new Connection();
			string str = "";
			SqlConnection conn = new SqlConnection(c.getConnectionString);
			conn.Open();
			string str1 = "select * from teacher";
			SqlCommand cmd = new SqlCommand(str1,conn);
			SqlDataReader dr = cmd.ExecuteReader();
			while (dr.Read())
			{
				if (teacherNo == Convert.ToString(dr["teacherNo"]))
				{
					str = Convert.ToString(dr["teacherName"]);
					break;
				}
			}
			dr.Close();
			conn.Close();
			return str;
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -