private IEnumerable <LogInfo> GetNewInfoBySelf(Guid xxid, int topcount, string uctype, int pageindex) { UCHomeEntities uc = new UCHomeEntities(); List <LogInfo> loglist = new List <LogInfo>(); var pn = uc.UCHome_PersonNew.Join( uc.View_Simple_User, a => a.AddUser, b => b.userid, (a, b) => new { a.PKID, a.Title, a.Abstract, a.DeployTime, a.AddUser, a.Hits, a.UCType, a.IsAudit, a.IsShare, a.IsShow, b.xxid }) .Where(u => u.xxid == xxid && u.UCType == uctype && u.IsShow == 1 && u.IsAudit > 1) .OrderByDescending(u => u.DeployTime).Skip(topcount * (pageindex - 1)).Take(topcount).ToList(); foreach (var item in pn) { LogInfo log = new LogInfo(); log.pkid = item.PKID; log.logtitle = item.Title; log.logabstract = item.Abstract; log.logdate = item.DeployTime; log.loghits = item.Hits; log.logisaudit = EnumConvert.ConvertAudit(item.IsAudit); log.logisshare = EnumConvert.ConvertShare(item.IsShare); log.logisshow = EnumConvert.ConvertShow(item.IsShow); log.loguser = item.AddUser; loglist.Add(log); } return(loglist); }
private LogInfo GetLogInfoBySelf(Guid pid) { UCHomeEntities uc = new UCHomeEntities(); UCHome_PersonNew item = uc.UCHome_PersonNew.SingleOrDefault(u => u.PKID == pid); LogInfo log = new LogInfo(); if (item != null) { log.pkid = item.PKID; log.logtitle = item.Title; log.logabstract = item.Abstract; log.logdate = item.DeployTime; log.loghits = item.Hits; log.logisaudit = EnumConvert.ConvertAudit(item.IsAudit); log.logisshare = EnumConvert.ConvertShare(item.IsShare); log.logisshow = EnumConvert.ConvertShow(item.IsShow); log.loguser = item.AddUser; } return(log); }
private IEnumerable <LogInfo> GetNewInfoBySelf(Guid uid, int topcount, string uctype, int pageindex, string isshare) { UCHomeEntities uc = new UCHomeEntities(); List <LogInfo> loglist = new List <LogInfo>(); List <UCHome_PersonNew> pn; if (uctype != "draftboxlog") { pn = uc.UCHome_PersonNew.Where(u => u.AddUser == uid && u.UCType == uctype && u.IsShow == 1 && (isshare != "y" || u.IsShare != "0")) .OrderByDescending(u => u.DeployTime) .Skip(topcount * (pageindex - 1)) .Take(topcount) .ToList(); } else { pn = uc.UCHome_PersonNew.Where(u => u.AddUser == uid && (u.UCType == "log" || u.UCType == "article") && u.IsShow == 0 && (isshare != "y" || u.IsShare != "0")) .OrderByDescending(u => u.DeployTime) .Skip(topcount * (pageindex - 1)) .Take(topcount) .ToList(); } foreach (UCHome_PersonNew item in pn) { LogInfo log = new LogInfo(); log.pkid = item.PKID; log.logtitle = item.Title; log.logabstract = item.Abstract; log.logdate = item.DeployTime; log.loghits = item.Hits; log.flowers = item.flowers; log.logisaudit = EnumConvert.ConvertAudit(item.IsAudit); log.logisshare = EnumConvert.ConvertShare(item.IsShare); log.logisshow = EnumConvert.ConvertShow(item.IsShow); log.loguser = item.AddUser; loglist.Add(log); } return(loglist); }