username@email.com
1 天以前 eb07d0be014b11568d4263b470d46b5cd427fe9b
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")