Ejemplo n.º 1
0
 public BaseObject InsertArticle(ArticleEntity param)
 {
     using (ArticleLogic logic = new ArticleLogic())
     {
         return(logic.InsertArticle(param));
     }
 }
Ejemplo n.º 2
0
 public List <DocumentEntity> GetDocumentList(GetReportDataParams param, out int totalCount)
 {
     using (ArticleLogic logic = new ArticleLogic())
     {
         return(logic.GetDocumentList(param, out totalCount));
     }
 }
Ejemplo n.º 3
0
 public List <ArticleList> GetHomeArticleList(int id)
 {
     using (ArticleLogic logic = new ArticleLogic())
     {
         return(logic.GetHomeArticleList(id));
     }
 }
Ejemplo n.º 4
0
 public BaseObject DelDocument(int id)
 {
     using (ArticleLogic logic = new ArticleLogic())
     {
         return(logic.DelDocument(id));
     }
 }
Ejemplo n.º 5
0
 public BaseObject UpdateDocument(DocumentEntity param)
 {
     using (ArticleLogic logic = new ArticleLogic())
     {
         return(logic.UpdateDocument(param));
     }
 }
Ejemplo n.º 6
0
 public DocumentEntity GetDocumentByID(int id)
 {
     using (ArticleLogic logic = new ArticleLogic())
     {
         return(logic.GetDocumentByID(id));
     }
 }
Ejemplo n.º 7
0
 public List <HomeHotEntity> GetHomeHotList(string type)
 {
     using (ArticleLogic logic = new ArticleLogic())
     {
         return(logic.GetHomeHotList(type));
     }
 }
Ejemplo n.º 8
0
 public BaseObject UpdateArticleImage(ArticleImageEntity param)
 {
     using (ArticleLogic logic = new ArticleLogic())
     {
         return(logic.UpdateArticleImage(param));
     }
 }
Ejemplo n.º 9
0
        /// <summary>
        /// 获取资讯信息
        /// </summary>
        public void GetArticleInfo()
        {
            int articleId = GetFormValue("articleId", 0);
            var data      = ArticleLogic.GetModel(articleId);

            json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.OK, data));
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 编辑资讯
        /// </summary>
        private void EditArticle()
        {
            int ArticleId = GetFormValue("articleid", 0);
            //方便测试,此处门店ID写死,真实逻辑是,根据当前登录的门店账户,获取门店ID
            bool flag = ArticleLogic.EditArticle(new ArticleModel()
            {
                ArticleId      = GetFormValue("articleid", 0),
                ArticleIntro   = HttpUtility.UrlDecode(GetFormValue("intro", "")),
                ArticleTitle   = HttpUtility.UrlDecode(GetFormValue("title", "")),
                EnableTop      = GetFormValue("top", 0),
                EnablePublish  = GetFormValue("publish", 0),
                ArticleCover   = GetFormValue("cover", ""),
                ArticleBody    = HttpUtility.UrlDecode(GetFormValue("content", "")),
                SendTargetId   = GetFormValue("targetid", 0),
                ArticleSort    = 0,
                ArticleStatus  = user.UserIndentity == 0 ? 1 : 0,
                AuthorName     = user.UserName,
                AuthorId       = user.ID,
                AuthorIdentity = user.UserIndentity,
                PublishTime    = DateTime.Now,
                TopTime        = DateTime.Now
            });

            if (flag)
            {
                json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.OK));
            }
            else
            {
                json = JsonHelper.JsonSerializer(new ResultModel(ArticleId > 0 ? ApiStatusCode.更新失败 : ApiStatusCode.添加失败));
            }
        }
Ejemplo n.º 11
0
 public FormComment(ArticleLogic logicA, UserLogic logicU, CommentLogic logicC)
 {
     InitializeComponent();
     this.logicA = logicA;
     this.logicC = logicC;
     this.logicU = logicU;
 }
Ejemplo n.º 12
0
        public List <TimelineArticle> GetTimelineArticle([FromRoute] string word,
                                                         [FromQuery] string articleTypes,
                                                         [FromQuery] string politicalSpectrum,
                                                         [FromQuery] int page            = 1,
                                                         [FromQuery] int pageSize        = 20,
                                                         [FromQuery] string letterFilter = null,
                                                         [FromQuery] DateTime?startDate  = null,
                                                         [FromQuery] DateTime?endDate    = null)
        {
            var articleTypeList = new List <int>();

            if (articleTypes != null)
            {
                articleTypeList = articleTypes.Split("|").Select(Int32.Parse).ToList();
            }

            var politicalSpectrumList = new List <int>();

            if (politicalSpectrum != null)
            {
                politicalSpectrumList = politicalSpectrum.Split("|").Select(Int32.Parse).ToList();
            }

            var articleLogic = new ArticleLogic(Cache);

            List <TimelineArticle> orderedList = articleLogic.GetArticlesFromSearchString(word, page, pageSize, articleTypeList, politicalSpectrumList, letterFilter, startDate, endDate);

            return(orderedList);
        }
