From bfc949d16c2244e03280411d340e9e27ace3d5c4 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期一, 23 六月 2025 12:18:24 +0800 Subject: [PATCH] no message --- CY_ECommercePlatform/CY.WebForm/Pages/work/MyBaoxiaoAdd.aspx.cs | 39 +++++++++++++++++++++++++++++++++++++-- 1 files changed, 37 insertions(+), 2 deletions(-) diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/work/MyBaoxiaoAdd.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/work/MyBaoxiaoAdd.aspx.cs index 64bd565..93a0198 100644 --- a/CY_ECommercePlatform/CY.WebForm/Pages/work/MyBaoxiaoAdd.aspx.cs +++ b/CY_ECommercePlatform/CY.WebForm/Pages/work/MyBaoxiaoAdd.aspx.cs @@ -17,6 +17,8 @@ using System.Transactions; using System.Net.Http; using System.Web.Script.Serialization; +using System.Net; +using System.IO; namespace CY.WebForm.Pages.work { @@ -187,7 +189,7 @@ m_OA_WorkPlan.ApprovalStatus = 0; } } - + //if (string.IsNullOrEmpty(m_OA_WorkPlan.EvaluationContent)) //{ // using (var client = new HttpClient()) @@ -208,7 +210,40 @@ // } // } //} - m_OA_WorkPlan.EvaluationContent = this.txtEvaluationContent.Value; + if (string.IsNullOrEmpty(m_OA_WorkPlan.EvaluationContent)) + { + try + { + var request = (HttpWebRequest)WebRequest.Create(url); + request.Method = "GET"; + + using (var response = (HttpWebResponse)request.GetResponse()) + { + using (var reader = new StreamReader(response.GetResponseStream())) + { + string content = reader.ReadToEnd(); + JavaScriptSerializer serializer = new JavaScriptSerializer(); + var person = serializer.Deserialize<Responsebody>(content); + if (person != null && person.code == 1) + { + m_OA_WorkPlan.EvaluationContent = person.data; + } + else + { + JavaScript.MessageBox("鐢熸垚鎶ラ攢鍗曞彿澶辫触", this); + return; + } + } + } + } + catch (Exception ex) + { + JavaScript.MessageBox("鐢熸垚鎶ラ攢鍗曞彿澶辫触", this); + return; + } + } + + //m_OA_WorkPlan.EvaluationContent = this.txtEvaluationContent.Value; m_OA_WorkPlan.RewardResult = this.selSubject.Value; var a_SubjectSet = _OA_SubjectSetBLL.getSingleSubject(this.selSubject.Value.ToInt32()); -- Gitblit v1.9.1