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

📄 student.cs

📁 一个研究生管理系统 具体的情况自己看了
💻 CS
📖 第 1 页 / 共 2 页
字号:
                if (ExcellInfo != null)
                {
                    ExcellInfoName = ExcellInfo.ExcellenceName;
                    return ExcellInfoName;

                }

            return "";
        }
        public static bool IsExcellenceApplyed(string  StuID,int ExcellenceInfoID)//成功
        {
            //通过学生的学号:StuID
            //和争先评优的编号:ExcellenceInfoID
            //来查找是否该学生已经申请过争先评优
            //return true;表示已经申请了。
            //return false;表示尚未申请;
            RetrieveCriteria rc = new RetrieveCriteria(typeof(ExcellAppEntity));
            Condition c = rc.GetNewCondition();
            c.AddEqualTo(ExcellAppEntity.__EXCELLENCEINFOID, ExcellenceInfoID);
            c.AddEqualTo(ExcellAppEntity.__STUID, StuID);
            DataTable ExcellenceApplyedTable = rc.AsDataTable();
            if (ExcellenceApplyedTable.Rows.Count > 0)
            {
                return true;
            }

            return false;
        }
        public static bool UpdateExcellenceApp(string  StuID, int ExcellenceInfoID, string ExcellenceResume,string FileName)//成功
        {
            //根据学生的学号:StuID和争先评优编号:ExcellenceInfoID
            //来修改ExcellApp 表中的ExcellenceResume字段为ExcellenceResume;
            //学生的个人简历上传文件FileName;
            //return true;//表示修改成功
           // return false;//表示修改失败
            UpdateCriteria up = new UpdateCriteria(typeof(ExcellAppEntity));
            Condition c = up.GetNewCondition();
            c.AddEqualTo(ExcellAppEntity.__EXCELLENCEINFOID, ExcellenceInfoID);
            c.AddEqualTo(ExcellAppEntity.__STUID, StuID);
            up.AddAttributeForUpdate(ExcellAppEntity.__EXCELLENCERESUME, ExcellenceResume);
            up.AddAttributeForUpdate(ExcellAppEntity.__FILENAME, FileName);
            try
            {
                up.Perform();
                return true;   //表示修改成功

            }
            catch
            {

                return false;      //表示修改失败

            }
            return false; 
            

        }
        public static bool IsExcellenceAppChecked(string  StuID,int ExcellenceInfoID)//成功
        {
            //根据学生的学号:StuID和争先评优编号:ExcellenceInfoID
            //来决定是否正在进行评审
            //用来决定是否可以修改已经提交的申请,如果可以,return false,否则返回 return true;
           // return false;
            RetrieveCriteria rc = new RetrieveCriteria(typeof(ExcellAppEntity));
            Condition c = rc.GetNewCondition();
            c.AddEqualTo(ExcellAppEntity.__EXCELLENCEINFOID, ExcellenceInfoID);
            c.AddEqualTo(ExcellAppEntity.__STUID, StuID);
            ExcellAppEntity ExcellenceApply = (ExcellAppEntity)rc.AsEntity();
            if (ExcellenceApply != null)
            {
                if (ExcellenceApply.IsChecked != 0)
                    return true;
            }

            return false;



        }
        public static DataTable GetRewordInfo()//成功
        {
            //所返回的信息必须是可以 实际进行评定的。
            //返回所有的详细信息,DataTable必须包含以下个项;
            /*
             * 单项奖学金编号	ScholarshipInfoID
               单项奖学金名称	ScholarshipName
             * 单项奖学金文件   FileName
               单项奖学金金额	ScholarshipMoney
               备注	Remark

             * */
            RetrieveCriteria rc = new RetrieveCriteria(typeof(ScholarInfoEntity));//成功
            rc.AddSelect(ScholarInfoEntity.__SCHOLARSHIPINFOID);
            rc.AddSelect(ScholarInfoEntity.__SCHOLARSHIPNAME);
            rc.AddSelect(ScholarInfoEntity.__SCHOLARSHIPMONEY);
            rc.AddSelect(ScholarInfoEntity.__FILENAME);
            rc.AddSelect(ScholarInfoEntity.__REMARK);
            DataTable scholarTable = rc.AsDataTable();
            if (scholarTable.Rows.Count > 0)
            {
                return scholarTable;
            }
            return null;
        }
        public static string GetScholarshipInfoName(int ScholarshipInfoID)//失败
        {
            //根据奖学金编号返回奖学金名称
            /*
             *   ScholarshipInfoID    int                  not null,
                 ScholarshipName      char(10)             null,
             * */
            string ScholarshipName;
            RetrieveCriteria rc = new RetrieveCriteria(typeof(ScholarInfoEntity));
            Condition cd = rc.GetNewCondition();
            cd.AddEqualTo(ScholarInfoEntity.__SCHOLARSHIPINFOID, ScholarshipInfoID);
            //rc.AddSelect(ScholarInfoEntity.__SCHOLARSHIPNAME);
            ScholarInfoEntity schEty = (ScholarInfoEntity)rc.AsEntity();
            if (schEty != null)
            {
                ScholarshipName = schEty.ScholarshipName;
                return ScholarshipName;
            }
            return null;//返回值是该奖学金的名称

        }
        public static bool IsScholarshipApplyed(string  StuID, int ScholarshipInfoID)
        {
            //根据学生的学号:StuID和奖学金编号:ScholarshipInfoID
            //来查找是否该学生已经申请过该奖学金
            //return true;表示已经申请了。
            //return false;表示尚未申请;

            RetrieveCriteria rc = new RetrieveCriteria(typeof(ScholarAppEntity));
            Condition cd = rc.GetNewCondition();
            cd.AddEqualTo(ScholarAppEntity.__STUID, StuID);
            cd.AddEqualTo(ScholarAppEntity.__SCHOLARSHIPINFOID, ScholarshipInfoID);
            DataTable dt = rc.AsDataTable();
            if (dt.Rows.Count > 0)
            {
                return true;
            }
            return false;

        }
        public static bool SetScholarshipApp(string  StuID, int ScholarshipInfoID, string ScholarshipResume, string FileName)
        {
            /*如果成功返回true,否则返回false
             * 
             * 学号	StuID
               奖学金编号	ScholarshipInfoID
               奖学金个人简历	ScholarshipResume
             * 奖学金个人简历上传 FileName
               将这几项写到数据库中。
             * */


            ScholarAppEntity schEty = new ScholarAppEntity();
            schEty.StuID = StuID;
            schEty.ScholarshipInfoID = ScholarshipInfoID;
            schEty.ScholarshipResume = ScholarshipResume;
            schEty.FileName = FileName;
            if (schEty.Save() != 0)
            {
                return true;//提交申请成功
            }

            return false;//提交申请失败
            //return true;//提交申请成功
        }
        public static bool IsScholarshipAppChecked(string  StuID, int ScholarshipInfoID)
        {
            //根据学生的学号:StuID和奖学金编号:ScholarshipInfoID
            //来决定是否正在进行评审
            
            //用来决定是否可以修改已经提交的申请,如果可以,return false,否则返回 return true;
            int isChecked;
            RetrieveCriteria rc = new RetrieveCriteria(typeof(ScholarAppEntity));
            Condition cd = rc.GetNewCondition();
            cd.AddEqualTo(ScholarAppEntity.__STUID, StuID);
            cd.AddEqualTo(ScholarAppEntity.__SCHOLARSHIPINFOID, ScholarshipInfoID);

            ScholarAppEntity se = (ScholarAppEntity)rc.AsEntity();
            if (se != null)
            {
                isChecked = se.IsChecked;
                if (isChecked == 1)
                    return true;//已审核,不能修改
            }
            return false;//未审核,可以修改


        }
        public static bool UpdateScholarshipApp(string  StuID, int ScholarshipInfoID, string ScholarshipResume,string FileName)
        {
            //根据学生的学号:StuID和奖学金编号:ScholarshipInfoID
            //来修改ScholarshipApp 表中的ScholarshipResume字段为ScholarshipResume,FileName字段;

            UpdateCriteria uc = new UpdateCriteria(typeof(ScholarAppEntity));
            Condition cd = uc.GetNewCondition();
            cd.AddEqualTo(ScholarAppEntity.__STUID, StuID);
            cd.AddEqualTo(ScholarAppEntity.__SCHOLARSHIPINFOID, ScholarshipInfoID);
            uc.AddAttributeForUpdate(ScholarAppEntity.__SCHOLARSHIPRESUME, ScholarshipResume);
            uc.AddAttributeForUpdate(ScholarAppEntity.__FILENAME, FileName);
            try
            {
                uc.Perform();
                return true;//表示修改成功
            }


            catch
            {


                return false; //友好提示

            }
            return false;
            // return false;//表示修改失败

        }
        public static DataTable GetScholarshipAppCheckedSuccess(string StuID)//失败;
        {
            //获取已经评定通过的奖学金;
            /*
             * 
                单项奖学金编号	ScholarshipInfoID
                学号	StuID
                单项奖学金个人简介	ScholarshipResume
                奖学金是否审核	SchoIsChecked
                评定时间	GetScholarDate
                备注	Remark
             * 奖学金名称:ScholarshipName


             * */


            string Sql = "select ScholarInfo.ScholarshipInfoID,ScholarshipName,GetScholarDate, IsChecked,ScholarInfo.Remark,ScholarApp.Remark from ScholarInfo,ScholarApp where ScholarInfo.ScholarshipInfoID=ScholarApp.ScholarshipInfoID and  IsChecked=1 and  StuID='" + StuID + "'";


            DataTable dt = Query.ProcessSql(Sql, "GradMIS_Data");
            if (dt.Rows.Count > 0)
            {
                return dt;
            }
            return null;
        }
        public static DataTable GetScholarshipAppCheckedFailure(string StuID)
        {
            //获取已经评定奖学金失败的结果;
            /*
             *   单项奖学金编号	ScholarshipInfoID
                学号	StuID
                单项奖学金个人简介	ScholarshipResume
                奖学金是否审核	SchoIsChecked
                评定时间	GetScholarDate
                备注	Remark
             * * 奖学金名称:ScholarshipName

             * */
            string Sql = "select ScholarInfo.ScholarshipInfoID,ScholarshipName,GetScholarDate, IsChecked,ScholarInfo.Remark,ScholarApp.Remark from ScholarInfo,ScholarApp where ScholarInfo.ScholarshipInfoID=ScholarApp.ScholarshipInfoID and  IsChecked=2 and  StuID='" + StuID + "'";


            DataTable dt = Query.ProcessSql(Sql,"GradMIS_Data");
            if (dt.Rows.Count > 0)
            {
                return dt;
            }
            return null;
        }
        public static DataTable GetScholarshipAppCheckedDoing(string StuID)
        {
            //获取正在进行奖学金评定的记录;
            /*
             *  单项奖学金编号	ScholarshipInfoID
                学号	StuID
                单项奖学金个人简介	ScholarshipResume
                奖学金是否审核	SchoIsChecked
                评定时间	GetScholarDate
                备注	Remark
             * * 奖学金名称:ScholarshipName

             * */
            string Sql = "select ScholarInfo.ScholarshipInfoID,ScholarshipName,GetScholarDate, IsChecked,ScholarInfo.Remark,ScholarApp.Remark from ScholarInfo,ScholarApp where ScholarInfo.ScholarshipInfoID=ScholarApp.ScholarshipInfoID and  IsChecked=0 and  StuID='" + StuID + "'";


            DataTable dt = Query.ProcessSql(Sql, "GradMIS_Data");
            if (dt.Rows.Count > 0)
            {
                return dt;
            }
            return null;
        }

        public static DataRow GetLoanInfo(string  StuID)
        {

            //返回所有的详细信息,DataRow必须包含以下个项;
            /*
             * 贷款信息编号	LoanID
                学号	StuID
                贷款否	IsLoan
                贷款金额	LoanMoney
                备注	Remark
             


             * */
            RetrieveCriteria rc = new RetrieveCriteria(typeof(LoanInfoEntity));
            Condition c = rc.GetNewCondition();
            c.AddEqualTo(LoanInfoEntity.__STUID, StuID);
            DataTable LoanTable = rc.AsDataTable();
            if (LoanTable.Rows.Count > 0)
            {
                DataRow LoanRow = LoanTable.Rows[0];
                return LoanRow;
            }
            //如果学生有贷款返回DataRow,否则返回null
            return null;
        }
        public static string GetStuPwd(string StuID)
        {//返回学生的登陆密码
            return "asfs";
        }
        public static bool SetStuPwd(string StuID, string StuPwd)
        {
            //修改学生的密码
            //StuID:学号StuPwd:密码
            //返回值表示是否成功,
            //return true;//修改成功;
            // return false 修改失败;
            StudentInfoEntity sinfoEntity = new StudentInfoEntity();
            sinfoEntity.StuID = StuID;
            sinfoEntity.Retrieve();
            try
            {
                if (sinfoEntity.IsPersistent)
                {
                    sinfoEntity.PassWord = StuPwd;
                    sinfoEntity.Save();
                    return true;
                }
                else return false;
            }
            catch
            {
                return false;
            }
        }
        
       
    }

}

⌨️ 快捷键说明

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