Ejemplo n.º 1
0
        public ActionResult DownLoadKnowlegeList(KnowlegeModel model)
        {
            _ilog.Info(string.Format("方法名:{0};参数:{1}", "DownLoadKnowlegeList", Serializer.ToJson(model)));

            var result = new StandardJsonResult <dynamic>();

            result.Try(() =>
            {
                if (!ModelState.IsValid)
                {
                    throw new KnownException(ModelState.GetFirstError());
                }
                var knowlege = service.MakeUrlWithFileName(model.FileName);

                result.Value = new { FileUrl = knowlege };
            });
            _ilog.Info(string.Format("方法名:{0};执行结果:{1}", "DownLoadKnowlegeList", Serializer.ToJson(result)));
            return(result);
        }
Ejemplo n.º 2
0
        public ActionResult GetKnowlegeList(KnowlegeModel model)
        {
            _ilog.Info(string.Format("方法名:{0};参数:{1}", "GetKnowledgeList", Serializer.ToJson(model)));

            var result = new StandardJsonResult <dynamic>();

            result.Try(() =>
            {
                if (!ModelState.IsValid)
                {
                    throw new KnownException(ModelState.GetFirstError());
                }
                var knowlegelist = service.GetAllKnowlege(BCSession.User.EnterpriseID);

                result.Value = new { KnowlegeList = knowlegelist };
            });
            _ilog.Info(string.Format("方法名:{0};执行结果:{1}", "GetKnowledgeList", Serializer.ToJson(result)));
            return(result);
        }