/// <summary> /// 保存不确定度 /// </summary> /// <param name="HTMLVALUE">html</param> /// <param name="URL">不确定计算存储地址</param> /// <returns></returns> public ActionResult JiSuanBuQueDingDuSave(string HTMLVALUE = "", string URL = "") { Common.ClientResult.Result result = new Common.ClientResult.Result(); try { URL = GetBuQueDingDuUrl(URL); if (DirFile.FileExists(URL)) { DirFile.DeleteFile(URL); } HTMLVALUE = Server.UrlDecode(HTMLVALUE); //解码 DirFile.SaveFile(HTMLVALUE, URL); LogClassModels.WriteServiceLog(Suggestion.InsertSucceed + Url, "不确定度计算"); //写入日志 result.Code = Common.ClientCode.Succeed; result.Message = URL; return(Json(result)); //提示创建成功 } catch (Exception ex) { LogClassModels.WriteServiceLog(Suggestion.InsertFail + Url + ":" + ex.Message, "不确定度计算");//写入日志 result.Code = Common.ClientCode.Fail; result.Message = Suggestion.InsertFail + ex.Message; return(Json(result)); //提示插入失败 } }
/// <summary> /// 获取不确定路径 /// </summary> /// <param name="RULEID">检测项目ID</param> /// <returns></returns> private string GetBuQueDingDuUrl(string URL) { string htmlValue = ""; if (!string.IsNullOrWhiteSpace(URL) && DirFile.FileExists(URL)) { htmlValue = DirFile.ReadFile(URL); } else { URL = "/up/BuQueDingDu/" + Result.GetNewId() + ".html"; } return(URL); }
/// <summary> /// 计算不确定度页 /// </summary> /// <param name="ID">控件ID</param> /// <param name="RULEID">检测项目ID</param> /// <param name="PREPARE_SCHEMEID">预备方案ID</param> /// <returns></returns> public ActionResult JiSuanBuQueDingDu(string ID = "", string RULEID = "", string PREPARE_SCHEMEID = "", string URL = "") { Common.Account account = GetCurrentAccount(); if (string.IsNullOrWhiteSpace(URL) || URL.Trim() == "") { URL = GetBuQueDingDuUrl(URL); } string htmlValue = ""; if (DirFile.FileExists(URL)) { htmlValue = DirFile.ReadFile(URL); } ViewBag.ID = ID; ViewBag.RULEID = RULEID; ViewBag.HTMLVALUE = htmlValue; ViewBag.PREPARE_SCHEMEID = PREPARE_SCHEMEID; ViewBag.URL = URL; ViewBag.UNDERTAKE_LABORATORY_NAME = account.UNDERTAKE_LABORATORYName; return(View()); }