From ba381be6a5aac58df11e2e7b6b19f012bd9ff5a1 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期三, 04 十二月 2024 10:34:30 +0800 Subject: [PATCH] 开票申请 --- CY_ECommercePlatform/CY.WebForm/Pages/business/OrderKehuqianshou.aspx.cs | 141 +++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 123 insertions(+), 18 deletions(-) diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/OrderKehuqianshou.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/business/OrderKehuqianshou.aspx.cs index 207cc6c..ba678ba 100644 --- a/CY_ECommercePlatform/CY.WebForm/Pages/business/OrderKehuqianshou.aspx.cs +++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/OrderKehuqianshou.aspx.cs @@ -12,21 +12,30 @@ using System.Text; using CY.BLL.OA; using CY.BLL.EC; - +using System.Collections; +using System.Globalization; +using System.IO; +using CY.Infrastructure.Configuration; namespace CY.WebForm.Pages.business { public partial class OrderKehuqianshou : BasePage { - EC_OrderBasicBLL eC_OrderBasicBLL = null; - EC_OrderBLL eC_OrderBLL = null; - OA_KaipiaoshenqingBLL OA_KaipiaoshenqingBLL = null; + private EC_OrderBLL _eC_OrderBLL = null; + + private OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = null; + private EC_OrderBasicBLL _eC_OrderBasicBLL = null; + + + private OA_StaffBLL _StaffBLL = null; + OA_KaipiaoshenqingBLL oA_KaipiaoshenqingBLL = null; public OrderKehuqianshou() { - eC_OrderBasicBLL = new EC_OrderBasicBLL(); - eC_OrderBLL = new EC_OrderBLL(); - OA_KaipiaoshenqingBLL = new OA_KaipiaoshenqingBLL(); + bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL(); + _StaffBLL = new OA_StaffBLL(); + _eC_OrderBasicBLL = new EC_OrderBasicBLL(); + oA_KaipiaoshenqingBLL = new OA_KaipiaoshenqingBLL(); } protected void Page_Load(object sender, EventArgs e) { @@ -34,8 +43,41 @@ { if (!IsPostBack) { - this.HideKeyid.Value = Request["Keyid"].ToString2(); - this.labSellerOrderId.InnerText = Request["SellerOrderId"].ToString2(); + try + { + string orderIds = Request["id"]; + if (string.IsNullOrEmpty(orderIds)) + { + JavaScript.MessageBox("璁㈠崟涓嶅瓨鍦紒", this); + return; + } + + this.ids.Value = orderIds; + OA_Kaipiaoshenqing oA_Kaipiaoshenqing = oA_KaipiaoshenqingBLL.GetModelByKeyid(orderIds.ToGuid2()); + OA_CorporateClients m_OA_CorporateClients = bll_OA_CorporateClientsBLL.SelectModelByFirmIdandMemberId(CurrentUser.MemberId, oA_Kaipiaoshenqing.BuyerId); + + this.txtBuyerName.InnerText = m_OA_CorporateClients.CompanyName; + OA_Staff oA_Staff = _StaffBLL.GetModelByKeyid(oA_Kaipiaoshenqing.BusinessManagerId); + if (oA_Staff != null) + { + this.txtBusinessManager.InnerText = oA_Staff.Name; + } + this.txtkaipiaoshijian.InnerText = oA_Kaipiaoshenqing.KaipiaoquerenTime.HasValue? oA_Kaipiaoshenqing.KaipiaoquerenTime.Value.ToString("yyyy-MM-dd"):""; + //this.txtSellerOrderId.InnerText = oA_Kaipiaoshenqing.SellerOrderId; + this.txtshuliang.InnerText = oA_Kaipiaoshenqing.Dingdanshu.ToString(); + + this.txtFapiaohao.InnerText = oA_Kaipiaoshenqing.Fapiaohao.ToString(); + + + this.txtjine.InnerText = String.Format("{0:F}", oA_Kaipiaoshenqing.kpmoney + oA_Kaipiaoshenqing.Zengjianmoney); + + + } + catch (Exception ex) + { + PAGEHandleException(ex); + JavaScript.MessageBox("璁㈠崟涓嶅瓨鍦紒", this); + } } @@ -57,29 +99,92 @@ try { - //string sss = Request["txtDelayTime"]; - // this.txtDelayTime.Value; - if (this.HideKeyid.Value == "") + var files = Request.Files; + if (files.Count <= 0) { - JavaScript.MessageBox("娌℃湁璁㈠崟id", this); + JavaScript.MessageBox("璇烽�夋嫨鏂囦欢锛�", this); + return; } - - Guid Keyid = this.HideKeyid.Value.ToGuid2(); + + + HttpPostedFile file = null; + + + + for (int i = 0; i < files.Count; i++) + { + + if (files.Keys[i] == "filesel") + { + file = files[i]; + if (file.ContentLength == 0) + { + JavaScript.MessageBox("璇烽�夋嫨鏂囦欢锛�", this); + return; + } + + break; + } + + } + + + string WebDomain = ConfigurationSetting.TuPianLuJing; + //鏍圭洰褰曡矾寰勶紝鐩稿璺緞 + String savePath = "/images/WorkBook/" + DateTime.Now.ToString("yyyyMMdd") + "/"; + //鏍圭洰褰昒RL锛屽彲浠ユ寚瀹氱粷瀵硅矾寰勶紝姣斿 http://www.yoursite.com/attached/ + String saveUrl = ConfigurationSetting.TuPianLuJing.TrimEnd('/') + "/images/WorkBook/" + DateTime.Now.ToString("yyyyMMdd") + "/"; + + string fileTypes = "gif,jpg,jpeg,png,bmp"; + double maxSize = 2 * 1024 * 1024; + + + string dirPath = Server.MapPath("~" + savePath); + if (!Directory.Exists(dirPath)) + { + Directory.CreateDirectory(dirPath); + } + + string fileName = file.FileName; + string fileExt = Path.GetExtension(fileName).ToLower(); + + ArrayList fileTypeList = ArrayList.Adapter(fileTypes.Split(',')); + + + if (file.InputStream == null || file.InputStream.Length > maxSize) + { + JavaScript.MessageBox("涓婁紶鏂囦欢澶у皬瓒呰繃闄愬埗", this); + + } + + if (string.IsNullOrEmpty(fileExt) || Array.IndexOf(fileTypes.Split(','), fileExt.Substring(1).ToLower()) == -1) + { + JavaScript.MessageBox("涓婁紶鏂囦欢鎵╁睍鍚嶆槸涓嶅厑璁哥殑鎵╁睍鍚�", this); + + } + + string newFileName = DateTime.Now.ToString("yyyyMMddHHmmss_ffff", DateTimeFormatInfo.InvariantInfo) + fileExt; + string filePath = dirPath + newFileName; + file.SaveAs(filePath); + string fileUrl = savePath + newFileName; + + + Guid Keyid = Request["ids"].ToGuid2(); DateTime Kehuqianshou = DateTime.Now; - OA_Kaipiaoshenqing oA_Kaipiaoshenqing = OA_KaipiaoshenqingBLL.GetModelByKeyid(Keyid); + OA_Kaipiaoshenqing oA_Kaipiaoshenqing = oA_KaipiaoshenqingBLL.GetModelByKeyid(Keyid); oA_Kaipiaoshenqing.KehuqianshouCreater = CurrentUser.TrueMemberId; oA_Kaipiaoshenqing.KehuqianshouTime = Kehuqianshou; oA_Kaipiaoshenqing.Kehuqianshou = 2; + oA_Kaipiaoshenqing.Kehuqianshoutupian = fileUrl; - - bool result = OA_KaipiaoshenqingBLL.UpdateModel(oA_Kaipiaoshenqing); + bool result = oA_KaipiaoshenqingBLL.UpdateModel(oA_Kaipiaoshenqing); if (result) JavaScript.MessageBox("鏇存柊鎴愬姛", this, true, true); -- Gitblit v1.9.1