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>"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var cateType = Request.QueryString["cate"]; var type = Request.QueryString["type"]; var objId = Request.QueryString["objectId"]; if (string.IsNullOrEmpty(cateType) || string.IsNullOrEmpty(type) || string.IsNullOrEmpty(objId)) { Response.Close(); return; } cate = long.Parse(cateType); objType = int.Parse(type); objectId = long.Parse(objId); level = int.Parse(Request.QueryString["level"]); var actList = new DAL.d_general_dal().GetGeneralByTableId((int)GeneralTableEnum.ACTION_TYPE); if (actList != null && actList.Count > 0) { ticketNoteTypeList = actList.Where(_ => _.ext2 == ((int)DicEnum.ACTIVITY_CATE.TASK_NOTE).ToString()).ToList(); } if (!string.IsNullOrEmpty(Request.QueryString["ticket_id"])) { isTicket = true; } //if (actType == (int)DicEnum.OBJECT_TYPE.CUSTOMER || actType == (int)DicEnum.OBJECT_TYPE.CONTACT // || actType == (int)DicEnum.OBJECT_TYPE.OPPORTUNITY || actType == (int)DicEnum.OBJECT_TYPE.SALEORDER) //{ // var parentNote = bll.GetActivity(parentId); // if (parentNote.parent_id != null) // parentNote = bll.GetActivity((long)parentNote.parent_id); // if (parentNote.resource_id != null) // resouceName = new UserResourceBLL().GetSysResourceSingle((long)parentNote.resource_id).name; //} } else { objectId = long.Parse(Request.Form["objectId"]); cate = long.Parse(Request.Form["cate"]); objType = int.Parse(Request.Form["objType"]); level = int.Parse(Request.Form["level"]); bool isNotify = false; var ticketNoteType = Request.Form["ticketNoteType"]; var inter = !string.IsNullOrEmpty(Request.Form["inter"]) && Request.Form["inter"].Equals("on"); if (!string.IsNullOrEmpty(Request.Form["isNotify"]) && Request.Form["isNotify"].Equals("on")) { isNotify = true; } if (bll.FastAddNote(objType, objectId, cate, level, Request.Form["desc"], isNotify, GetLoginUserId(), ticketNoteType, inter, Request.QueryString["ticket_id"])) { var func = Request.QueryString["func"]; if (!string.IsNullOrEmpty(func)) { Response.Write($"<script>alert('添加备注成功');window.close();self.opener.{func}();</script>"); } else { Response.Write("<script>alert('添加备注成功');window.close();self.opener.RequestActivity();</script>"); } } else { Response.Write("<script>alert('添加备注失败');</script>"); } } }