コード例 #1
0
ファイル: MessageController.cs プロジェクト: uvbs/tumumi
        /// <summary>
        /// 普通消息列表
        /// </summary>
        /// <param name="direct">1:发送 2:接收</param>
        public void UserMsg(int first, int direct, string email, int userId)
        {
            //AdminService ams = Context.GetService<AdminService>();
            UserService us    = Context.GetService <UserService>();
            int         rows  = 20;
            int         count = 0;
            Hashtable   p     = new Hashtable();

            if (userId == 0 && !string.IsNullOrEmpty(email))
            {
                U_UserInfo u = us.UserInfoBll.FindUserByEmail(email);
                if (u != null)
                {
                    userId = u.UserId;
                }
            }
            if (direct == 1 && userId != 0)
            {
                p.Add("SenderId", userId);
            }
            if (direct == 2 && userId != 0)
            {
                p.Add("RecieverId", userId);
            }

            p.Add("Mtype", (int)Model.Enums.MessageType.Message);

            count = us.MessageBll.GetCount(p);
            IList <M_Message> mlist = us.MessageBll.GetList(p, null, first, rows);

            //mlist.ToList().ForEach(m => m.Content = m.Content.ReplaceEnterStr());
            Common.ListPage lp = new TMM.Core.Common.ListPage((IList)mlist, first, rows, count);
            PropertyBag["listPage"] = lp;
        }
コード例 #2
0
ファイル: MessageController.cs プロジェクト: uvbs/tumumi
        /// <summary>
        /// 用户咨询
        /// </summary>
        public void Question(int first)
        {
            int               rows  = 20;
            AdminService      ams   = Context.GetService <AdminService>();
            int               count = 0;
            IList <M_Message> mlist = ams.MessageBll.GetUserMsgList(first, rows, out count, Helper.ConfigHelper.AdminUserId);

            Common.ListPage lp = new TMM.Core.Common.ListPage((IList)mlist, first, rows, count);
            PropertyBag["listPage"] = lp;
        }
コード例 #3
0
ファイル: RewardController.cs プロジェクト: qiuliang/tumumi
 public void Index(int first)
 {
     Service.Bll.Doc.TReqDocBLL tbll = new TMM.Service.Bll.Doc.TReqDocBLL();
     Service.Bll.Doc.TJoinDocBLL tjbll = new TMM.Service.Bll.Doc.TJoinDocBLL();
     int rows = 10;
     int count = 0;
     IList<TReqDoc> list = tbll.GetList(first, rows, out count, null);
     Common.ListPage lp = new TMM.Core.Common.ListPage((IList)list, first, rows, count);
     PropertyBag["lp"] = lp;
     //排行榜
     PropertyBag["phb"] = tbll.GetList(0, 10);
     //最新中标
     PropertyBag["zxzb"] = tjbll.GetList(0, 10);
 }
コード例 #4
0
ファイル: RewardController.cs プロジェクト: uvbs/tumumi
        public void Index(int first)
        {
            Service.Bll.Doc.TReqDocBLL  tbll  = new TMM.Service.Bll.Doc.TReqDocBLL();
            Service.Bll.Doc.TJoinDocBLL tjbll = new TMM.Service.Bll.Doc.TJoinDocBLL();
            int             rows  = 10;
            int             count = 0;
            IList <TReqDoc> list  = tbll.GetList(first, rows, out count, null);

            Common.ListPage lp = new TMM.Core.Common.ListPage((IList)list, first, rows, count);
            PropertyBag["lp"] = lp;
            //排行榜
            PropertyBag["phb"] = tbll.GetList(0, 10);
            //最新中标
            PropertyBag["zxzb"] = tjbll.GetList(0, 10);
        }
コード例 #5
0
ファイル: MessageController.cs プロジェクト: uvbs/tumumi
        public void System(int first, string likeTitle)
        {
            AdminService      ams   = Context.GetService <AdminService>();
            IList <M_Message> mlist = ams.MessageBll.GetSysMessageList(first, 10);

            mlist.ToList().ForEach(m => m.Content = m.Content.ReplaceEnterStr());
            Hashtable p = new Hashtable();

            p.Add("Mtype", (int)Model.Enums.MessageType.SysMsg);
            if (!string.IsNullOrEmpty(likeTitle))
            {
                p.Add("LikeTitle", likeTitle);
            }
            int count = ams.MessageBll.GetCount(p);

            Common.ListPage lp = new TMM.Core.Common.ListPage((IList)mlist, first, 10, count);
            PropertyBag["listPage"] = lp;
        }
