st_course.cs

来自「本人上传的一个在线选课系统,希望能供编程爱好借鉴」· CS 代码 · 共 70 行

CS
70
字号
using System;
using STGROUP.ST_CourseBiz;
using System.Data;
using Microsoft.ApplicationBlocks.Data;

namespace STGROUP.ST_CourseBiz
{
	/// <summary>
	/// ST_Course 的摘要说明。
	/// </summary>
	public class ST_Course
	{
		string st_SqlString = System.Configuration.ConfigurationSettings.AppSettings["ConnString"];
		public ST_Course()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		/// <summary>
		/// 插入课程基本信息
		/// </summary>
		/// <param name="st_StuInfo"></param>
		public void ST_InsertCourseInfo(string st_CourseName, int st_TeacherID, string st_CourseDes, int st_MajorID)
		{
			string sqlString = "insert ST_CourseInfo(ST_CourseName,ST_TeacherID,ST_CourseDes,ST_MajorID) values('"+st_CourseName+"',"+st_TeacherID+",'"+st_CourseDes+"',"+st_MajorID+");";
			SqlHelper.ExecuteNonQuery(st_SqlString, CommandType.Text, sqlString);
		}

		/// <summary>
		/// 修改课程基本信息
		/// </summary>
		/// <param name="st_StuInfo"></param>
		public void ST_UpdateCourseInfo(string st_CourseName, int st_TeacherID, string st_CourseDes, int st_MajorID,int st_CourseID)
		{
			string sqlString = "update ST_CourseInfo set ST_CourseName='"+st_CourseName+"',st_TeacherID='"+st_TeacherID+"',st_CourseDes='"+st_CourseDes+"',st_MajorID="+st_MajorID+" where ST_CourseID="+st_CourseID;
			SqlHelper.ExecuteNonQuery(st_SqlString, CommandType.Text, sqlString);
		}
		/// <summary>
		/// 删除课程的记录
		/// </summary>
		/// <param name="st_TeacherID"></param>
		public void ST_DeleteCourseInfo(int st_CourseID)
		{
			string sqlString = "update ST_CourseInfo set ST_IsDeleted=1 where st_CourseID="+st_CourseID;
			SqlHelper.ExecuteNonQuery(st_SqlString, CommandType.Text, sqlString);
		}
		/// <summary>
		/// 取得一个课程的信息
		/// </summary>
		/// <param name="ST_DeptID"></param>
		/// <returns></returns>
		public DataSet ST_GetCourseInfo(int ST_CourseID)
		{
			string sqlString = "select * from ST_CourseInfo sci inner join ST_TeacherInfo sti on sci.ST_TeacherID=sti.ST_TeacherID inner join ST_MajorInfo smi on sci.ST_MajorID=smi.ST_MajorID where sci.ST_IsDeleted=0 and sti.ST_IsDeleted=0 and smi.ST_IsDeleted=0 and ST_CourseID="+ST_CourseID;
			return SqlHelper.ExecuteDataset(st_SqlString, CommandType.Text, sqlString);
		}
		/// <summary>
		/// 取得课程的信息
		/// </summary>
		/// <param name="ST_DeptID"></param>
		/// <returns></returns>
		public DataSet ST_GetAllCourseInfo()
		{
			string sqlString = "select * from ST_CourseInfo sci inner join ST_TeacherInfo sti on sci.ST_TeacherID=sti.ST_TeacherID inner join ST_MajorInfo smi on sci.ST_MajorID=smi.ST_MajorID where sci.ST_IsDeleted=0 and sti.ST_IsDeleted=0 and smi.ST_IsDeleted=0";
			return SqlHelper.ExecuteDataset(st_SqlString, CommandType.Text, sqlString);
		}
	}
}

⌨️ 快捷键说明

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