Пример #1
0
        public int Insert(LectureTypeItem item)
        {
            string        query = "Insert into LectureType(lectureCategoryId,name) VALUES(@LectureCategoryId,@Name)";
            IDbParameters param = CreateDbParameters();

            param.AddWithValue("LectureCategoryId", item.LectureCategoryId).DbType = DbType.Int32;
            param.AddWithValue("Name", item.Name).DbType = DbType.String;
            return(AdoTemplate.ExecuteNonQuery(CommandType.Text, query, param));
        }
Пример #2
0
        public int Update(LectureTypeItem item)
        {
            string        query = "UPDATE LectureType SET name = @Name, lectureCategoryId = @LectureCategoryId where id = @Id";
            IDbParameters param = CreateDbParameters();

            param.AddWithValue("Id", item.Id).DbType = DbType.Int32;
            param.AddWithValue("LectureCategoryId", item.LectureCategoryId).DbType = DbType.Int32;
            param.AddWithValue("Name", item.Name).DbType = DbType.String;
            return(AdoTemplate.ExecuteNonQuery(CommandType.Text, query, param));
        }