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

📄 grd_mis_2.cs

📁 一个研究生管理系统 具体的情况自己看了
💻 CS
📖 第 1 页 / 共 2 页
字号:
            }
            catch
            {
                return false;
            }
        }
       
        public static bool DelData_UndergraduateCourse_ByUnderCourseID(int id)
        {
            //删除UndergraduateCourse表UnderCourseID=id的数据
            DeleteCriteria dc = new DeleteCriteria(typeof(UndergraduateCourseEntity));
            Condition c = dc.GetNewCondition();
            c.AddEqualTo(UndergraduateCourseEntity.__UNDERCOURSEID, id);
            try
            {
                int re = dc.Perform();
                if (re > 0)
                    return true;
                else
                    return false;
            }
            catch
            {
                return false;
            }
        }
        public static bool DelData_OneStationInfo(int id)
        {
            //删除StationInfo表中StationID=id的数据
            DeleteCriteria dc = new DeleteCriteria(typeof(StationInfoEntity));
            Condition c = dc.GetNewCondition();
            c.AddEqualTo(StationInfoEntity.__STATIONID, id);
            try
            {
                int re = dc.Perform();
                if (re > 0)
                    return true;
                else
                    return false;
            }
            catch
            {
                return false;
            }
        }
        public static bool DelData_OneReStudyCourse(int id)
        {
            //删除ReStudyCourse表中Tream=id
            DeleteCriteria dc = new DeleteCriteria(typeof(ReStudyCourseEntity));
            Condition c = dc.GetNewCondition();
            c.AddEqualTo(ReStudyCourseEntity.__TERM, id);
            try
            {
                int re = dc.Perform();
                if (re > 0)
                    return true;
                else
                    return false;
            }
            catch
            {
                return false;
            }
        }
        public static bool DelData_ReStudyCourse(int id)
        {
            //删除ReStudyCourse表中ReStudyCourseID=id
            DeleteCriteria dc = new DeleteCriteria(typeof(ReStudyCourseEntity));
            Condition c = dc.GetNewCondition();
            c.AddEqualTo(ReStudyCourseEntity.__RESTUDYCOURSEID, id);
            try
            {
                int re = dc.Perform();
                if (re > 0)
                    return true;
                else
                    return false;
            }
            catch
            {
                return false;
            }
 
        }
        public static bool SetData_UndergraduateCourse_ByUnderCourseID(int id, String TeaClassID, String CourseID, String CourseName, String CourseType, String Teacher, String TeacherPhone, String ClassDate, String ClassAddress, String ClassWeeks, int Term, String Remark)
        {
            //更新UndergraduateCourse表UnderCourseID=id的数据
            UpdateCriteria uc = new UpdateCriteria(typeof(UndergraduateCourseEntity));
            Condition c = uc.GetNewCondition();
            c.AddEqualTo(UndergraduateCourseEntity.__UNDERCOURSEID, id);
            uc.AddAttributeForUpdate(UndergraduateCourseEntity.__TEACLASSID, TeaClassID);
            uc.AddAttributeForUpdate(UndergraduateCourseEntity.__COURSEID, CourseID);
            uc.AddAttributeForUpdate(UndergraduateCourseEntity.__COURSENAME, CourseName);
            uc.AddAttributeForUpdate(UndergraduateCourseEntity.__COURSETYPE, CourseType);
            uc.AddAttributeForUpdate(UndergraduateCourseEntity.__TEACHER, Teacher);
            uc.AddAttributeForUpdate(UndergraduateCourseEntity.__TEACHERPHONE, TeacherPhone);
            uc.AddAttributeForUpdate(UndergraduateCourseEntity.__CLASSDATE, ClassDate);
            uc.AddAttributeForUpdate(UndergraduateCourseEntity.__CLASSADDRESS, ClassAddress);
            uc.AddAttributeForUpdate(UndergraduateCourseEntity.__CLASSWEEKS, ClassWeeks);
            uc.AddAttributeForUpdate(UndergraduateCourseEntity.__TERM, Term);
            uc.AddAttributeForUpdate(UndergraduateCourseEntity.__REMARK, Remark);
            try
            {
                int re = uc.Perform();
                if (re > 0)
                    return true;
                else
                    return false;
            }
            catch
            {
                return false;
            }
 
        }
        public static bool SetData_ReStudyCourse_ByReStudyCourseID(int id, String TeaClassID, String CourseID, String CourseName, String CourseType, String Teacher, String TeacherPhone, String ClassDate, String ClassAddress, String ClassWeeks, int Term, String Remark)
        {
            //更新ReStudyCourse表ReStudyCourseID=id的数据
            UpdateCriteria uc = new UpdateCriteria(typeof(ReStudyCourseEntity));
            Condition c = uc.GetNewCondition();
            c.AddEqualTo(ReStudyCourseEntity.__RESTUDYCOURSEID, id);
            uc.AddAttributeForUpdate(ReStudyCourseEntity.__TEACLASSID, TeaClassID);
            uc.AddAttributeForUpdate(ReStudyCourseEntity.__COURSEID, CourseID);
            uc.AddAttributeForUpdate(ReStudyCourseEntity.__COURSENAME, CourseName);
            uc.AddAttributeForUpdate(ReStudyCourseEntity.__COURSETYPE, CourseType);
            uc.AddAttributeForUpdate(ReStudyCourseEntity.__TEACHER, Teacher);
            //uc.AddAttributeForUpdate(ReStudyCourseEntity.__REACHERPHONE, TeacherPhone);//表中不存在此字段
            uc.AddAttributeForUpdate(ReStudyCourseEntity.__CLASSDATE, ClassDate);
            uc.AddAttributeForUpdate(ReStudyCourseEntity.__CLASSADDRESS, ClassAddress);
            uc.AddAttributeForUpdate(ReStudyCourseEntity.__CLASSWEEKS, ClassWeeks);
            uc.AddAttributeForUpdate(ReStudyCourseEntity.__TERM, Term);
            uc.AddAttributeForUpdate(ReStudyCourseEntity.__REMARK, Remark);
            try
            {
                int re = uc.Perform();
                if (re > 0)
                    return true;
                else
                    return false;
            }
            catch
            {
                return false;
            }

        }
        public static bool SetData_TeachPracApply_TeaPracApplyID(int id, int value)
        {
            //找到TeachPracApply表TeaPracApplyID=id
            //set IsChecked=value
            UpdateCriteria uc = new UpdateCriteria(typeof(TeachPracApplyEntity));
            Condition c = uc.GetNewCondition();
            c.AddEqualTo(TeachPracApplyEntity.__TEAPRACAPPLYID, id);
            uc.AddAttributeForUpdate(TeachPracApplyEntity.__ISCHECKED, value);
            try
            {
                int re = uc.Perform();
                if (re > 0)
                    return true;
                else
                    return false;
            }
            catch
            {
                return false;
            }
 
        }
        public static bool SetData_UndergraduateCourse_Enable(int id, int Enable)
        {
            //UndergraduateCourse表中Term=id
            //set Enable=Enable

            UpdateCriteria uc = new UpdateCriteria(typeof( UndergraduateCourseEntity ));
            Condition c = uc.GetNewCondition();
            c.AddEqualTo( UndergraduateCourseEntity.__TERM, id);
            uc.AddAttributeForUpdate( UndergraduateCourseEntity.__ENABLE,Enable);
            try
            {
                int re = uc.Perform();
                if (re > 0)
                    return true;
                else
                    return false;
            }
            catch
            {
                return false;
            }
 
        }
        public static bool SetData_StationApply_IsChecked(int id, int IsChecked)
        {
            //StationApply表中StationApplyID=id
            //set IsChecked=IsChecked
            UpdateCriteria uc = new UpdateCriteria(typeof( StationApplyEntity ));
            Condition c = uc.GetNewCondition();
            c.AddEqualTo( StationApplyEntity.__STATIONAPPLYID , id);
            uc.AddAttributeForUpdate( StationApplyEntity.__ISCHECKED , IsChecked);
            try
            {
                int re = uc.Perform();
                if (re > 0)
                    return true;
                else
                    return false;
            }
            catch
            {
                return false;
            }
            
 
        }
        public static bool SetData_StationInfo_Enable(int id, int value)
        {
            //StationInfo表中StationID=id
            //set Enable=value
            UpdateCriteria uc = new UpdateCriteria(typeof( StationInfoEntity));
            Condition c = uc.GetNewCondition();
            c.AddEqualTo(StationInfoEntity.__STATIONID, id);
            uc.AddAttributeForUpdate(StationInfoEntity.__ENABLE, value);
            try
            {
                int re = uc.Perform();
                if (re > 0)
                    return true;
                else
                    return false;
            }
            catch
            {
                return false;
            }
        }
        public static bool SetData_ReStudyCourse_Enable()
        {
            //ReStudyCourse表所有Enable的值设为0;
            UpdateCriteria uc = new UpdateCriteria(typeof(ReStudyCourseEntity));
            Condition c = uc.GetNewCondition();
            c.AddEqualTo(ReStudyCourseEntity.__ENABLE, 1);
            
            uc.AddAttributeForUpdate(ReStudyCourseEntity.__ENABLE, 0);
            try
            {
                int re = uc.Perform();
                                   return true;
               
            }
            catch
            {
                return false;
            }
        }
        public static bool TestData_ReStudyCourse_Term(int Term)
        {
            //判断Term在ReStudyCourse表中是否存在
            //存在返回true,不存在返回false
            //ReStudyCourseEntity restudyCourse = new ReStudyCourseEntity();
            //restudyCourse.Term = Term;
            //try
            //{
            //    restudyCourse.Retrieve();
            //    if (restudyCourse.IsPersistent)
            //        return true;
            //    else
            //        return false;
            //}
            //catch
            //{
            //    return false;
            //}
            RetrieveCriteria aa = new RetrieveCriteria(typeof(ReStudyCourseEntity));
            aa.GetNewCondition().AddEqualTo(ReStudyCourseEntity.__TERM, Term);
            DataTable bb=aa.AsDataTable();
            if (bb.Rows.Count < 1)
            {
                return false;
            }
            return true;
           
           
        }

	}
    
}

⌨️ 快捷键说明

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