TEDAL/VideoDAL.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using Tool;
using k2hTEWebApp;
using TEModel;

namespace TEDAL
{
    public class VideoDAL
    {
        SQLHelper db = new SQLHelper();

        /// <summary>
        /// 查询所有视频实体
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAllVideo()
        {
            string sql = @"SELECT [VideoID], [TrainingID], [Name], [Location], [State], [Time], " +
                "[V5], [V6], [V7], [V8], [V9], [Content] " +
                "FROM [TrainingExam].[dbo].[Video]";
            return db.GetDataTable(sql);
        }
        /// <summary>
        /// 添加视频实体
        /// </summary>
        /// <param name="video"></param>
        /// <returns></returns>
        public int InsertVideo(VideoModel video)
        {
            string sql = @"INSERT INTO [TrainingExam].[dbo].[Video] " +
                "([VideoID], [TrainingID], [Name], [Location], [State], [Time], " +
                "[V5], [V6], [V7], [V8], [V9], [Content]) " +
                "VALUES(@VideoID, @TrainingID, @Name, @Location, @State, @Time, " +
                "@V5, @V6, @V7, @V8, @V9, @Content)";
            SqlParameter[] parameters = 
            {
                new SqlParameter("@VideoID", video.VideoID),
                new SqlParameter("@TrainingID", video.TrainingID),
                new SqlParameter("@Name", video.Name),
                new SqlParameter("@State", video.State),
                new SqlParameter("@Time", video.Time),
                new SqlParameter("@Content", video.Content)
            };
            return db.ExecuteNonQuery(sql, parameters);
        }
        /// <summary>
        /// 删除视频实体
        /// </summary>
        /// <param name="video"></param>
        /// <returns></returns>
        public int DeleteVideo(VideoModel video)
        {
            string sql = @"DELETE FROM Video WHERE VideoID=@VideoID";
            SqlParameter parameter = new SqlParameter("@VideoID", video.VideoID);
后面还有 28 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。