コード例 #1
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);
        }
コード例 #2
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);
        }
コード例 #3
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);
        }
コード例 #4
0
ファイル: ActionsRepository.cs プロジェクト: QinShangQs/wek-e
        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);
        }
コード例 #5
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);
        }