Exemplo n.º 1
0
        //插入
        public bool InsertCourseInfo(CourseInfoData data)
        {
            string sql = "insert into courseinfo(kcid,kcname,"
                         + "periodexpriment,periodteaching,credit,coursetype) values('"
                         + data.Kcid + "','" + data.Kcname + "','" + data.Periodexpriment + "','"
                         + data.Periodteaching + "','" + data.Credit + "','" + data.Coursetype + "')";
            DataAccess da = new DataAccess();

            return(da.ExecuteSQL(sql));
        }
Exemplo n.º 2
0
        //修改
        public bool UpdateCourse(CourseInfoData data)
        {
            string sql = "update courseinfo set kcid='"
                         + data.Kcid + "',kcname='" + data.Kcname
                         + "',periodexpriment='" + data.Periodexpriment
                         + "',periodteaching='" + data.Periodteaching
                         + "',credit='" + data.Credit
                         + "',coursetype='" + data.Coursetype + "'"

                         + " where kcid='" + data.Kcid + "'";
            DataAccess da = new DataAccess();

            return(da.ExecuteSQL(sql));
        }
Exemplo n.º 3
0
        //查询
        public System.Data.DataSet GetCourseInfo(CourseInfoData data)
        {
            string sql = "select * from courseinfo where 1=1";
            string s   = "";

            if (data.Kcid != "" && data.Kcid != null)
            {
                s += " and kcid ='" + data.Kcid + "'";
            }
            if (data.Kcname != "" && data.Kcname != null)
            {
                s += " and kcname='" + data.Kcname + "'";
            }

            sql += s;
            DataAccess da = new DataAccess();

            return(da.GetDataSet(sql, "stugradeinfo"));
        }