Ejemplo n.º 13
0
 public FormArticle(ArticleLogic logicA, UserLogic logicU, CategoryLogic logicC)
 {
     InitializeComponent();
     this.logicA = logicA;
     this.logicC = logicC;
     this.logicU = logicU;
 }
Ejemplo n.º 14
0
 public BaseObject DeleteArticleImage(int id)
 {
     using (ArticleLogic logic = new ArticleLogic())
     {
         return(logic.DeleteArticleImage(id));
     }
 }
Ejemplo n.º 15
0
        /// <summary>
        /// 修改状态
        /// </summary>
        private void UpdateArticleCode()
        {
            int    articleId = GetFormValue("articleId", 0);
            int    type      = GetFormValue("type", 0);//1修改置顶,2修改发布,3,删除 ,4审核
            int    active    = GetFormValue("active", 0);
            string remark    = GetFormValue("remark", "");

            bool flag = false;

            if (type == 1)//置顶
            {
                flag = ArticleLogic.SetArticleEnableTop(articleId, active == 1);
            }
            else if (type == 2)//发布
            {
                flag = ArticleLogic.SetArticleEnablePublish(articleId, active == 1);
            }
            else if (type == 3)//删除
            {
                flag = ArticleLogic.DeleteArticle(articleId);
            }
            else if (type == 4)//删除
            {
                flag = ArticleLogic.SetArticleStatus(articleId, active, remark);
            }

            if (flag)
            {
                json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.OK));
            }
            else
            {
                json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.更新失败));
            }
        }
Ejemplo n.º 16
0
 public ArticleImageEntity GetArticleImageByID(int id)
 {
     using (ArticleLogic logic = new ArticleLogic())
     {
         return(logic.GetArticleImageByID(id));
     }
 }
Ejemplo n.º 17
0
 public List <ArticleImageEntity> GetArticleImageList(GetReportDataParams param, out int totalCount)
 {
     using (ArticleLogic logic = new ArticleLogic())
     {
         return(logic.GetArticleImageList(param, out totalCount));
     }
 }
Ejemplo n.º 18
0
 public HomeController(ILogger <HomeController> logger,
                       ArticleLogic articleLogic,
                       IOptions <RedisContextConfig> redisOptions,
                       IOptions <GoogleCloudAuthConfig> gglOptions,
                       IOptions <SimpleProxyConfigs> proxyConfigs) :
     base(logger, articleLogic: articleLogic, redisOptions, gglOptions, proxyConfigs)
 {
 }
Ejemplo n.º 19
0
 public LogController(DishLogic dishLogic, GoalLogLogic goalLogLogic, FoodlogLogic foodlogLogic, WeightLogLogic weightLogLogic, ArticleLogic articleLogic, UserLogic userLogic)
 {
     _dishLogic      = dishLogic;
     _goalLogLogic   = goalLogLogic;
     _foodlogLogic   = foodlogLogic;
     _weightLogLogic = weightLogLogic;
     _articleLogic   = articleLogic;
     _userLogic      = userLogic;
 }
Ejemplo n.º 20
0
        /// <summary>
        /// 获取评论列表
        /// </summary>
        private void GetReplyMailList()
        {
            int PageIndex = GetFormValue("pageIndex", 1),
                PageSize  = GetFormValue("pageSize", 20),
                MailId    = GetFormValue("mailid", 0);
            var data      = ArticleLogic.GetReplyMailList(MailId, PageIndex, PageSize);

            json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.OK, data));
        }
Ejemplo n.º 21
0
        public ActionResult list(int identity, int pageIndex, int pageSize)
        {
            ResultPageModel data = ArticleLogic.GetAppArticleList(identity, pageIndex, pageSize, GetAuthUserId());

            Dictionary <string, object> dict = new Dictionary <string, object>();

            dict["list"] = data;
            if (pageIndex == 1 && (identity == 0 || identity == 1 || identity == 2))
            {
                dict["top"] = ArticleLogic.GetAppTopArticleList(identity);
            }
            return(Json(new ResultModel(ApiStatusCode.OK, dict)));
        }
