From eb07d0be014b11568d4263b470d46b5cd427fe9b Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期四, 17 七月 2025 08:49:45 +0800
Subject: [PATCH] 送货费用

---
 CY_ECommercePlatform/CY.WebForm/Pages/work/MyBaoxiaoAdd.aspx.cs |   87 ++++++++++++++++++++++++++++++-------------
 1 files changed, 61 insertions(+), 26 deletions(-)

diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/work/MyBaoxiaoAdd.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/work/MyBaoxiaoAdd.aspx.cs
index 191f94b..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
 {
@@ -86,15 +88,15 @@
                     selSubject.Disabled = true;
                     txtPlanContent.Disabled = true;
                     selHoubufapiaoStatus.Disabled = true;
-                    this.Button1.Enabled = false;
+                    this.Button3.Enabled = false;
                     this.Button2.Enabled = false;
                 }
 
                 if (!string.IsNullOrEmpty(Request["zaici"]))
                 {
-                    this.Button1.Enabled = false;
+                    this.Button3.Enabled = false;
                     this.Button2.Enabled = false;
-                    this.btn_submit.Text = "鍐嶆鎻愪氦";
+                    this.Button1.Text = "鍐嶆鎻愪氦";
                 }
 
                 if (m_OA_WorkPlan != null)
@@ -120,14 +122,14 @@
         }
 
         //琛ㄥ崟鎻愪氦
-        protected void btn_submit_form(object sender, EventArgs e)
+        protected void btn_baocun_form(object sender, EventArgs e)
         {
              var HideKeyidFapiao = Request["HideKeyidFapiao"].Split(',');
-                if(HideKeyidFapiao.Length<=1 && this.selHoubufapiaoStatus.Value  == "1")
-                {
-                    JavaScript.MessageBox("閫夋嫨鏈夊彂绁ㄥ繀椤讳笂浼犲彂绁�", this);
-                    return;
-                }
+            if (HideKeyidFapiao.Length <= 1 && this.selHoubufapiaoStatus.Value == "1")
+            {
+                JavaScript.MessageBox("閫夋嫨鏈夊彂绁ㄥ繀椤讳笂浼犲彂绁�", this);
+                return;
+            }
 
             using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required,
      new TransactionOptions
@@ -187,28 +189,61 @@
                             m_OA_WorkPlan.ApprovalStatus = 0;
                         }
                     }
-                  
+
+                    //if (string.IsNullOrEmpty(m_OA_WorkPlan.EvaluationContent))
+                    //{
+                    //    using (var client = new HttpClient())
+                    //    {
+                    //        HttpResponseMessage response = client.GetAsync(url).Result;
+                    //        response.EnsureSuccessStatusCode();
+                    //        string responseBody = response.Content.ReadAsStringAsync().Result;
+                    //        JavaScriptSerializer serializer = new JavaScriptSerializer();
+                    //        var person = serializer.Deserialize<Responsebody>(responseBody);
+                    //        if (person != null && person.code == 1)
+                    //        {
+                    //            m_OA_WorkPlan.EvaluationContent = person.data;
+                    //        }
+                    //        else
+                    //        {
+                    //            JavaScript.MessageBox("鐢熸垚鎶ラ攢鍗曞彿澶辫触", this);
+                    //            return;
+                    //        }
+                    //    }
+                    //}
                     if (string.IsNullOrEmpty(m_OA_WorkPlan.EvaluationContent))
                     {
-                        using (var client = new HttpClient())
+                        try
                         {
-                            HttpResponseMessage response = client.GetAsync(url).Result;
-                            response.EnsureSuccessStatusCode();
-                            string responseBody = response.Content.ReadAsStringAsync().Result;
-                            JavaScriptSerializer serializer = new JavaScriptSerializer();
-                            var person = serializer.Deserialize<Responsebody>(responseBody);
-                            if (person != null && person.code == 1)
+                            var request = (HttpWebRequest)WebRequest.Create(url);
+                            request.Method = "GET";
+
+                            using (var response = (HttpWebResponse)request.GetResponse())
                             {
-                                m_OA_WorkPlan.EvaluationContent = person.data;
-                            }
-                            else
-                            {
-                                JavaScript.MessageBox("鐢熸垚鎶ラ攢鍗曞彿澶辫触", this);
-                                return;
+                                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;
+                                    }
+                                }
                             }
                         }
-                    }
-                    //m_OA_WorkPlan.EvaluationContent = "";
+                        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());
@@ -390,7 +425,7 @@
 
 
         //琛ㄥ崟淇濆瓨
-        protected void btn_baocun_form(object sender, EventArgs e)
+        protected void btn_tijiao_form(object sender, EventArgs e)
         {
             var HideKeyidFapiao = Request["HideKeyidFapiao"].Split(',');
             //if (HideKeyidFapiao.Length <= 1 && this.selHoubufapiaoStatus.Value == "1")

--
Gitblit v1.9.1