From 72b668c965a3f5308d1a388296eb4c3f8fb7be72 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 12 九月 2025 08:46:01 +0800
Subject: [PATCH] 批量入库,操作成功关闭窗口 完成
---
CY_ECommercePlatform/CY.WebForm/Pages/financial/OrderMoneyBatchReceive.aspx.cs | 136 +++++++++++++++++++++++++++++---------------
1 files changed, 89 insertions(+), 47 deletions(-)
diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/financial/OrderMoneyBatchReceive.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/financial/OrderMoneyBatchReceive.aspx.cs
index 580d5ec..8037d7c 100644
--- a/CY_ECommercePlatform/CY.WebForm/Pages/financial/OrderMoneyBatchReceive.aspx.cs
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/financial/OrderMoneyBatchReceive.aspx.cs
@@ -47,9 +47,12 @@
protected void Page_Load(object sender, EventArgs e)
{
_eC_OrderBasicBLL = new EC_OrderBasicBLL();
- btnSubmit.ServerClick += new EventHandler(btnSubmit_ServerClick);
-
- LoadOrder();
+ //btnSubmit.ServerClick += new EventHandler(btnSubmit_ServerClick);
+ if (!IsPostBack)
+ {
+ LoadOrder();
+ }
+
if (IsPostBack || IsCallback)
return;
InitPage();
@@ -61,12 +64,16 @@
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
- void btnSubmit_ServerClick(object sender, EventArgs e)
+ protected void btn_Submit_form(object sender, EventArgs e)
{
- string[] orderIds = Request["ids"].Split(',');
+ var ids = Request["ids"];
+ //string[] orderIds = Request["ids"].Split(',');
string receiveWay = Request["rdoReceiveWay"];
bool isWin = false;
- using (var scope = new TransactionScope(TransactionScopeOption.Required,
+
+
+
+ using (var scope = new TransactionScope(TransactionScopeOption.Required,
new TransactionOptions
{
IsolationLevel = IsolationLevel.ReadCommitted,
@@ -74,55 +81,89 @@
}
))
{
- foreach (string orderId in orderIds)
+
+ try
{
- EC_OrderBasic _orderBasic = _eC_OrderBasicBLL.SelectModelById(orderId.ToInt32().Value);
- OA_CorporateClients m_OA_CorporateClients = bll_OA_CorporateClientsBLL.SelectModelByFirmIdandMemberId(CurrentUser.MemberId, _orderBasic.BuyerId);
- if (receiveWay == "0" && m_OA_CorporateClients != null)
- {
- if (this.txtReceiveMoney.Value.ToInt32() > (m_OA_CorporateClients.Prepayments + m_OA_CorporateClients.Credit))
- {
- JavaScript.MessageBox("棰勪粯娆句笉瓒筹紒", this, "window.location='/Pages/financial/OrderMoneyBatchReceive.aspx?id=" + Request["ids"] + "'");
- //Response.Redirect("/Pages/financial/OrderMoneyReceive.aspx?id=" + orderId);
- return;
- }
- }
- if (string.IsNullOrEmpty(orderId) || string.IsNullOrEmpty(receiveWay))
+ var _orderBasicmodes = _eC_OrderBasicBLL.GetOrderByIds(ids);
+ if (string.IsNullOrEmpty(ids) || string.IsNullOrEmpty(receiveWay))
{
JavaScript.MessageBox("浼犲叆鍙傛暟閿欒锛�", this);
return;
}
- if (null == _orderBasic)
+ if (null == _orderBasicmodes)
{
JavaScript.MessageBox("璁㈠崟涓嶅瓨鍦ㄦ垨宸插垹闄わ紒", this);
return;
}
- isWin = "0".Equals(receiveWay) ? UsePrepare(_orderBasic) : ToAccount(_orderBasic.Keyid.Value, _orderBasic.BuyerName, _orderBasic.UnPayedMoney);
- if (!isWin)
- {
- break;
- }
+ int i = 0;
+ foreach (var _orderBasic in _orderBasicmodes)
+ {
+
+ //EC_OrderBasic _orderBasic = _eC_OrderBasicBLL.SelectModelById(orderId.ToInt32().Value);
+
+ if (receiveWay == "0" && i == 0)
+ {
+ OA_CorporateClients m_OA_CorporateClients = bll_OA_CorporateClientsBLL.SelectModelByFirmIdandMemberId(CurrentUser.MemberId, _orderBasic.BuyerId);
+ if (m_OA_CorporateClients != null)
+ {
+ if (this.txtReceiveMoney.Value.ToInt32() > (m_OA_CorporateClients.Prepayments + m_OA_CorporateClients.Credit))
+ {
+ JavaScript.MessageBox("棰勪粯娆句笉瓒筹紒", this, "window.location='/Pages/financial/OrderMoneyBatchReceive.aspx?id=" + Request["ids"] + "'");
+ //Response.Redirect("/Pages/financial/OrderMoneyReceive.aspx?id=" + orderId);
+ return;
+ }
+ }
+ else
+ {
+ JavaScript.MessageBox("棰勪粯娆句笉瓒筹紒", this, "window.location='/Pages/financial/OrderMoneyBatchReceive.aspx?id=" + Request["ids"] + "'");
+ }
+
+
+ }
+ i = i + 1;
+
+ isWin = "0".Equals(receiveWay) ? UsePrepare(_orderBasic) : ToAccount(_orderBasic.Keyid.Value, _orderBasic.BuyerName, _orderBasic.UnPayedMoney);
+ if (!isWin)
+ {
+ break;
+ }
+
+ }
+ scope.Complete();
}
- scope.Complete();
+ catch (Exception ex)
+ {
+ // 鍥炴粴浜嬪姟
+ }
+ finally
+ {
+ // 閲婃斁璧勬簮
+ scope.Dispose();
+ }
}
if (isWin)
{
- JavaScript.MessageBox("鎿嶄綔鎴愬姛", this, true, true);
+ JavaScript.MessageBox("鎿嶄綔鎴愬姛", this);
+
+ JavaScript.RefreshDIVOpener(this);
}
else
{
JavaScript.MessageBox("鎿嶄綔澶辫触", this);
}
+
+
+
//JavaScript.MessageBox(isWin ? "鏀舵鎴愬姛锛�" : "鏀舵澶辫触锛�", this, "top.frmright.ReLoad();top.Dialog.close();");
- Request.RequestContext.RouteData.DataTokens.Add("IsWin", isWin ? "1" : "");
- if (!isWin)
- InitPage();
- else
- ;
+ //Request.RequestContext.RouteData.DataTokens.Add("IsWin", isWin ? "1" : "");
+ //if (!isWin)
+ // InitPage();
+ //else
+ // ;
}
@@ -184,7 +225,7 @@
{
string[] orderIds = Request["id"].Split(',');
this.ids.Value = Request["id"];
- List<EC_OrderBasic> eC_OrderBasics = new List<EC_OrderBasic>();
+ //List<EC_OrderBasic> eC_OrderBasics = new List<EC_OrderBasic>();
decimal shoukuanmoney = 0;
if (orderIds==null || orderIds.Length==0)
{
@@ -193,25 +234,26 @@
try
{
- foreach (string orderId in orderIds)
+ var _orderBasicmodes = _eC_OrderBasicBLL.GetOrderByIds(this.ids.Value);
+ foreach (var _orderBasicmode in _orderBasicmodes)
{
- EC_OrderBasic _orderBasicmode = _eC_OrderBasicBLL.SelectModelById(orderId.ToInt32().Value);
- OA_CorporateClients m_OA_CorporateClients = bll_OA_CorporateClientsBLL.SelectModelByFirmIdandMemberId(CurrentUser.MemberId, _orderBasicmode.BuyerId);
- if (m_OA_CorporateClients != null)
- {
- _orderBasicmode.nowCustomMoney = "锟�" + (m_OA_CorporateClients.Prepayments ?? 0).ToString("0.00");
- _orderBasicmode.nowCredit = "锟�" + (m_OA_CorporateClients.Credit ?? 0).ToString("0.00");
- }
- else
- {
- _orderBasicmode.nowCustomMoney = "锟�0";
- _orderBasicmode.nowCredit = "锟�0";
- }
+ // EC_OrderBasic _orderBasicmode = _eC_OrderBasicBLL.SelectModelById(orderId.ToInt32().Value);
+ //OA_CorporateClients m_OA_CorporateClients = bll_OA_CorporateClientsBLL.SelectModelByFirmIdandMemberId(CurrentUser.MemberId, _orderBasicmode.BuyerId);
+ //if (m_OA_CorporateClients != null)
+ //{
+ // _orderBasicmode.nowCustomMoney = "锟�" + (m_OA_CorporateClients.Prepayments ?? 0).ToString("0.00");
+ // _orderBasicmode.nowCredit = "锟�" + (m_OA_CorporateClients.Credit ?? 0).ToString("0.00");
+ //}
+ //else
+ //{
+ // _orderBasicmode.nowCustomMoney = "锟�0";
+ // _orderBasicmode.nowCredit = "锟�0";
+ //}
shoukuanmoney += _orderBasicmode.UnPayedMoney;
- eC_OrderBasics.Add(_orderBasicmode);
+ // eC_OrderBasics.Add(_orderBasicmode);
}
this.txtReceiveMoney.Value = String.Format("{0:F}", shoukuanmoney);
//rptOrderInfo.DataSource = eC_OrderBasics;
--
Gitblit v1.9.1