From f6cb981322bc4c2a27921ad0480dce7fb483a4d8 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 10 四月 2026 13:23:54 +0800
Subject: [PATCH] 先提交一部分

---
 CY_ECommercePlatform/CY.WebForm/Pages/business/AgSpecialOrderList.aspx.cs |   77 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 75 insertions(+), 2 deletions(-)

diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/AgSpecialOrderList.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/business/AgSpecialOrderList.aspx.cs
index 305e81b..0720ce4 100644
--- a/CY_ECommercePlatform/CY.WebForm/Pages/business/AgSpecialOrderList.aspx.cs
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/AgSpecialOrderList.aspx.cs
@@ -21,12 +21,16 @@
     {
         EC_SpecialOrdersBLL bll_EC_SpecialOrdersBLL = null;
         EC_OrderBasicBLL _eC_OrderBasicBLL = null;
+        OA_OutOfStorageBLL _OA_OutOfStorageBLL = null;
+        OA_InventoryBLL _OA_InventoryBLL = null;
 
         //鍒濆鍖�
         public AgSpecialOrderList()
         {
             bll_EC_SpecialOrdersBLL = new EC_SpecialOrdersBLL();
             _eC_OrderBasicBLL = new EC_OrderBasicBLL();
+            _OA_OutOfStorageBLL = new OA_OutOfStorageBLL();
+            _OA_InventoryBLL = new OA_InventoryBLL();
         }
 
         //椤甸潰鍔犺浇
@@ -42,6 +46,41 @@
                 EC_SpecialOrders model = bll_EC_SpecialOrdersBLL.GetModelByKeyid(Request["delete"].ToInt32());
                 if (model != null && model.Keyid != null)
                 {
+                    //閫�鍥炲簱瀛�
+                    var oA_OutOfStorages = _OA_OutOfStorageBLL.getModelListByRemark(model.Memberid, "<span class='a_under' title='鐐瑰嚮鏌ョ湅鏂藉伐鍗曡鎯�' onclick=\"ViewModel_Special('" + model.PO_OrderId + "')\">涓撶増锛�" + model.PSO_OrderNum + "</span>").ToList();
+                    if (oA_OutOfStorages != null && oA_OutOfStorages.Count > 0)
+                    {
+                        foreach (var outOfStorage in oA_OutOfStorages)
+                        {
+                            if (outOfStorage.InfoType == "纭鍑哄簱")
+                            {
+                                _OA_OutOfStorageBLL.DeleteModel(outOfStorage);
+                            }
+                            else if (outOfStorage.InfoType == "鍑哄簱")
+                            {
+
+
+                                OA_Inventory Inventory = new OA_Inventory();
+                                Inventory.BrandId = outOfStorage.BrandId;
+                                Inventory.FirmId = outOfStorage.FirmId;
+                                Inventory.GoodsId = outOfStorage.GoodsId;
+                                Inventory.LastUpdateTime = DateTime.Now;
+                                Inventory.WarehouseId = outOfStorage.WarehouseId;
+                                Inventory.SpecificationId = outOfStorage.SpecificationId;
+                                Inventory.PaperWeightId = outOfStorage.PaperWeightId;
+
+                                var m_OA_Inventory = _OA_InventoryBLL.IfHasModel(Inventory);
+                                if (m_OA_Inventory != null)//濡傛灉鎵�閫夎揣浣嶅瓨鍦ㄦ浜у搧
+                                {
+
+                                    m_OA_Inventory.InventoryCount = m_OA_Inventory.InventoryCount + outOfStorage.Quantity;
+                                    bool isSuccess = _OA_InventoryBLL.UpdateModel(m_OA_Inventory);
+                                }
+                                _OA_OutOfStorageBLL.DeleteModel(outOfStorage);
+                            }
+                        }
+                    }
+
                     bll_EC_SpecialOrdersBLL.DeleteModel(model);
                     JavaScript.MessageBox("鍒犻櫎鎴愬姛", this);
                     Response.Redirect("/Pages/business/AgSpecialOrderList.aspx");
@@ -68,7 +107,7 @@
                         List<EC_OrderOperate> oprates = new List<EC_OrderOperate>();
                         oprates.Add(new EC_OrderOperate()
                         {
-                            OperateType = 2,
+                            OperateType = 1,
                             OrderId = _eC_OrderBasic.Keyid,
                             Operator = CurrentUser.ShortName,
                             Remark = ""
@@ -79,6 +118,40 @@
 
 
 
+                    }
+                    //閫�鍥炲簱瀛�
+                    var oA_OutOfStorages = _OA_OutOfStorageBLL.getModelListByRemark(model.Memberid, "<span class=''a_under'' title=''鐐瑰嚮鏌ョ湅鏂藉伐鍗曡鎯�'' onclick=\"ViewModel_Special(''" + model.PO_OrderId + "'')\">涓撶増锛�" + model.PSO_OrderNum + "</span>").ToList();
+                    if (oA_OutOfStorages != null && oA_OutOfStorages.Count > 0)
+                    {
+                        foreach(var outOfStorage in oA_OutOfStorages)
+                        {
+                            if (outOfStorage.InfoType == "纭鍑哄簱")
+                            {
+                                _OA_OutOfStorageBLL.DeleteModel(outOfStorage);
+                            }
+                            else if(outOfStorage.InfoType == "鍑哄簱")
+                            {
+
+
+                                OA_Inventory Inventory = new OA_Inventory();
+                                Inventory.BrandId = outOfStorage.BrandId;
+                                Inventory.FirmId = outOfStorage.FirmId;
+                                Inventory.GoodsId = outOfStorage.GoodsId;
+                                Inventory.LastUpdateTime = DateTime.Now;
+                                Inventory.WarehouseId = outOfStorage.WarehouseId;
+                                Inventory.SpecificationId = outOfStorage.SpecificationId;
+                                Inventory.PaperWeightId = outOfStorage.PaperWeightId;
+
+                                var m_OA_Inventory = _OA_InventoryBLL.IfHasModel(Inventory);
+                                if (m_OA_Inventory != null)//濡傛灉鎵�閫夎揣浣嶅瓨鍦ㄦ浜у搧
+                                {
+
+                                    m_OA_Inventory.InventoryCount = m_OA_Inventory.InventoryCount + outOfStorage.Quantity;
+                                    bool isSuccess = _OA_InventoryBLL.UpdateModel(m_OA_Inventory);
+                                }
+                                _OA_OutOfStorageBLL.DeleteModel(outOfStorage);
+                            }                      
+                        }
                     }
 
                     bll_EC_SpecialOrdersBLL.DeleteModel(model);
@@ -102,7 +175,7 @@
             pa.PageSize = UCPager1.AspNetPager.PageSize;
             pa.PageIndex = UCPager1.AspNetPager.CurrentPageIndex;
             this.RepClientList.DataSource = bll_EC_SpecialOrdersBLL.SelectModelPage(pa, CurrentUser.MemberId,this.txtPrintName.Value,this.txtCustormerName.Value,this.txtPSO_OrderNum.Value, string.IsNullOrEmpty(this.txtBeginDate.Value) ? beginTime : Convert.ToDateTime(this.txtBeginDate.Value)
-                                                                                           , string.IsNullOrEmpty(this.txtEndDate.Value) ? endTime : MyConvert.GetDateTime(this.txtEndDate.Value)
+                                                                                           , string.IsNullOrEmpty(this.txtEndDate.Value) ? endTime : MyConvert.GetDateTime(this.txtEndDate.Value), "琛ュ崟"
 );
             this.RepClientList.DataBind();
             UCPager1.AspNetPager.RecordCount = pa.RecordCount;

--
Gitblit v1.9.1