Ejemplo n.º 22
0
        public ActionResult list(int identity, int pageIndex, int pageSize)
        {
            try
            {
                pageIndex = pageIndex > 0 ? pageIndex : 1;

                var userInfo = GetUserData();


                //当前用户所属门店ID
                int shopId = userInfo.ShopId;
                //如果当前用户所属分店,且当前其他类型为总店,那么shopid=当前用户门店所属的总店ID
                if (userInfo.ShopType == 2 && identity == 1)
                {
                    shopId = userInfo.ShopBelongId;
                }

                if (identity == 0)
                {
                    shopId = 0;
                }
                ResultPageModel data = null;// ArticleLogic.GetAppArticleList(identity, pageIndex, pageSize, userInfo.UserId, shopId, userInfo.UserIdentity);

                if (identity != 3 && identity != 4)
                {
                    data = ArticleLogic.GetAppArticleList(identity, pageIndex, pageSize, userInfo.UserId, shopId, userInfo.UserIdentity);
                }
                else
                {
                    data = ArticleLogic.GetAppMailList(1, pageIndex, pageSize, userInfo.UserId, true, true);
                }

                Dictionary <string, object> dict = new Dictionary <string, object>();
                dict["list"] = data;
                if (pageIndex == 1 && (identity == 0 || identity == 1 || identity == 2))
                {
                    dict["top"] = ArticleLogic.GetAppTopArticleList(identity, userInfo.UserIdentity, shopId);
                }
                return(Json(new ResultModel(ApiStatusCode.OK, dict)));
            }
            catch (Exception ex)
            {
                LogHelper.Log(string.Format("list:message:{0},StackTrace:{1}", ex.Message, ex.StackTrace), LogHelperTag.ERROR);
                return(Json(new ResultModel(ApiStatusCode.SERVICEERROR)));
            }
        }
Ejemplo n.º 23
0
        public List <ArticleImageEntity> GetArticleImageList(int?id)
        {
            using (ArticleLogic logic = new ArticleLogic())
            {
                GetReportExportDataParams param = new GetReportExportDataParams();
                List <KeyValue> where = new List <KeyValue>();
                if (id != null && id != 0)
                {
                    where.Add(new KeyValue {
                        Key = "ColumnID", Value = id.ToString()
                    });
                }

                param.Where = where;

                return(logic.GetArticleImageList(param));
            }
        }
Ejemplo n.º 24
0
        public ActionResult maillist(int pageIndex, int pageSize, int type, int isSend = 1)
        {
            try
            {
                pageIndex = pageIndex > 0 ? pageIndex : 1;

                var             userInfo = GetUserData();
                ResultPageModel data     = null;
                bool            isPush   = isSend == 1;
                data = ArticleLogic.GetAppMailList(type, pageIndex, pageSize, userInfo.UserId, isPush);

                return(Json(new ResultModel(ApiStatusCode.OK, data)));
            }
            catch (Exception ex)
            {
                LogHelper.Log(string.Format("list:message:{0},StackTrace:{1}", ex.Message, ex.StackTrace), LogHelperTag.ERROR);
                return(Json(new ResultModel(ApiStatusCode.SERVICEERROR)));
            }
        }
Ejemplo n.º 25
0
        private void addReply()
        {
            int    mailid   = GetFormValue("mailid", 0);
            int    SendType = GetFormValue("sendtype", 0);
            string content  = HttpUtility.UrlDecode(GetFormValue("content", ""));
            string auth     = GetFormValue("auth", "");
            string title    = HttpUtility.UrlDecode(GetFormValue("title", ""));
            int    userId   = 0;

            if (!string.IsNullOrEmpty(auth))
            {
                userId = UserLogic.GetUserIdByAuthToken(auth);
                if (userId == 0)
                {
                    json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.令牌失效));
                    return;
                }
                var user = UserLogic.GetModel(userId);


                MailModel model = new MailModel();
                model.AuthorId    = -1;
                model.AuthorName  = user.NickName;
                model.Title       = title;
                model.BodyContent = content;
                model.CoverUrl    = user.UserHeadImg;
                model.SendType    = SendType;
                model.ReplyPid    = mailid;
                model.ReplyUserId = userId;
                model.PhoneModel  = HttpUtility.UrlDecode(GetFormValue("pm", ""));
                if (ArticleLogic.AddMailInfo(model) > 0)
                {
                    //将该消息接收人的已阅读状态改为未读
                    LogLogic.UpdateMailNotReadStatus(userId, mailid);
                    json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.OK));
                }
            }
            else
            {
                json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.令牌失效));
            }
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 获取资讯列表
        /// </summary>
        public void GetArticleList()
        {
            SearchModel model = new SearchModel()
            {
                PageIndex  = Convert.ToInt32(GetFormValue("pageIndex", 1)),
                PageSize   = Convert.ToInt32(GetFormValue("pageSize", 20)),
                startTime  = GetFormValue("startTime", ""),
                endTime    = GetFormValue("endTime", ""),
                key        = GetFormValue("key", ""),
                searchType = GetFormValue("searchType", 0),
                Status     = GetFormValue("type", 1)
            };

            //作者身份类型,0集团,1总店,2分店  3盟主 4盟友
            //AuthorIdentity 根据作者ID来判断作者身份

            int AuthorIdentity = user.UserIndentity;
            int AuthorId       = user.ID;
            var data           = ArticleLogic.GetArticleList(AuthorId, AuthorIdentity, model);

            json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.OK, data));
        }
