From 25849768b45e51a2f5ac0bd4df7bb98b24da9cd7 Mon Sep 17 00:00:00 2001
From: 杨乐 <yang.le.192@qq.com>
Date: 星期一, 07 二月 2022 17:18:22 +0800
Subject: [PATCH] 工序管理
---
WarM/仓库管理/Gy_BarCodeBill_ChaiMa.cs | 111 +++++++++++++++++++++++++++++++++----------------------
1 files changed, 66 insertions(+), 45 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..589aa62 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"
@@ -8,7 +8,7 @@
using System.Text;
using System.Windows.Forms;
-namespace WarM.浠撳簱绠$悊
+namespace WarM
{
public partial class Gy_BarCodeBill_ChaiMa : Form
{
@@ -61,7 +61,24 @@
oSumGrid_Pay.NoCol = HSnoCol2;
}
- #region 绐椾綋澶勭悊鏂规硶
+ #region 绐椾綋澶勭悊鏂规硶
+ //鍒濆鍖栭〉绛�1鏁版嵁
+ private void intoDate()
+ {
+ try
+ {
+ DataSet Ds;
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ Ds = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_ChaiMa", "h_v_Gy_BarCodeBill_ChaiMa");
+ grdMain.DataSource = Ds.Tables[0].DefaultView;
+
+ }
+ catch (Exception ex )
+ {
+ MessageBox.Show(ex.Message.ToString());
+ }
+
+ }
//鍒濆鍖栭〉绛�1
private void initGrid()
@@ -82,10 +99,8 @@
////闅愯棌鍒�
grdMain.Columns[HTagCol].Visible = false;
grdMain.Columns[HInterID].Visible = false;
- //璁剧疆鍙紪杈戝垪
- string sAllowCol = HNum.ToString();
- //璁剧疆鍚堣鍒�
- string sTotalCol = HTagCol.ToString() + "0";
+
+ //intoDate();
//鏍煎紡鍖栫綉鏍�
//DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid_Mater);
}
@@ -134,26 +149,26 @@
Sub_ClearBill();
}
- //鏁版嵁楠岃瘉
- private bool Sub_AllowSave()
- {
- for (int i = 0; i <= grdMain_Pay.RowCount - 1; i++)
- {
- if (ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HSnoCol2].Value) != 0)
- {
- if (ClsPub.isStrNull(grdMain_Pay.Rows[i].Cells[HNum2].Value) ==null)
- {
- MessageBox.Show("璇峰皢琛ㄦ牸鎷嗗垎鏁伴噺濉啓瀹屾暣", "鎻愮ず");
- return false;
- }
- }
- else
- {
- return false;
- }
- }
- return true;
- }
+ ////鏁版嵁楠岃瘉
+ //private bool Sub_AllowSave()
+ //{
+ // for (int i = 0; i <= grdMain_Pay.RowCount - 1; i++)
+ // {
+ // if (ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HSnoCol2].Value) != 0)
+ // {
+ // if (ClsPub.isStrNull(grdMain_Pay.Rows[i].Cells[HNum2].Value) ==null)
+ // {
+ // MessageBox.Show("璇峰皢琛ㄦ牸鎷嗗垎鏁伴噺濉啓瀹屾暣", "鎻愮ず");
+ // return false;
+ // }
+ // }
+ // else
+ // {
+ // return true;
+ // }
+ // }
+ // return true;
+ //}
//鐢熸垚鎸夐挳
private void xz_Click(object sender, EventArgs e)
@@ -170,13 +185,13 @@
//鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
string HBillNo = txtHBillNo.Text;
DataSet Ds;
+ double sum = 0.00000000;
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 +213,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 +225,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.isDoule(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