• 大小: 9.91MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-16
  • 语言: C#
  • 标签: c#  

资源简介

ASP.NET在线学习平台网站源码

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DTcms.DBUtility;
using System.Data.SqlClient;

namespace User.DAL
{
    public class UserCenterDAL
    {
        /// 
        /// 获取个人历史播放记录
        /// 

        /// 
        /// 
        public static DataSet GetHistoryByUser(string userid)
        {
            string sql = “select * from dt_article a left join wj_user_history b on b.articleId=a.id where b.userName=‘“+userid+“‘“;
            return DbHelperSQL.Query(sql);
        }

        /// 
        /// 添加历史记录
        /// 

        /// 
        /// 
        /// 
        /// 
        /// 
        public static int AddHistory(string articleId string historyDate string userNamestring endtime)
        {
            string sql = “insert into wj_user_history values(@articleId@historyDate@userName@endtime)“;
            SqlParameter[] parameters = {
                    new SqlParameter(“@articleId“ SqlDbType.Int)
new SqlParameter(“@historyDate“ SqlDbType.NVarChar255)
new SqlParameter(“@userName“ SqlDbType.NVarChar255)
                    new SqlParameter(“@endtime“ SqlDbType.NVarChar255)};
            parameters[0].Value = articleId;
            parameters[1].Value = historyDate;
            parameters[2].Value = userName;
            parameters[3].Value = endtime;
            return DbHelperSQL.ExecuteSql(sql parameters);
        }
        /// 
        /// 判断历史是否存在
        /// 

        /// 
        /// 
        public static bool Exists(int aticleId)
        {
            string sql = “select count (*) from wj_user_history where articleId=“+aticleId;
            return DbHelperSQL.Exists(sql);
        }
        /// 
        /// 如果有记录,则修改记录
        /// 

        /// 
        /// 
        /// 
        /// 
        /// 
        public static int UpdateHistory(string articleId string historyDate string userName string endtime)
        {
            string sql = “update wj_user_history set historyDate=@historyDateendtime=@endtime where articleId=@articleId and userName=@userName“;
            SqlParameter[] parameters = {
                    new SqlParameter(“@articleId“ SqlDbType.Int)
new SqlParameter(“@historyDate“ SqlDbType.NVarChar255)
new SqlParameter(“@userName“ SqlDbType.NVarChar255)
                    new SqlParameter(“@endtime“ SqlDbType.NVarChar255)};
            parameters[0].Value = articleId;
          

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-01-20 15:38  DTcms_40_sql_src - 王娟\
     目录           0  2016-01-25 15:12  DTcms_40_sql_src - 王娟\DAL\
     目录           0  2016-01-20 15:17  DTcms_40_sql_src - 王娟\DAL\Properties\
     文件        1356  2016-01-20 15:17  DTcms_40_sql_src - 王娟\DAL\Properties\AssemblyInfo.cs
     文件        2767  2016-01-25 16:46  DTcms_40_sql_src - 王娟\DAL\User.DAL.csproj
     文件        3797  2016-01-22 08:56  DTcms_40_sql_src - 王娟\DAL\UserCenterDAL.cs
     目录           0  2016-01-25 16:46  DTcms_40_sql_src - 王娟\DAL\bin\
     目录           0  2016-01-25 15:00  DTcms_40_sql_src - 王娟\DAL\bin\Debug\
     文件        6656  2016-01-25 16:46  DTcms_40_sql_src - 王娟\DAL\bin\Debug\DAL.dll
     文件       13824  2016-01-25 16:46  DTcms_40_sql_src - 王娟\DAL\bin\Debug\DAL.pdb
     文件       61952  2016-01-18 12:59  DTcms_40_sql_src - 王娟\DAL\bin\Debug\DTcms.Common.dll
     文件      269824  2016-01-18 12:59  DTcms_40_sql_src - 王娟\DAL\bin\Debug\DTcms.DAL.dll
     文件       18432  2016-01-25 15:00  DTcms_40_sql_src - 王娟\DAL\bin\Debug\DTcms.DBUtility.dll
     文件       46592  2016-01-25 15:00  DTcms_40_sql_src - 王娟\DAL\bin\Debug\DTcms.DBUtility.pdb
     文件       81920  2016-01-18 12:59  DTcms_40_sql_src - 王娟\DAL\bin\Debug\DTcms.Model.dll
     目录           0  2016-01-20 15:17  DTcms_40_sql_src - 王娟\DAL\obj\
     目录           0  2016-01-25 16:46  DTcms_40_sql_src - 王娟\DAL\obj\Debug\
     文件        6656  2016-01-25 16:46  DTcms_40_sql_src - 王娟\DAL\obj\Debug\DAL.dll
     文件       13824  2016-01-25 16:46  DTcms_40_sql_src - 王娟\DAL\obj\Debug\DAL.pdb
     文件        5876  2016-01-25 16:46  DTcms_40_sql_src - 王娟\DAL\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2016-01-25 16:51  DTcms_40_sql_src - 王娟\DAL\obj\Debug\TempPE\
     文件         605  2016-01-25 16:45  DTcms_40_sql_src - 王娟\DAL\obj\Debug\User.DAL.csproj.FileListAbsolute.txt
     文件       20066  2016-01-25 15:00  DTcms_40_sql_src - 王娟\DAL\obj\Debug\User.DAL.csprojResolveAssemblyReference.cache
     目录           0  2016-01-20 12:40  DTcms_40_sql_src - 王娟\DTcms.API\
     文件        5100  2016-01-18 13:06  DTcms_40_sql_src - 王娟\DTcms.API\DTcms.API.csproj
     文件         227  2015-05-10 21:46  DTcms_40_sql_src - 王娟\DTcms.API\DTcms.API.csproj.user
     目录           0  2016-01-20 12:40  DTcms_40_sql_src - 王娟\DTcms.API\OAuth\
     文件        2171  2015-05-01 15:04  DTcms_40_sql_src - 王娟\DTcms.API\OAuth\feixin_helper.cs
     文件        2662  2015-05-01 15:26  DTcms_40_sql_src - 王娟\DTcms.API\OAuth\kaixin_helper.cs
     文件        1302  2015-05-01 15:01  DTcms_40_sql_src - 王娟\DTcms.API\OAuth\oauth_config.cs
     文件        1260  2015-05-01 18:16  DTcms_40_sql_src - 王娟\DTcms.API\OAuth\oauth_helper.cs
............此处省略1537个文件信息

评论

共有 条评论