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

📄 grd_mis_4.cs

📁 一个研究生管理系统 具体的情况自己看了
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using PersistenceLayer;
using BusinessEntity;
/// <summary>
/// grd_MIS_4 的摘要说明
/// </summary>
namespace grd_MIS
{
    public partial class manager
    {
		//
		// TODO: 在此处添加构造函数逻辑
		//
        public static DataTable GetData_TeaPracApplyID_Term(int term)
        {
            //UndergraduateCourse,TeachPracApply,StudentInfo三表联合查询
            //UndergraduateCourse.Term=term
            //返回的datatable包含字段StuID,stuname,CourseName,Teacher,IsChecked,TeacherPhone
            DataTable dt = new DataTable();
            string sqlString = "SELECT StuID,StuName,CourseName,Teacher,IsChecked,TeacherPhone FROM StudentInfo,TeachPracApply,UndergraduateCourse where (StudentInfo.StuID=TeachPracApply.StuID) and(TeachPracApply.UnderCourseID=UndergraduateCourse.UnderCourseID) and UndergraduateCourse.Term="+term.ToString();
            try
            {
                dt = Query.ProcessSql(sqlString, "GradMIS_Data");
                return dt;
            }
            catch
            {
                return null;
            }
          
        }
        public static DataTable GetData_RestStudyList_Trem(int trem)
        {
            //StudentInfo,RestStudyList,ReStudyCourse三表联合查询
            //ReStudyCourse.Term=term
            //返回的datatable包含字段StuID,stuname,CourseName,Teacher,IsChecked
           // return null;
            DataTable dt = new DataTable();
            string sqlString = "SELECT StuID,StuName,CourseName,Teacher,IsChecked FROM StudentInfo,RestStudyList,ReStudyCourse where (StudentInfo.StuID=RestStudyList.StuID) and (RestStudyList.ReStudyCourseID=ReStudyCourse.ReStudyCourseID) and ReStudyCourse.Term=" + trem.ToString(); ;
            try
            {
                dt = Query.ProcessSql(sqlString, "GradMIS_Data");
                return dt;
            }
            catch
            {
                return null;
            }
        }
        public static DataTable GetData_StudentInfo_AllEnable()
        {
            // 返回学生表里面IsGraduate=0的学生信息
            //返回的信息包括 StuID,StuName,EntranceTime,PrimTeachPhone,Address
            DataTable dt = new DataTable();
            string sqlString = "SELECT StuID,StuName,EntranceTime,PrimTeachPhone,Address FROM StudentInfo";
            try
            {
                dt = Query.ProcessSql(sqlString, "GradMIS_Data");
                return dt;
            }
            catch
            {
                return null;
            }

           
 
        }
        public static DataTable GetData_SqlExec(String str)
        {
            //执行SQL语句str并返回结果
            return Query.ProcessSql(str, "GradMIS_Data");
        }
        public static DataTable GetData_SpvInfo()
        {
            //返回SpvInfo表所有信息
            //return null;
            RetrieveCriteria aa = new RetrieveCriteria(typeof(SpvInfoEntity));
            aa.OrderBy(SpvInfoEntity.__SPVID, false);
            try
            {
                return aa.AsDataTable();
            }
                catch
            {
                return null;
             }
        }
        public static bool AddData_SpvInfo(String SpvID, String SpvName, String SpvType, String SpvGender, int IsDoctor)
        {//向SpvInfo表插入一条信息;
            //return true;
            SpvInfoEntity sp = new SpvInfoEntity();
            sp.IsDoctor = IsDoctor;
            sp.SpvID = SpvID;
            sp.SpvName = SpvName;
            sp.SpvType = SpvType;
            sp.SpvGender = SpvGender;
            try
            {
                sp.Save();
                return true;
            }
            catch
            {
                return false;
            }
 
        }
        public static bool DelData_SpvInfo_SpvID(String SpvID)
        {
            //删除SpvInfo表一条记录
            //return true;
            SpvInfoEntity sp=new SpvInfoEntity();
            sp.SpvID = SpvID;
            try
            {
                sp.Retrieve();
                if (sp.IsPersistent)
                {
                    sp.Delete();
                    return true;

                }
            }
            catch
            {}
            return false;
        }
        public static bool DelData_StudentInfo(String StuID)
        {
            //删除StudentInfo表的一条记录
            //return true;
            StudentInfoEntity stu = new StudentInfoEntity();
            stu.StuID = StuID;
            try
            {
                stu.Retrieve();
                if (stu.IsPersistent)
                {
                    stu.Delete();
                    return true;
                }
            }
            catch
            { }
            return false;
        }
	}
}

⌨️ 快捷键说明

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