public void MyDefault() { if (!base.IsLogin) { Redirect("/index.html"); } SystemService sysService = Context.GetService <SystemService>(); DocService ds = Context.GetService <DocService>(); OrderService os = Context.GetService <OrderService>(); PropertyBag["firstCatalog"] = sysService.SCatalogBll.GetTopNode(); //大家在阅读什么 IList <DDocInfo> hotList = ds.DDocInfoBll.GetHotList(0, 12); PropertyBag["hotList"] = hotList; //最新文档 PropertyBag["newList"] = ds.DDocInfoBll.GetNewList(0, 10); //阅读top 10 //同hotList //新闻公告(3条系统公告) Service.Bll.User.M_MessageBLL msgBll = new TMM.Service.Bll.User.M_MessageBLL(); IList <M_Message> mlist = msgBll.GetSysMessageList(0, 3); mlist.ToList().ForEach(m => m.Content = m.Content.ReplaceEnterStr()); PropertyBag["messages"] = mlist; UserService us = Context.GetService <UserService>(); U_UserInfo u = base.GetUser(); //账户余额 PropertyBag["accountBalance"] = us.MAccountBll.GetByUserId(u.UserId).Amount; //最近账单 PropertyBag["billList"] = os.MAccountLogBll.GetList(u.UserId, 0, 3); //可能喜欢的文档 //获取最近一条购买记录 IList <MPurchase> purchaseList = us.MPurchaseBll.GetList(u.UserId, 0, 1); if (purchaseList == null || purchaseList.Count == 0) { PropertyBag["maybeLikeList"] = ds.DDocInfoBll.GetRecommendList(0, 12); } else { MPurchase mp = purchaseList[0]; Core.Search.Index si = new TMM.Core.Search.Index(); si.TableName = "vwDocInfo"; ArrayList maybeLike = si.SearchMaybeLike(mp.Title, 0, 12, mp.DocId); if (maybeLike.Count < 12) { maybeLike.AddRange(ds.DDocInfoBll.GetRecommendList(0, 12 - maybeLike.Count).ToArray()); } PropertyBag["maybeLikeList"] = maybeLike; } RenderView("LogonDefault"); }
public void Index(string key,int? first,string docType) { if (!first.HasValue) first = 0; int rows = 10; int count = 0; DocService ds = Context.GetService<DocService>(); if(!string.IsNullOrEmpty(key)) { //IList<DDocInfo> list = ds.DDocInfoBll.GetList(key, first.Value, rows, out count); Core.Search.Index sIndexer = new TMM.Core.Search.Index(); sIndexer.TableName = "vwDocInfo"; sIndexer.DocType = docType; long timeCost = 0; IList list = sIndexer.Search(key, first.Value, rows, out count, out timeCost); ListPage lp = new ListPage((IList)list,first.Value,rows,count); PropertyBag["lp"] = lp; PropertyBag["seconds"] = string.Format("{0:F3}", decimal.Parse(timeCost.ToString()) / 1000); } }
public void Index(string key, int?first, string docType) { if (!first.HasValue) { first = 0; } int rows = 10; int count = 0; DocService ds = Context.GetService <DocService>(); if (!string.IsNullOrEmpty(key)) { //IList<DDocInfo> list = ds.DDocInfoBll.GetList(key, first.Value, rows, out count); Core.Search.Index sIndexer = new TMM.Core.Search.Index(); sIndexer.TableName = "vwDocInfo"; sIndexer.DocType = docType; long timeCost = 0; IList list = sIndexer.Search(key, first.Value, rows, out count, out timeCost); ListPage lp = new ListPage((IList)list, first.Value, rows, count); PropertyBag["lp"] = lp; PropertyBag["seconds"] = string.Format("{0:F3}", decimal.Parse(timeCost.ToString()) / 1000); } }
public void MyDefault() { if (!base.IsLogin) Redirect("/index.html"); SystemService sysService = Context.GetService<SystemService>(); DocService ds = Context.GetService<DocService>(); OrderService os = Context.GetService<OrderService>(); PropertyBag["firstCatalog"] = sysService.SCatalogBll.GetTopNode(); //大家在阅读什么 IList<DDocInfo> hotList = ds.DDocInfoBll.GetHotList(0, 12); PropertyBag["hotList"] = hotList; //最新文档 PropertyBag["newList"] = ds.DDocInfoBll.GetNewList(0, 10); //阅读top 10 //同hotList //新闻公告(3条系统公告) Service.Bll.User.M_MessageBLL msgBll = new TMM.Service.Bll.User.M_MessageBLL(); IList<M_Message> mlist = msgBll.GetSysMessageList(0, 3); mlist.ToList().ForEach(m => m.Content = m.Content.ReplaceEnterStr()); PropertyBag["messages"] = mlist; UserService us = Context.GetService<UserService>(); U_UserInfo u = base.GetUser(); //账户余额 PropertyBag["accountBalance"] = us.MAccountBll.GetByUserId(u.UserId).Amount; //最近账单 PropertyBag["billList"] = os.MAccountLogBll.GetList(u.UserId, 0, 3); //可能喜欢的文档 //获取最近一条购买记录 IList<MPurchase> purchaseList = us.MPurchaseBll.GetList(u.UserId, 0, 1); if (purchaseList == null || purchaseList.Count == 0) { PropertyBag["maybeLikeList"] = ds.DDocInfoBll.GetRecommendList(0, 12); } else { MPurchase mp = purchaseList[0]; Core.Search.Index si = new TMM.Core.Search.Index(); si.TableName = "vwDocInfo"; ArrayList maybeLike = si.SearchMaybeLike(mp.Title, 0, 12, mp.DocId); if (maybeLike.Count < 12) { maybeLike.AddRange(ds.DDocInfoBll.GetRecommendList(0, 12 - maybeLike.Count).ToArray()); } PropertyBag["maybeLikeList"] = maybeLike; } RenderView("LogonDefault"); }