From 5b0c45a5813e7cbff1cf4871dbeb239b7e3900bc Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期四, 20 一月 2022 11:05:16 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WarM/仓库管理/Gy_BarCodeBill_ChaiMa.cs | 46 ++++++++++++++++++++++++++--------------------
1 files changed, 26 insertions(+), 20 deletions(-)
diff --git "a/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Gy_BarCodeBill_ChaiMa.cs" "b/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Gy_BarCodeBill_ChaiMa.cs"
index 7251f41..762a6a5 100644
--- "a/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Gy_BarCodeBill_ChaiMa.cs"
+++ "b/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Gy_BarCodeBill_ChaiMa.cs"
@@ -149,7 +149,7 @@
}
else
{
- return false;
+ return true;
}
}
return true;
@@ -170,13 +170,13 @@
//鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
string HBillNo = txtHBillNo.Text;
DataSet Ds;
+ double sum = 0;
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
- Ds = oCn.RunProcReturn("select top 1* from h_v_Gy_BarCodeBill_ChaiMa where 鏉$爜缂栧彿='" + HBillNo + "'", "h_v_Gy_BarCodeBill_ChaiMa");
+ Ds = oCn.RunProcReturn("select top 1* from Gy_BarCodeBill where HBarCode='" + HBillNo + "'", "h_v_Gy_BarCodeBill_ChaiMa");
for (i = 0; i <= grdMain_Pay.RowCount - 1; i++)
{
if (ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HSnoCol2].Value) != 0)
{
-
Model.ClsGy_BarCodeEdit_Model model = new Model.ClsGy_BarCodeEdit_Model();
//鍥哄畾璧嬪��========================================
model.HEntryID = i + 1;
@@ -198,7 +198,6 @@
model.HSourceBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillNo"].ToString());
model.HSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillType"].ToString());
model.HUseFlag = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUseFlag"].ToString());
- model.HStopflag = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HStopflag"].ToString());
model.HInitQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HInitQty"].ToString());
model.HSourceID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInitQty"].ToString());
model.HCusID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCusID"].ToString());
@@ -211,33 +210,40 @@
model.HMakeDate = DateTime.Now;
model.HMaker = ClsPub.CurUserName;
- if (model.HPieceQty <= 0 || model.HPieceQty.ToString() == "")
+ if (model.HQty <= 0 || model.HQty.ToString() == "")
{
- MessageBox.Show("绗�" + ClsPub.isStrNull(i + 1) + "琛岋紝鎷嗗垎鏁伴噺蹇呴』澶т簬0锛�");
+ MessageBox.Show("椤�2绗�" + ClsPub.isStrNull(i + 1) + "琛岋紝鎷嗗垎鏁伴噺蹇呴』澶т簬0锛�");
return false;
}
+ sum += model.HQty;
BillNew.DetailColl_Mater.Add(model);
}
+ else
+ {
+ break;
+ }
}
-
- //淇濆瓨
- bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo);
- //鎻愮ず
- if (bResult == true)
+ if (sum > DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells[HQty].Value))
{
- MessageBox.Show("鍗曟嵁瀛樼洏瀹屾瘯!鍗曟嵁鍙�:" + this.txtHBillNo.Text.Trim(), "鎻愮ず");
- return true;
+ MessageBox.Show("椤�2鎷嗗垎鏁伴噺涔嬪拰蹇呴』灏忎簬鏉$爜鏁伴噺锛�");
+ return false;
}
else
{
- MessageBox.Show("淇濆瓨澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo, "鎻愮ず");
- return false;
+ //淇濆瓨
+ bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo, HBillNo);
+ //鎻愮ず
+ if (bResult == true)
+ {
+ MessageBox.Show("鍗曟嵁瀛樼洏瀹屾瘯!鍗曟嵁鍙�:" + this.txtHBillNo.Text.Trim(), "鎻愮ず");
+ return true;
+ }
+ else
+ {
+ MessageBox.Show("淇濆瓨澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo, "鎻愮ず");
+ return false;
+ }
}
- //}
- //else
- //{
- // return false;
- //}
}
//纭畾鎸夐挳
private void button1_Click(object sender, EventArgs e)
--
Gitblit v1.9.1