Esempio n. 1
0
        public static int Update(Comments inst)
        {
            string sql = "udpate Comments set "
                         + " userName = "******" ,courseItemId = " + inst.courseItemId + ""
                         + " ,content = '" + inst.content + "'"
                         + " where id = " + inst.id;

            return(OleDbHelper.ExecuteCommand(sql));
        }
Esempio n. 2
0
        public static int Update(CourseItem inst)
        {
            string sql = "udpate courseItem set "
                         + " courseId = " + inst.courseId
                         + " ,title = '" + inst.title + "'"
                         + " ,remark = '" + inst.remark + "'"
                         + " ,filePath = '" + inst.filePath + "'"
                         + " where id = " + inst.id;

            return(OleDbHelper.ExecuteCommand(sql));
        }
Esempio n. 3
0
        public static int Add(CourseItem inst)
        {
            string sql = "insert into courseItem (courseId,title,remark,addtime,filePath) ";

            sql += string.Format(" values({0},'{1}','{2}','{3}','{4}')", inst.courseId, inst.title, inst.remark, DateTime.Now, inst.filePath);
            if (OleDbHelper.ExecuteCommand(sql) > 0)
            {
                return(OleDbHelper.GetScalar("select @@IDENTITY"));
            }
            return(0);
        }
Esempio n. 4
0
        public static int Add(Comments inst)
        {
            string sql = "insert into Comments (userName,courseItemId,content,addtime) ";

            sql += string.Format(" values('{0}',{1},'{2}','{3}')",
                                 inst.userName, inst.courseItemId, inst.content, DateTime.Now);
            if (OleDbHelper.ExecuteCommand(sql) > 0)
            {
                return(OleDbHelper.GetScalar("select @@IDENTITY"));
            }
            return(0);
        }
Esempio n. 5
0
        public static int Add(Course inst)
        {
            string sql = "insert into Course (teacherId,title,remark,unionNumber,grad,categoryName,addtime,picture) ";

            sql += string.Format(" values({0},'{1}','{2}','{3}','{4}','{5}','{6}','{7}')",
                                 inst.teacherId, inst.title, inst.remark, inst.unionNumber, inst.grad, inst.categoryName, DateTime.Now, inst.picture);
            if (OleDbHelper.ExecuteCommand(sql) > 0)
            {
                return(OleDbHelper.GetScalar("select @@IDENTITY"));
            }
            return(0);
        }
Esempio n. 6
0
        public static int Update(Actions inst)
        {
            string sql = "udpate Actions set "
                         + " name = " + inst.name
                         + " ,begint = '" + inst.begint + "'"
                         + " ,endt = '" + inst.endt + "'"
                         + " ,content = '" + inst.content + "'"
                         + " ,remark = '" + inst.remark + "'"
                         + " where id = " + inst.id;

            return(OleDbHelper.ExecuteCommand(sql));
        }
Esempio n. 7
0
        public static int Add(Actions inst)
        {
            string sql = "insert into Actions (name,begint,endt,content,remark,addtime) ";

            sql += string.Format(" values('{0}','{1}','{2}','{3}','{4}','{5}')",
                                 inst.name, inst.begint, inst.endt, inst.content, inst.remark, DateTime.Now);
            if (OleDbHelper.ExecuteCommand(sql) > 0)
            {
                return(OleDbHelper.GetScalar("select @@IDENTITY"));
            }
            return(0);
        }
Esempio n. 8
0
        public static int Add(Users inst)
        {
            string sql = "insert into users (name,email,sex,birthday,school,grad,parentName,parentPhone,headerImg,addtime,categoryId,pwd,roleName,phone,degree, experience)";

            sql += string.Format(" values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}',{10},'{11}','{12}','{13}','{14}','{15}');"//
                                 , inst.name, inst.email, inst.sex, inst.birthday, inst.school, inst.grad, inst.parentName, inst.parentPhone, inst.headerImg,
                                 DateTime.Now, inst.categoryId, inst.pwd, inst.roleName, inst.phone, inst.degree, inst.experience);
            if (OleDbHelper.ExecuteCommand(sql) > 0)
            {
                return(OleDbHelper.GetScalar("select @@IDENTITY"));
            }
            return(0);
        }
Esempio n. 9
0
        public static int Update(Course inst)
        {
            string sql = "udpate Course set "
                         + " teacherId = " + inst.teacherId
                         + " ,title = '" + inst.title + "'"
                         + " ,remark = '" + inst.remark + "'"
                         + " ,unionNumber = '" + inst.unionNumber + "'"
                         + " ,grad = '" + inst.grad + "'"
                         + " ,categoryName = '" + inst.categoryName + "'"
                         + " ,picture = '" + inst.picture + "'"
                         + " where id = " + inst.id;

            return(OleDbHelper.ExecuteCommand(sql));
        }
Esempio n. 10
0
        public static int Update(Users inst)
        {
            string sql = string.Format("update users "
                                       + " set name = '{0}'"
                                       + " ,email = '{1}'"
                                       + " ,sex = '{2}'"
                                       + " ,birthday = '{3}'"
                                       + " ,school = '{4}'"
                                       + " ,grad = '{5}'"
                                       + " ,parentName = '{6}'"
                                       + " ,parentPhone = '{7}'"
                                       + " ,headerImg = '{8}'"
                                       + " ,categoryId = {9}"
                                       + " ,pwd = '{10}'"
                                       + " ,roleName = '{11}'"
                                       + " ,phone = '{12}'"
                                       + " ,degree = '{13}'"
                                       + " ,experience = '{14}'"
                                       + " where id = {15}", inst.name, inst.email, inst.sex, inst.birthday, inst.school, inst.grad, inst.parentName, inst.parentPhone, inst.headerImg,
                                       inst.categoryId, inst.pwd, inst.roleName, inst.phone, inst.degree, inst.experience, inst.id);

            return(OleDbHelper.ExecuteCommand(sql));
        }
Esempio n. 11
0
        public static int Delete(int id)
        {
            string sql = string.Format("delete from Comments where id = {0}", id);

            return(OleDbHelper.ExecuteCommand(sql));
        }