コード例 #6
0
ファイル: BrowseController.cs プロジェクト: qiuliang/tumumi
 /// <summary>
 /// 浏览列表页
 /// </summary>
 /// <param name="catalogId">分类ID</param>
 /// <param name="viewType">0:列表视图 1:大图视图</param>
 /// <param name="pageRange">页码范围 0:全部 1:1-8 2:9-100 3:100以上</param>
 /// <param name="docType">文档格式 0:全部 1:word 2:powerpoint 3:excel 4:pdf 5:文本格式 6:其他</param>
 /// <param name="orderNum">排序 0:浏览数 1:评论数 2:顶数 3:收藏数 4:最新上传</param>
 /// <param name="first">页码</param>
 public void Index(int catalogId,int viewType,int pageRange,int docType,int orderNum,int first)
 {
     int rows = 10;
     string strOrderBy = string.Empty;
     try
     {
         DocService ds = Context.GetService<DocService>();
         Hashtable p = new Hashtable();
         //分类列表
         PropertyBag["catalogs"] = ds.SCatalogBll.GetTopNode();
         //精品推荐
         PropertyBag["recommendList"] = ds.DDocInfoBll.GetRecommendList(0,7);
         //热门文档
         PropertyBag["hotList"] = ds.DDocInfoBll.GetHotList(0, 10);
         //文档列表
         p.Add("IsAudit",true);
         if (catalogId != 0)
         {
             int[] cateids = Utils.TmmUtils.GetSubCatalogIds(catalogId);
             if (cateids != null && cateids.Length > 0)
                 p.Add("CateIds", cateids);
             else
                 p.Add("CateId", catalogId);
         }
         if (docType != 0) {
             string[] DocTypes = GetDocTypes(docType);
             p.Add("DocTypes",DocTypes);
         }
         switch (orderNum)
         {
             case 0 :
                 strOrderBy = "ViewCount DESC";
                 break;
             case 1:
                 strOrderBy = "CommentCount DESC";
                 break;
             case 2:
                 strOrderBy = "UpCount DESC";
                 break;
             case 3:
                 strOrderBy = "FavCount DESC";
                 break;
             case 4:
                 strOrderBy = "CreateTime DESC";
                 break;
         }
         int count = ds.DDocInfoBll.GetCount(p);
         //如果超过20页,则只显示20页内容
         count = count > rows * 20 ? rows * 20 : count;
         IList<DDocInfo> list = ds.DDocInfoBll.GetList(p,strOrderBy,first,rows);
         Common.ListPage lp = new TMM.Core.Common.ListPage((IList)list, first, rows, count);
         PropertyBag["listPage"] = lp;
         //参数
         PropertyBag["catalogId"] = catalogId;
         PropertyBag["viewType"] = viewType;
         PropertyBag["pageRange"] = pageRange;
         PropertyBag["docType"] = docType;
         PropertyBag["orderNum"] = orderNum;
         PropertyBag["first"] = first;
     }
     catch (Exception ex) {
         Utils.Log4Net.Error(ex);
     }
 }
コード例 #7
0
ファイル: MessageController.cs プロジェクト: qiuliang/tumumi
        /// <summary>
        /// 普通消息列表
        /// </summary>
        /// <param name="direct">1:发送 2:接收</param>
        public void UserMsg(int first,int direct,string email,int userId)
        {
            //AdminService ams = Context.GetService<AdminService>();
            UserService us = Context.GetService<UserService>();
            int rows = 20;
            int count = 0;
            Hashtable p = new Hashtable();
            if (userId == 0 && !string.IsNullOrEmpty(email)) {
                U_UserInfo u = us.UserInfoBll.FindUserByEmail(email);
                if (u != null)
                    userId = u.UserId;
            }
            if (direct == 1 && userId != 0)
                p.Add("SenderId",userId);
            if (direct == 2 && userId != 0)
                p.Add("RecieverId",userId);

            p.Add("Mtype",(int)Model.Enums.MessageType.Message);

            count = us.MessageBll.GetCount(p);
            IList<M_Message> mlist = us.MessageBll.GetList(p, null, first, rows);
            //mlist.ToList().ForEach(m => m.Content = m.Content.ReplaceEnterStr());
            Common.ListPage lp = new TMM.Core.Common.ListPage((IList)mlist, first, rows, count);
            PropertyBag["listPage"] = lp;
        }