Ejemplo n.º 27
0
        public ActionResult Remind()
        {
            try
            {
                var user = GetUserData();

                Dictionary <string, object> data = new Dictionary <string, object>();

                //我的留言未读数量
                data["messageCount"] = ArticleLogic.GetNotReadMessageCount(user.UserId, 2);
                //我的消息-发送消息未读数量
                data["messagePushCount"] = ArticleLogic.GetNotReadMessageCount(user.UserId, 0);
                //我的消息-接收消息未读数量
                data["messagePullCount"] = ArticleLogic.GetNotReadMessageCount(user.UserId, 1);

                bool isbusiness = false;
                if (user.UserIdentity == 1)
                {
                    //客户数量
                    int customerAmount = CustomerLogic.GetCustomerCount(user.UserId, user.UserIdentity, 0);
                    //兑换数量
                    int exchangeAmount = UserLogic.GetConvertCount(user.UserId, 0);

                    int allyApplyAmount = UserLogic.AllyApplyCount(user.UserId);
                    if (customerAmount > 0 || exchangeAmount > 0 || allyApplyAmount > 0)
                    {
                        isbusiness = true;
                    }
                }
                data["businessRemind"] = isbusiness;
                return(Json(new ResultModel(ApiStatusCode.OK, data)));
            }
            catch (Exception ex)
            {
                LogHelper.Log(string.Format("Remind user:message:{0},StackTrace:{1}", ex.Message, ex.StackTrace), LogHelperTag.ERROR);
                return(Json(new ResultModel(ApiStatusCode.SERVICEERROR)));
            }
        }
Ejemplo n.º 28
0
        public List <Article> GetAllResourcesFromFeed(Rssfeeds foundFeed)
        {
            List <Article> articleList = new List <Article>();

            if (!string.IsNullOrEmpty(foundFeed.FeedLink))
            {
                var articleLogic = new ArticleLogic(Cache);

                var feedArticles = articleLogic.CheckNewsEntityForArticles(foundFeed);

                articleList.AddRange(feedArticles);
            }

            if (!string.IsNullOrEmpty(foundFeed.VideoLink))
            {
                var newYouTubeLogic = new YouTubeLogic(Configuration, Cache);

                var vidList = newYouTubeLogic.CheckNewsEntityForVideos(foundFeed);

                articleList.AddRange(vidList);
            }

            return(articleList);
        }
Ejemplo n.º 29
0
        public new void ProcessRequest(HttpContext context)
        {
            int    articleId = GetFormValue("articleId", 0);
            string auth      = GetFormValue("auth", "");
            string json      = string.Empty;
            int    userId    = 0;

            if (!string.IsNullOrEmpty(auth))
            {
                userId = UserLogic.GetUserIdByAuthToken(auth);
            }
            else
            {
                json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.令牌失效));
                context.Response.ContentType = "application/json";
                context.Response.Write(json);
            }
            ArticleModel data = ArticleLogic.GetModel(articleId);

            json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.OK, data));


            //相同的资讯是否被一个人浏览(cookie + Ip)
            string clientip = GetClientIP;
            string cookie   = CookieHelper.GetCookieVal("HOTBMUSER");

            if (cookie == "")
            {
                cookie = Guid.NewGuid().ToString("n");
                CookieHelper.SetCookieValByCurrentDomain("HOTBMUSER", 1, cookie);
            }
            if (cookie.Length != 32)
            {
                goto Finish;
            }

            ReadLogModel logModel = new ReadLogModel()
            {
                UserId    = userId,
                cookie    = cookie,
                ClientIp  = clientip,
                ArticleId = articleId,
                IsRead    = 1,
                ReadTime  = DateTime.Now
            };
            int type = data.AuthorIdentity;

            //判断是否已经阅读
            if (!LogLogic.IsRead(articleId, type, userId, cookie, clientip))
            {
                //添加阅读日志
                if (type == 3 || type == 4)
                {
                    LogLogic.UpdateReadStatus(userId, articleId);
                }
                else
                {
                    LogLogic.AddReadLog(logModel);
                }

                ArticleLogic.UpdateArticleAmount(articleId);
            }

            goto Finish;

Finish:
            context.Response.ContentType = "application/json";
            context.Response.Write(json);
        }
Ejemplo n.º 30
0
 public FormArticles(ArticleLogic logic)
 {
     InitializeComponent();
     this.logic = logic;
 }