From 00a72adae3be35f91d3edecb50a14b691104bdb4 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期四, 10 八月 2023 13:45:18 +0800
Subject: [PATCH] 工艺路线保存时 图号版本,总装图号,材质,成品编号,版本 改为 必录项目 jit 完善 产量汇报 删除反写 瑞琪生产入库包装标识
---
WarM/条码打印/Sc_ICMOToBarCode.cs | 350 ++++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 268 insertions(+), 82 deletions(-)
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs"
index 258363c..f90e6ff 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs"
@@ -119,8 +119,11 @@
//鎶婂綋鍓嶅崟鎹甀D 瀛樺埌涓�涓寜閽噷闈� 鍒锋柊鏃舵瘡娆″瓨涓�閬�
if (DSet.Tables[0].Rows.Count > 0)
{
- txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value);
+ txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value);
txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["鏍囧噯瑁呯"].Value);
+ //txtHMaterID.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["鐗╂枡缂栫爜"].Value);
+ txtHMaterModel.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["瑙勬牸鍨嬪彿"].Value);
+ txtHMaterName.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["鐗╂枡鍚嶇О"].Value);
}
else
{
@@ -140,7 +143,7 @@
// }
//}
//鍐荤粨
- //int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text);
+ //int FrCol = DBUtility.ClsPub.isLong(frmCondition.txtFrozenCol.Text);
//string s = frmCondition.cmbHComplete.Text;
//DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s,FrCol);
//鐢荤嚎
@@ -226,7 +229,7 @@
string HUserName = "";
HUserName = ClsPub.isStrNull(DBUtility.ClsPub.CurUserName);
Int64 HUserID = 0;
- HUserID = ClsPub.isInt(DBUtility.ClsPub.CurUserID);
+ HUserID = ClsPub.isLong(DBUtility.ClsPub.CurUserID);
DataSet DSet;
@@ -752,7 +755,6 @@
private void cmdHSaveBill_Click(object sender, EventArgs e)
{
-
Display();
}
@@ -779,8 +781,10 @@
string HTMNumber = "";
string HOrgNumber = "";
DataSet Ds;
- int LSH = 0; //娴佹按鍙�
+ Int64 LSH = 0; //娴佹按鍙�
string LSH2 = ""; //娴佹按鍙疯浆鎹㈡垚瀛楃
+
+
double HZXQty = 0; //瑁呯鏁伴噺
double HDDQty = 0; //璁㈠崟鏁伴噺
double HBQty = 0; //绠辨暟
@@ -790,48 +794,159 @@
int LSHlen = 6; //娴佹按鍙烽暱搴�
string TM = ""; //鏉$爜
string sPackBarCode = "";
- //HDate = dtpHBeginDate.Value.ToShortDateString();
- //HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
- //HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString();
- //HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
- //HDay = "0" + ClsPub.isDate(HDate).Day.ToString();
- //HDay = HDay.Substring(HDay.Length - 2, 2);
+ string HPrdDate = "";
+ string HBC = "";
+ string HDate1 = "";
+ DataSet Ds99;
- HDate = dtpHBeginDate.Value.ToShortDateString();
- DataSet DSet1 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo);
- //鐢熸垚棣栬鏍囬
- if (DSet1 == null || DSet1.Tables[0].Rows.Count == 0)
+ //绠卞彿
+ string HXH = "";
+ //绠卞彿娴佹按鍙�
+ Int64 LSH3 = 0; //娴佹按鍙�
+ string LSH4 = ""; //娴佹按鍙疯浆鎹㈡垚瀛楃
+ //鏈哄彴
+ string HJT = "";
+
+ HDate = DateTime.Now.ToString();
+
+ //鍒ゆ柇褰撳墠鏃堕棿鏄惁鍦ㄥ伐浣滄椂闂存鍐�
+ string _strWorkingDayAM = "07:30";//宸ヤ綔鏃堕棿涓婂崍08:30
+ string _strWorkingDayPM = "19:30";
+ string _strWorkingDayTM = "00:00";
+ string _strWorkingDaySM = "23:59";
+ TimeSpan dspWorkingDayAM = DateTime.Parse(_strWorkingDayAM).TimeOfDay;
+ TimeSpan dspWorkingDayPM = DateTime.Parse(_strWorkingDayPM).TimeOfDay;
+ TimeSpan dspWorkingDayTM = DateTime.Parse(_strWorkingDayTM).TimeOfDay;
+ TimeSpan dspWorkingDaySM = DateTime.Parse(_strWorkingDaySM).TimeOfDay;
+
+ //string time1 = "2017-2-17 8:10:00";
+ DateTime t1 = Convert.ToDateTime(HDate);
+
+ TimeSpan dspNow = t1.TimeOfDay;
+ HDate1 = Convert.ToDateTime(HDate).ToShortDateString();
+ //1.姝e父涓婄彮鏃堕棿 灏辨槸鐧界彮 濡傛灉涓嶆槸绀兼嫓澶� 灏卞線鍓嶆彁鍓嶄竴澶�
+ if (dspNow > dspWorkingDayAM && dspNow < dspWorkingDayPM)
+ {
+ HBC = "鐧界彮";
+
+ DataSet DSet2 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate1.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo);
+ if (DSet2 == null || DSet2.Tables[0].Rows.Count == 0)
{
- HDate = DateTime.Now.ToShortDateString();
- HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
- HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString();
- HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
- HDay = "0" + ClsPub.isDate(HDate).Day.ToString();
- HDay = HDay.Substring(HDay.Length - 2, 2);
- long HTMaterID = 0;
- HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value);
- string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //澶栫鐮� 鍓嶇紑
- DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- Int64 TTM_LSH = ClsPub.isInt(DsTM.Tables[0].Rows[0][0]) + 1;
- sPackBarCode = sPackStr + TTM_LSH.ToString();
- oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'");
+ HPrdDate = HDate;
}
else
{
- HDate = DBUtility.ClsPub.isStrNull(DSet1.Tables[0].Rows[0]["HNoFactoryDayOffDate"]);
- HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
- HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString();
- HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
- HDay = "0" + ClsPub.isDate(HDate).Day.ToString();
- HDay = HDay.Substring(HDay.Length - 2, 2);
- long HTMaterID = 0;
- HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value);
- string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //澶栫鐮� 鍓嶇紑
- DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- Int64 TTM_LSH = ClsPub.isInt(DsTM.Tables[0].Rows[0][0]) + 1;
- sPackBarCode = sPackStr + TTM_LSH.ToString() + "+" ;
- oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'");
+ HPrdDate = DBUtility.ClsPub.isStrNull(DSet2.Tables[0].Rows[0]["HNoFactoryDayOffDate"]);
}
+ }
+ //2.澶т簬19锛�30 灏忎簬24锛�00 澶滅彮
+ if (dspNow > dspWorkingDayPM && dspNow < dspWorkingDaySM)
+ {
+ HBC = "澶滅彮";
+ DataSet DSet2 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate1.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo);
+ if (DSet2 == null || DSet2.Tables[0].Rows.Count == 0)
+ {
+ HPrdDate = HDate;
+ }
+ else
+ {
+ HPrdDate = DBUtility.ClsPub.isStrNull(DSet2.Tables[0].Rows[0]["HNoFactoryDayOffDate"]);
+ }
+ }
+ //3.澶т簬00锛�00 灏忎簬7锛�30 鐧界彮 鍏堝噺涓�澶� 鍐嶅垽鏂噺浜嗕竴澶╃殑鏃ユ湡鏄笉鏄巶浼戞棩鏈�
+ if (dspNow > dspWorkingDayTM && dspNow < dspWorkingDayAM)
+ {
+ HBC = "澶滅彮";
+ HDate = DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isDate(HDate).AddDays(-1));
+ HDate = DBUtility.ClsPub.isDate(HDate).ToShortDateString();
+ DataSet DSet2 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo);
+ if (DSet2 == null || DSet2.Tables[0].Rows.Count == 0)
+ {
+ HPrdDate = HDate;
+ }
+ else
+ {
+ HPrdDate = DBUtility.ClsPub.isStrNull(DSet2.Tables[0].Rows[0]["HNoFactoryDayOffDate"]);
+ }
+ }
+ HYear = ClsPub.isDate(HPrdDate).Year.ToString().Substring(2, 2);
+ HPeriod = "0" + ClsPub.isDate(HPrdDate).Month.ToString();
+ HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
+ HDay = "0" + ClsPub.isDate(HPrdDate).Day.ToString();
+ HDay = HDay.Substring(HDay.Length - 2, 2);
+ long HTMaterID = 0;
+ HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value);
+ string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //澶栫鐮� 鍓嶇紑
+
+
+ //鑾峰彇澶勭悊杩囩殑鏃ユ湡璺熶粖澶╁樊鍑犲ぉ 鐒跺悗鍔犲嚑涓�+鍙�
+ TimeSpan HCY = Convert.ToDateTime(HPrdDate) - Convert.ToDateTime(DateTime.Now.ToString());
+ int a = 1;
+ while (a <= HCY.Days) //褰揳 灏忎簬 宸紓澶╂暟 寰幆鍔犱笂 + 鍙�
+ {
+ HPrdDate = HPrdDate + "+";
+ a = a + 1;
+ }
+ DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
+ Int64 TTM_LSH = ClsPub.isLong(DsTM.Tables[0].Rows[0][0]) + 1;
+
+
+ sPackBarCode = sPackStr + TTM_LSH.ToString();
+ //DataSet DSet3 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate1.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo);
+ //if (DSet3 == null || DSet3.Tables[0].Rows.Count == 0)
+ //{
+ // sPackBarCode = sPackStr + TTM_LSH.ToString() ;
+ //}
+ //else
+ //{
+ // sPackBarCode = sPackStr + TTM_LSH.ToString() + "+";
+ //}
+
+
+ oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'");
+
+
+ //DataSet DSet1 = oCn.RunProcReturn("select * from Gy_FactoryDayOff Where HFactoryDayOffDate='" + HDate.ToString() + "'", "Gy_FactoryDayOff", ref DBUtility.ClsPub.sExeReturnInfo);
+
+
+ // //鐢熸垚棣栬鏍囬
+ // if (DSet1 == null || DSet1.Tables[0].Rows.Count == 0)
+ // {
+
+ // HDate = DateTime.Now.ToShortDateString();
+ // HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
+ // HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString();
+ // HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
+ // HDay = "0" + ClsPub.isDate(HDate).Day.ToString();
+ // HDay = HDay.Substring(HDay.Length - 2, 2);
+ // long HTMaterID = 0;
+ // HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value);
+ // string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //澶栫鐮� 鍓嶇紑
+ // DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
+ // Int64 TTM_LSH = ClsPub.isLong(DsTM.Tables[0].Rows[0][0]) + 1;
+ // sPackBarCode = sPackStr + TTM_LSH.ToString();
+ // oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'");
+ // }
+
+ // else
+ // {
+
+ // HDate = DBUtility.ClsPub.isStrNull(DSet1.Tables[0].Rows[0]["HNoFactoryDayOffDate"]);
+
+
+ // HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
+ // HPeriod = "0" + ClsPub.isDate(HDate).Month.ToString();
+ // HPeriod = HPeriod.Substring(HPeriod.Length - 2, 2);
+ // HDay = "0" + ClsPub.isDate(HDate).Day.ToString();
+ // HDay = HDay.Substring(HDay.Length - 2, 2);
+ // long HTMaterID = 0;
+ // HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value);
+ // string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //澶栫鐮� 鍓嶇紑
+ // DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
+ // Int64 TTM_LSH = ClsPub.isLong(DsTM.Tables[0].Rows[0][0]) + 1;
+ // sPackBarCode = sPackStr + TTM_LSH.ToString() + "+" ;
+ // oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'");
+ // }
//=============鏍规嵁鐣岄潰涓婂凡缁忓垎閰嶇殑鏁版嵁杩涜鏉$爜鐢熸垚鍜屾墦鍗般��
//鑾峰彇鏈鐢熸垚鐨� 涓诲唴鐮�
@@ -849,7 +964,7 @@
//HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value);
//string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //澶栫鐮� 鍓嶇紑
//DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- //Int64 TTM_LSH = ClsPub.isInt(DsTM.Tables[0].Rows[0][0]) + 1;
+ //Int64 TTM_LSH = ClsPub.isLong(DsTM.Tables[0].Rows[0][0]) + 1;
//string sPackBarCode = sPackStr + TTM_LSH.ToString();
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'");
@@ -876,14 +991,23 @@
HOrgNumber = ClsPub.HOrgNumber;
- //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text);
+ //绠卞彿鐢熸垚瑙勫垯 鏃ユ湡 + 鏈哄彴 + 鐝 + 鐗╂枡 鍙鑾峰彇鏈�澶х殑娴佹按鍙�
+ HJT = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("璁惧")].Value);
+ HXH = HYear + HPeriod + HDay + HBC + HJT + HMaterNumber;
+ Ds99 = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HXH + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
+ LSH3 = ClsPub.isLong(Ds99.Tables[0].Rows[0][0]) + 1;
+ LSH4 = LSH3.ToString();
+
+
+
+ //HBQty = HBQty + ClsPub.isLong(txtHBQty.Text);
HZXQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("鏈鏁伴噺")].Value);
HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("鐢熶骇璁㈠崟鏁伴噺")].Value);
HICMOBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("鐢熶骇璁㈠崟鍙�")].Value);
HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
n = 0;
LSH2 = LSH.ToString();
while (LSH2.Length < LSHlen) //濡傛灉娴佹按鍙峰皬浜�6浣嶆暟鍓嶉潰琛�0
@@ -962,14 +1086,14 @@
HWorkLineName = "";
HSeOrderBillNo = "";
HInnerBillNo = sPackBarCode;
- HSourceID = ClsPub.isInt(txtHSourceID.Tag);
+ HSourceID = ClsPub.isLong(txtHSourceID.Tag);
oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HMaterialMQty" +
",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HSourceID,HInterID " +
- ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
+ ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HPrdDate,HBC,HXH,HInnerBillNo " +
") values ("
+ "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID1.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() + ", " + HMZQty.ToString()
+ ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
@@ -977,22 +1101,23 @@
+ ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
+ ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + HDate + "'"
+ ", " + ClsPub.HOrgID.ToString() + "," + ClsPub.HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HSourceID.ToString() + "," + HInterID.ToString()
- + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "')");
+ + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HPrdDate + "','" + HBC + "','" + LSH4 + "','" + HInnerBillNo + "')");
oCn.RunProc("exec h_p_WMS_SetMaxNo '" + HTMNumber + "'");
+ oCn.RunProc("exec h_p_WMS_SetMaxNo '" + HXH + "'");
DisplayTM();
}
}
//2.寰幆缁撴潫鍚庯紝鏍规嵁 鏈鐢熸垚鐨� 涓诲唴鐮侊紝浠庡悗鍙版暟鎹簱鑾峰彇 鏉$爜鍒楄〃锛岀敓鎴� 缁勬墭鍗� 鍜� 鎵樻潯鐮侊紝 鐩存帴璋冪敤瀛樺偍杩囩▼
//鏍规嵁澶栫鐮� 鍐欏叆 缁勬墭鍗曚富琛紝缁勬墭鍗曞瓙琛紝SUM锛屽绠辩爜妗f锛孲UM妗f
- oCn.RunProc("exec h_p_WMS_PackUnionBill_AddNew '" + sPackBarCode + "'," + HInterID_TTM.ToString() + ",'" + DBUtility.ClsPub.CurUserName + "','" + HDate + "'," + HInterID.ToString()); //鏍规嵁绠辨潯鐮侊紝鍐欏叆 涓昏〃锛屽瓙琛� 锛岀鏉$爜妗f
+ oCn.RunProc("exec h_p_WMS_PackUnionBill_AddNew_test '" + sPackBarCode + "'," + HInterID_TTM.ToString() + ",'" + DBUtility.ClsPub.CurUserName + "'," + HInterID.ToString()); //鏍规嵁绠辨潯鐮侊紝鍐欏叆 涓昏〃锛屽瓙琛� 锛岀鏉$爜妗f
oCn.RunProc("exec h_p_WMS_PackUnionBill_SumSubBill " + HInterID_TTM.ToString() + ",'" + sPackBarCode + "','3783','" + DBUtility.ClsPub.CurUserName + "'," + HInterID.ToString()); //鏍规嵁绠辨潯鐮侊紝鍐欏叆 SUM琛紝SUM鏉$爜妗f
sPackBarCode = "";
- DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList_CS Where HInterID=" + HInterID.ToString() + " and 鏉$爜绫诲瀷 = '鎵樼洏鏉$爜'", "h_v_IF_BarCodeBillList_CS", ref DBUtility.ClsPub.sExeReturnInfo);
+ DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList_CS_Test Where HInterID=" + HInterID.ToString() + " and 鏉$爜绫诲瀷 = '鎵樼洏鏉$爜'", "h_v_IF_BarCodeBillList_CS_Test", ref DBUtility.ClsPub.sExeReturnInfo);
//鐢熸垚棣栬鏍囬
if (DSet == null)
{
@@ -1089,19 +1214,70 @@
//Sub_SaveBarCode();
////
+
+
+ //bool flag = this.txtHZXQty.Text.Trim() != "";
+ //double num;
+ //double HICMOQty = 0;
+ //if (flag)
+ //{
+ // num = Pub_Class.ClsPub.isDoule(this.txtHZXQty.Text);
+ //}
+ //else
+ //{
+ // num = Pub_Class.ClsPub.isDoule(this.txtHMiniQty.Text);
+ //}
+ //bool flag2 = num <= 0.0;
+ //if (flag2)
+ //{
+ // MessageBox.Show("璇疯緭鍏ユ暣绠辨暟閲忥紒");
+ //}
+ //else
+ //{
+ // for (int i = 0; i < this.grdMain.Rows.Count; i++)
+ // {
+ // for (int i1 = 0; i1 < this.grdMain.Rows.Count; i1++)
+ // {
+
+ // HICMOQty += Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i1].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+ // }
+ // if (HICMOQty < num)
+ // {
+ // MessageBox.Show("璇风偣鍑昏秴棰濈敓浜ф寜閽敓鎴愭潯鐮侊紒");
+ // break;
+ // }
+
+ // bool flag3 = num > 0.0;
+ // if (!flag3)
+ // {
+ // break;
+ // }
+ // bool flag4 = num > Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+ // if (!flag4)
+ // {
+ // this.grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = num;
+ // break;
+ // }
+ // num -= Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+ // this.grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+ // }
+ // this.Sub_SaveBarCode();
+
bool flag = this.txtHZXQty.Text.Trim() != "";
+ double HICMOQty = 0.0;
+ bool flag5 = flag;
double num;
- double HICMOQty = 0;
- if (flag)
+ if (flag5)
{
- num = Pub_Class.ClsPub.isDoule(this.txtHZXQty.Text);
+ num = ClsPub.isDoule(this.txtHZXQty.Text);
}
else
{
- num = Pub_Class.ClsPub.isDoule(this.txtHMiniQty.Text);
+ num = ClsPub.isDoule(this.txtHMiniQty.Text);
}
bool flag2 = num <= 0.0;
- if (flag2)
+ bool flag6 = flag2;
+ if (flag6)
{
MessageBox.Show("璇疯緭鍏ユ暣绠辨暟閲忥紒");
}
@@ -1109,30 +1285,31 @@
{
for (int i = 0; i < this.grdMain.Rows.Count; i++)
{
- for (int i1 = 0; i1 < this.grdMain.Rows.Count; i1++)
+ for (int i2 = 0; i2 < this.grdMain.Rows.Count; i2++)
{
-
- HICMOQty += Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i1].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+ HICMOQty += ClsPub.isDoule(this.grdMain.Rows[i2].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
}
- if (HICMOQty < num)
+ bool flag7 = HICMOQty < num;
+ if (flag7)
{
MessageBox.Show("璇风偣鍑昏秴棰濈敓浜ф寜閽敓鎴愭潯鐮侊紒");
break;
}
-
bool flag3 = num > 0.0;
- if (!flag3)
+ bool flag8 = !flag3;
+ if (flag8)
{
break;
}
- bool flag4 = num > Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
- if (!flag4)
+ bool flag4 = num > ClsPub.isDoule(this.grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+ bool flag9 = !flag4;
+ if (flag9)
{
this.grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = num;
break;
}
- num -= Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
- this.grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = Pub_Class.ClsPub.isDoule(this.grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+ num -= ClsPub.isDoule(this.grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+ this.grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = ClsPub.isDoule(this.grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
}
this.Sub_SaveBarCode();
}
@@ -1150,7 +1327,7 @@
string HTMNumber = "";
string HOrgNumber = "";
DataSet Ds;
- int LSH = 0; //娴佹按鍙�
+ Int64 LSH = 0; //娴佹按鍙�
string LSH2 = ""; //娴佹按鍙疯浆鎹㈡垚瀛楃
double HZXQty = 0; //瑁呯鏁伴噺
double HDDQty = 0; //璁㈠崟鏁伴噺
@@ -1173,7 +1350,7 @@
HOrgNumber = ClsPub.HOrgNumber;
- //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text);
+ //HBQty = HBQty + ClsPub.isLong(txtHBQty.Text);
HZXQty = ClsPub.isDoule(txtHZXQty.Text);
HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("璁㈠崟鏁伴噺")].Value);
@@ -1182,7 +1359,7 @@
{
HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else if (cmbHBarCodeType.Text == "鎵规鏉$爜")
{
@@ -1313,7 +1490,7 @@
string HTMNumber = "";
string HOrgNumber = "";
DataSet Ds;
- int LSH = 0; //娴佹按鍙�
+ Int64 LSH = 0; //娴佹按鍙�
string LSH2 = ""; //娴佹按鍙疯浆鎹㈡垚瀛楃
double HZXQty = 0; //瑁呯鏁伴噺
double HDDQty = 0; //璁㈠崟鏁伴噺
@@ -1336,7 +1513,7 @@
HOrgNumber = ClsPub.HOrgNumber;
- //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text);
+ //HBQty = HBQty + ClsPub.isLong(txtHBQty.Text);
HZXQty = ClsPub.isDoule(txtHZXQty.Text);
HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("璁㈠崟鏁伴噺")].Value);
HICMOBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("鐢熶骇璁㈠崟鍙�")].Value);
@@ -1345,7 +1522,7 @@
{
HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else if (cmbHBarCodeType.Text == "鎵规鏉$爜")
{
@@ -1375,7 +1552,7 @@
HDay = HDay.Substring(HDay.Length - 2, 2);
HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
TM = HTMNumber + LSH2;
}
else
@@ -1388,7 +1565,7 @@
HDay = HDay.Substring(HDay.Length - 2, 2);
HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
TM = HTMNumber + LSH2 + "+";
}
//HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
@@ -1398,7 +1575,7 @@
//HDay = HDay.Substring(HDay.Length - 2, 2);
//HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
//Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
- //LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ //LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
//if (cmbHBarCodeType.Text == "鍞竴鏉$爜")
//{
@@ -1524,8 +1701,8 @@
private void DisplayTM()
{
- //HInterID = DBUtility.ClsPub.isInt(txtHMaterID.Tag);
- DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList Where HinterID=" + HInterID.ToString() + " and 鏉$爜绫诲瀷 = '鎵樼洏鏉$爜' order by HItemID", "h_v_IF_BarCodeBillList", ref DBUtility.ClsPub.sExeReturnInfo);
+ //HInterID = DBUtility.ClsPub.isLong(txtHMaterID.Tag);
+ DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList_test Where HinterID=" + HInterID.ToString() + " and 鏉$爜绫诲瀷 = '鎵樼洏鏉$爜' order by HItemID", "h_v_IF_BarCodeBillList_test", ref DBUtility.ClsPub.sExeReturnInfo);
//鐢熸垚棣栬鏍囬
if (DSet == null)
{
@@ -1684,7 +1861,7 @@
//
grdSub.DataSource = DSet.Tables[0].DefaultView;
//鍐荤粨
- //int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text);
+ //int FrCol = DBUtility.ClsPub.isLong(frmCondition.txtFrozenCol.Text);
//string s = frmCondition.cmbHComplete.Text;
//DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name, s, FrCol);
//鐢荤嚎
@@ -1932,13 +2109,13 @@
{
//鑾峰彇缃戞牸绗竴琛孒InterID鐨勫��
Int64 HInterID = 0;
- HInterID = DBUtility.ClsPub.isInt(txtHMaterID.Tag);
+ HInterID = DBUtility.ClsPub.isLong(txtHMaterID.Tag);
DataSet DSBefore;
DSBefore = SubCn.RunProcReturn("exec h_p_PreviousMater "+ HInterID, "h_p_PreviousMater", ref DBUtility.ClsPub.sExeReturnInfo);
grdMain.DataSource = DSBefore.Tables[0].DefaultView;
//if (DSBefore.Tables[0].Rows.Count > 0)
//{
- // txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value);
+ // txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value);
//}
//else
//{
@@ -1953,8 +2130,10 @@
else
{
grdMain.DataSource = DSBefore.Tables[0].DefaultView;
- txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value);
+ txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value);
txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["鏍囧噯瑁呯"].Value);
+ txtHMaterModel.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["瑙勬牸鍨嬪彿"].Value);
+ txtHMaterName.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["鐗╂枡鍚嶇О"].Value);
}
@@ -1965,8 +2144,8 @@
{
//鏍规嵁
Int64 HInterID = 0;
- //HInterID = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells[Fun_GetCol("HInterID")].Value);
- HInterID = DBUtility.ClsPub.isInt(txtHMaterID.Tag);
+ //HInterID = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HInterID")].Value);
+ HInterID = DBUtility.ClsPub.isLong(txtHMaterID.Tag);
DataSet DSBefore;
DSBefore = SubCn.RunProcReturn("exec h_p_NextMater " + HInterID, "h_p_NextMater", ref DBUtility.ClsPub.sExeReturnInfo);
if (DSBefore == null || DSBefore.Tables[0].Rows.Count == 0)
@@ -1978,8 +2157,10 @@
else
{
grdMain.DataSource = DSBefore.Tables[0].DefaultView;
- txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value);
+ txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value);
txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["鏍囧噯瑁呯"].Value);
+ txtHMaterModel.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["瑙勬牸鍨嬪彿"].Value);
+ txtHMaterName.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["鐗╂枡鍚嶇О"].Value);
}
//txtHMaterID.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["HInterID"].Value);
}
@@ -2083,5 +2264,10 @@
Thread.Sleep(1000);
}
}
+
+ private void label14_Click(object sender, EventArgs e)
+ {
+
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.1