Exemplo n.º 1
0
 public ActionResult knowview()
 {
     dynamic data = new System.Dynamic.ExpandoObject();
     string guid = WebRequest.GetString("guid", true);
     ReturnValue r = new ReturnValue();
     KnewledgeBase one = new KnewledgeBase();
     string type = "";
     string unitname = "";
     string filepath = "";
     try
     {
         one = diagnosticService.GetOneKnewledgeBase(Guid.Parse(guid));
         var category = diagnosticService.Knowledgebasecategory();
         if (one != null)
         {
             bool f = FileHelper.IsFileExist(ConfigurationManager.AppSettings["CustomerRes"] + Masterpage.CurrUser.client_code + "/files/knewledgebase/" + one.KnowledgeBaseUrl);
             if (f)
             {
                 var h = category.FirstOrDefault(p => p.value == one.KnowledgeBaseCategory);
                 if (h != null) type = h.text;
                 diagnosticService.ReadOneKnewledge(Guid.Parse(guid));
                 if (one.StandardProcessUnit != null) unitname = one.StandardProcessUnit.StandardProcessUnitName;
                 filepath = ConfigurationManager.AppSettings["VirtualRes"] + Masterpage.CurrUser.client_code + "/files/knewledgebase/" + one.KnowledgeBaseUrl;
                 r.message = "";
                 r.status = "ok";
                 LogHelper.Info(Masterpage.CurrUser.alias, "803034:客户," + Masterpage.CurrUser.client_code + ",查看知识库信息,对应guid为:" + guid + ",访谈录路径为:" + filepath);
             }
             else
             {
                 LogHelper.Info(Masterpage.CurrUser.alias, "803034:客户," + Masterpage.CurrUser.client_code + ",查看知识库信息,对应guid为:" + guid + "失败,文件不存在," + filepath);
                 r.message = "文件不存在";
                 r.status = "error";
             }
         }
         else
         {
             LogHelper.Info(Masterpage.CurrUser.alias, "803034:客户," + Masterpage.CurrUser.client_code + ",查看知识库信息,对应guid为:" + guid + "失败,读取失败," + filepath);
             r.message = "读取失败";
             r.status = "error";
         }
     }
     catch (Exception ex)
     {
         LogHelper.Info(Masterpage.CurrUser.alias, "803034:客户," + Masterpage.CurrUser.client_code + ",查看知识库信息,对应guid为:" + guid + "失败,读取失败," + filepath + ex.Message);
         r.message = "读取失败";
         r.status = "error";
     }
     data.unitname = unitname;
     data.filepath = filepath;
     data.one = one;
     data.type = type;
     data.r = r;
     return PartialView("knowview", data);
 }
Exemplo n.º 2
0
 public ActionResult knowedit(string t, Guid guid)
 {
     ReturnValue r = new ReturnValue();
     KnewledgeBase one = new KnewledgeBase();
     var category = diagnosticService.Knowledgebasecategory();
     var units = diagnosticService.GetStandardProcessUnit();
     dynamic data = new System.Dynamic.ExpandoObject();
     try
     {
         if (!Masterpage.CurrUser.IsExpert)
         {
             LogHelper.Info(Masterpage.CurrUser.alias, "803033:客户," + Masterpage.CurrUser.client_code + ",编辑知识库" + guid + "信息失败,权限不足");
             r = new ReturnValue { status = "error", message = "权限不足!" };
         }
         else
         {
             if (t == "edit") one = diagnosticService.GetOneKnewledgeBase(guid);
             r = new ReturnValue { status = "ok" };
             LogHelper.Info(Masterpage.CurrUser.alias, "803033:客户," + Masterpage.CurrUser.client_code + ",编辑知识库" + guid + "信息");
         }
     }
     catch (Exception ex)
     {
         LogHelper.Info(Masterpage.CurrUser.alias, "803033:客户," + Masterpage.CurrUser.client_code + ",编辑知识库" + guid + "信息失败," + ex.Message);
         r = new ReturnValue { status = "error", message = "读取失败!" };
     }
     data.category = category;
     data.units = units;
     data.r = r;
     data.one = one;
     data.guid = guid;
     data.t = t;
     return PartialView("knowedit", data);
 }