Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            thisBookMark = new IndexBLL().GetSingBook(Request.RawUrl, LoginUserId);
            var artId = Request.QueryString["id"];

            if (!string.IsNullOrEmpty(artId))
            {
                thisArt = new DAL.sdk_kb_article_dal().FindNoDeleteById(long.Parse(artId));
            }
            long reqAddTicId = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["ticketId"]) && long.TryParse(Request.QueryString["ticketId"], out reqAddTicId))
            {
                kbTicketList = new List <sdk_kb_article_ticket>()
                {
                    new sdk_kb_article_ticket()
                    {
                        task_id = reqAddTicId
                    },
                }
            }
            ;
            if (thisArt != null)
            {
                isAdd = false;
                if (thisArt.account_id != null)
                {
                    thisAccount = new CompanyBLL().GetCompany((long)thisArt.account_id);
                }
                objectId     = thisArt.id;
                thisNoteAtt  = new DAL.com_attachment_dal().GetAttListByOid(thisArt.id);
                kbTicketList = new DAL.sdk_kb_article_ticket_dal().GetArtTicket(thisArt.id);
            }
            if (!IsPostBack)
            {
            }
            else
            {
                var param  = GetParam();
                var result = new KnowledgeBLL().KnowManage(param, LoginUserId);
                ClientScript.RegisterStartupScript(this.GetType(), "刷新父页面", $"<script>self.opener.location.reload();</script>");
                ClientScript.RegisterStartupScript(this.GetType(), "提示信息", $"<script>alert('保存{(result ? "成功" : "失败")}!');</script>");
                var saveType = Request.Form["SaveType"];
                if (saveType == "SaveClose")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "跳转操作", $"<script>window.close();</script>");
                }
                else if (saveType == "Save")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "跳转操作", $"<script>location.href='AddRepository?id={param.thisArt.id}';</script>");
                }
            }
        }
Example #2
0
        /// <summary>
        /// 新增知识库
        /// </summary>
        public void AddKnow(sdk_kb_article thisArt, long userId)
        {
            var timeNow = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);

            thisArt.id             = _dal.GetNextIdCom();
            thisArt.create_time    = timeNow;
            thisArt.update_time    = timeNow;
            thisArt.create_user_id = userId;
            thisArt.update_user_id = userId;
            _dal.Insert(thisArt);
            OperLogBLL.OperLogAdd <sdk_kb_article>(thisArt, thisArt.id, userId, OPER_LOG_OBJ_CATE.SDK_KONWLEDGE, "新增知识库");
        }
Example #3
0
        /// <summary>
        /// 编辑知识库
        /// </summary>
        public bool UpdateKnow(sdk_kb_article thisArt, long userId)
        {
            var oldArt = _dal.FindNoDeleteById(thisArt.id);

            if (oldArt == null)
            {
                return(false);
            }
            thisArt.update_time    = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
            thisArt.update_user_id = userId;
            _dal.Update(thisArt);
            OperLogBLL.OperLogUpdate <sdk_kb_article>(thisArt, oldArt, thisArt.id, userId, OPER_LOG_OBJ_CATE.SDK_KONWLEDGE, "编辑知识库");
            return(true);
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var artId = Request.QueryString["id"];
                if (!string.IsNullOrEmpty(artId))
                {
                    thisArt = new DAL.sdk_kb_article_dal().FindNoDeleteById(long.Parse(artId));
                }
                if (thisArt == null)
                {
                    Response.Write($"<script>alert('未查询到该知识库!');window.close();</script>");
                    return;
                }
                var dgDal = new DAL.d_general_dal();
                cataString = new KnowledgeBLL().GetCateString(thisArt.kb_category_id, cataString);
                if (!string.IsNullOrEmpty(cataString))
                {
                    cataString = cataString.Substring(0, cataString.Length - 1);
                }
                publish     = dgDal.FindNoDeleteById((long)thisArt.publish_to_type_id);
                creater     = srDal.FindById(thisArt.create_user_id);
                update      = srDal.FindById(thisArt.update_user_id);
                ticList     = new DAL.sdk_kb_article_ticket_dal().GetArtTicket(thisArt.id);
                thisNoteAtt = new DAL.com_attachment_dal().GetAttListByOid(thisArt.id);
                commList    = new DAL.sdk_kb_article_comment_dal().GetCommByArt(thisArt.id);

                var history = new sys_windows_history()
                {
                    title = "知识库文档:" + thisArt.title,
                    url   = Request.RawUrl,
                };
                new IndexBLL().BrowseHistory(history, LoginUserId);
            }
            catch (Exception msg)
            {
                Response.Write($"<script>alert('{msg.Message}');window.close();</script>");
            }
        }