コード例 #1
0
        public int ChapterReadLogSync(ChapterLogInfo chapterLogInfo, NovelReadRecordInfo novelReadRecordInfo)
        {
            if (chapterLogInfo == null || novelReadRecordInfo == null)
            {
                return(0);
            }

            using (var conn = DbConnection(DbOperation.Write))
            {
                var repo = new Repository.LogRepo(conn);
                return(repo.ChapterReadLogSync(chapterLogInfo, novelReadRecordInfo));
            }
        }
コード例 #2
0
        /// <summary>
        /// 章节详情日志,小说阅读记录
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="novelId"></param>
        /// <param name="chapterId"></param>
        /// <param name="chapterCode"></param>
        protected void ReadLog(string userName, int novelId, int chapterId, int chapterCode)
        {
            ChapterLogInfo model = new ChapterLogInfo();

            model             = GetLogInfo(model) as ChapterLogInfo;
            model.CookieId    = GetCookieId();
            model.NovelId     = novelId;
            model.ChapterId   = chapterId;
            model.ChapterCode = chapterCode;
            model.AddTime     = DateTime.Now;
            model.UserName    = userName;

            NovelReadRecordInfo novelReadRecordInfo = new NovelReadRecordInfo();

            novelReadRecordInfo.Position       = 0;
            novelReadRecordInfo.RecentReadTime = System.DateTime.Now;

            ILogService service = DataContext.ResolveService <ILogService>();

            service.ChapterReadLog(model, novelReadRecordInfo);
        }
コード例 #3
0
ファイル: LogRepo.cs プロジェクト: wjydc/YueDu_v3
        public int ChapterReadLogSync(ChapterLogInfo chapterLogInfo, NovelReadRecordInfo novelReadRecordInfo)
        {
            string spName = "Wap.Chapter_ReadSync";

            var p = new DynamicParameters();

            p.Add("@NovelId", chapterLogInfo.NovelId);
            p.Add("@ChapterId", chapterLogInfo.ChapterId);
            p.Add("@ChapterCode", chapterLogInfo.ChapterCode);
            p.Add("@Position", novelReadRecordInfo.Position);
            p.Add("@RecentReadTime", novelReadRecordInfo.RecentReadTime);
            p.Add("@CookieId", chapterLogInfo.CookieId);
            p.Add("@UserId", chapterLogInfo.UserId);
            p.Add("@UserName", chapterLogInfo.UserName);
            p.Add("@ClientId", chapterLogInfo.ClientId);
            p.Add("@Version", chapterLogInfo.Version);
            p.Add("@UserAgent", chapterLogInfo.UserAgent);
            p.Add("@IMEI", chapterLogInfo.IMEI);
            p.Add("@IMSI", chapterLogInfo.IMSI);
            p.Add("@ChannelId", chapterLogInfo.ChannelId);
            p.Add("@SourceType", chapterLogInfo.SourceType);
            p.Add("@Mobile", chapterLogInfo.Mobile);
            p.Add("@NetType", chapterLogInfo.NetType);
            p.Add("@Province", chapterLogInfo.Province);
            p.Add("@City", chapterLogInfo.City);
            p.Add("@ReferUrl", chapterLogInfo.ReferUrl);
            p.Add("@IPAddress", chapterLogInfo.IPAddress);
            p.Add("@RemoteHost", chapterLogInfo.RemoteHost);
            p.Add("@AddTime", chapterLogInfo.AddTime);
            p.Add("@PromotionCode", chapterLogInfo.PromotionCode);
            p.Add("@RouteChannelId", novelReadRecordInfo.RouteChannelId);
            p.Add("@ROut", dbType: DbType.Int32, direction: ParameterDirection.Output);

            DbManage.Execute(spName, p, CommandType.StoredProcedure);

            return(p.Get <int>("@ROut"));
        }