コード例 #8
0
ファイル: MessageController.cs プロジェクト: qiuliang/tumumi
 public void System(int first,string likeTitle)
 {
     AdminService ams = Context.GetService<AdminService>();
     IList<M_Message> mlist = ams.MessageBll.GetSysMessageList(first, 10);
     mlist.ToList().ForEach(m => m.Content = m.Content.ReplaceEnterStr());
     Hashtable p = new Hashtable();
     p.Add("Mtype",(int)Model.Enums.MessageType.SysMsg);
     if (!string.IsNullOrEmpty(likeTitle)) {
         p.Add("LikeTitle",likeTitle);
     }
     int count = ams.MessageBll.GetCount(p);
     Common.ListPage lp = new TMM.Core.Common.ListPage((IList)mlist, first, 10, count);
     PropertyBag["listPage"] = lp;
 }
コード例 #9
0
ファイル: MessageController.cs プロジェクト: qiuliang/tumumi
        /// <summary>
        /// 用户咨询
        /// </summary>
        public void Question(int first)
        {
            int rows = 20;
            AdminService ams = Context.GetService<AdminService>();
            int count = 0;
            IList<M_Message> mlist = ams.MessageBll.GetUserMsgList(first, rows, out count, Helper.ConfigHelper.AdminUserId);

            Common.ListPage lp = new TMM.Core.Common.ListPage((IList)mlist, first, rows, count);
            PropertyBag["listPage"] = lp;
        }
コード例 #10
0
ファイル: BrowseController.cs プロジェクト: uvbs/tumumi
        /// <summary>
        /// 浏览列表页
        /// </summary>
        /// <param name="catalogId">分类ID</param>
        /// <param name="viewType">0:列表视图 1:大图视图</param>
        /// <param name="pageRange">页码范围 0:全部 1:1-8 2:9-100 3:100以上</param>
        /// <param name="docType">文档格式 0:全部 1:word 2:powerpoint 3:excel 4:pdf 5:文本格式 6:其他</param>
        /// <param name="orderNum">排序 0:浏览数 1:评论数 2:顶数 3:收藏数 4:最新上传</param>
        /// <param name="first">页码</param>
        public void Index(int catalogId, int viewType, int pageRange, int docType, int orderNum, int first)
        {
            int    rows       = 10;
            string strOrderBy = string.Empty;

            try
            {
                DocService ds = Context.GetService <DocService>();
                Hashtable  p  = new Hashtable();
                //分类列表
                PropertyBag["catalogs"] = ds.SCatalogBll.GetTopNode();
                //精品推荐
                PropertyBag["recommendList"] = ds.DDocInfoBll.GetRecommendList(0, 7);
                //热门文档
                PropertyBag["hotList"] = ds.DDocInfoBll.GetHotList(0, 10);
                //文档列表
                p.Add("IsAudit", true);
                if (catalogId != 0)
                {
                    int[] cateids = Utils.TmmUtils.GetSubCatalogIds(catalogId);
                    if (cateids != null && cateids.Length > 0)
                    {
                        p.Add("CateIds", cateids);
                    }
                    else
                    {
                        p.Add("CateId", catalogId);
                    }
                }
                if (docType != 0)
                {
                    string[] DocTypes = GetDocTypes(docType);
                    p.Add("DocTypes", DocTypes);
                }
                switch (orderNum)
                {
                case 0:
                    strOrderBy = "ViewCount DESC";
                    break;

                case 1:
                    strOrderBy = "CommentCount DESC";
                    break;

                case 2:
                    strOrderBy = "UpCount DESC";
                    break;

                case 3:
                    strOrderBy = "FavCount DESC";
                    break;

                case 4:
                    strOrderBy = "CreateTime DESC";
                    break;
                }
                int count = ds.DDocInfoBll.GetCount(p);
                //如果超过20页,则只显示20页内容
                count = count > rows * 20 ? rows * 20 : count;
                IList <DDocInfo> list = ds.DDocInfoBll.GetList(p, strOrderBy, first, rows);
                Common.ListPage  lp   = new TMM.Core.Common.ListPage((IList)list, first, rows, count);
                PropertyBag["listPage"] = lp;
                //参数
                PropertyBag["catalogId"] = catalogId;
                PropertyBag["viewType"]  = viewType;
                PropertyBag["pageRange"] = pageRange;
                PropertyBag["docType"]   = docType;
                PropertyBag["orderNum"]  = orderNum;
                PropertyBag["first"]     = first;
            }
            catch (Exception ex) {
                Utils.Log4Net.Error(ex);
            }
        }