From 74f3a827b455592df58dccf2ab67e76f722df7c1 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期二, 09 八月 2022 16:06:56 +0800
Subject: [PATCH] 报工平台维护
---
WarM/条码打印/Gy_BarCodeBill.cs | 339 +++++++++++++++++++++++++++++++++++--------------------
1 files changed, 214 insertions(+), 125 deletions(-)
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
index c6b008e..b70b19d 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
@@ -67,19 +67,20 @@
public const Int16 HInstructNoCol = 46;
public const Int16 HSeOrderBillIDCol = 47;
public const Int16 HSeOrderBillNoCol = 48;
- public const Int16 HWhIDCol = 49;
- public const Int16 HWhNumberCol = 50;
- public const Int16 HWhNameCol = 51;
- public const Int16 HSPIDCol = 52;
- public const Int16 HSPNumberCol = 53;
- public const Int16 HSPNameCol = 54;
- public const Int16 HinitQtyCol = 55;
- public const Int16 HRemarkCol = 56;
- public const Int16 HPinfanBarCodeCol = 57;
- public const Int16 HMTONoCol = 58;
- public const Int16 HShowDateCol = 59;
- public const Int16 HInnerBillNoCol = 60;
- public const Int16 HMakerCol = 61;
+ public const Int16 HSeOrderSEQCol = 49;
+ public const Int16 HWhIDCol = 50;
+ public const Int16 HWhNumberCol = 51;
+ public const Int16 HWhNameCol = 52;
+ public const Int16 HSPIDCol = 53;
+ public const Int16 HSPNumberCol = 54;
+ public const Int16 HSPNameCol = 55;
+ public const Int16 HinitQtyCol = 56;
+ public const Int16 HRemarkCol = 57;
+ public const Int16 HPinfanBarCodeCol = 58;
+ public const Int16 HMTONoCol = 59;
+ public const Int16 HShowDateCol = 60;
+ public const Int16 HInnerBillNoCol = 61;
+ public const Int16 HMakerCol = 62;
public Int16 HSelectCol = 0;
public Int16 HSno2Col = 1;
@@ -127,19 +128,20 @@
public Int16 HInstructNo2Col = 43;
public Int16 HSeOrderBillID2Col = 44;
public Int16 HSeOrderBillNo2Col = 45;
- public Int16 HWhID2Col = 46;
- public Int16 HWhNumber2Col = 47;
- public Int16 HWhName2Col = 48;
- public Int16 HSPID2Col = 49;
- public Int16 HSPNumber2Col = 50;
- public Int16 HSPName2Col = 51;
- public Int16 HRemark2Col = 52;
- public Int16 HPinfanBarCode2Col = 53;
- public Int16 HMTONo2Col = 54;
- public Int16 HShowDate2Col = 55;
- public Int16 HInnerBillNo2Col = 56;
- public Int16 HMaker2Col = 57;
- public Int16 HEntryID2Col = 58;
+ public Int16 HSeOrderSEQ2Col = 46;
+ public Int16 HWhID2Col = 47;
+ public Int16 HWhNumber2Col = 48;
+ public Int16 HWhName2Col = 49;
+ public Int16 HSPID2Col = 50;
+ public Int16 HSPNumber2Col = 51;
+ public Int16 HSPName2Col = 52;
+ public Int16 HRemark2Col = 53;
+ public Int16 HPinfanBarCode2Col = 54;
+ public Int16 HMTONo2Col = 55;
+ public Int16 HShowDate2Col = 56;
+ public Int16 HInnerBillNo2Col = 57;
+ public Int16 HMaker2Col = 58;
+ public Int16 HEntryID2Col = 59;
//
public string ModName = "85";
public string ModCaption = "鏉$爜鐢熸垚";
@@ -163,7 +165,10 @@
public string ERPMode = ""; //ERP妯″紡锛圵ISE銆丆LOUD锛�
public string CampanyName = ""; //瀹㈡埛瀹氬埗鍖栧悕绉�
public string SourceQtyCtl = ""; //瓒呮簮鍗曟暟閲忔帶鍒�
- //-------------------------------------------------------------------------
+ public long PrintQty = 0; //鍏佽鏉$爜鎵撳嵃娆℃暟
+ public string PrintQtyCtl = ""; //鏉$爜鎵撳嵃娆℃暟鎺у埗
+ public string UpdatePrintQtyCtl = ""; //鏉$爜鎵撳嵃娆℃暟鏇存柊
+ //-------------------------------------------------------------------------
#region 鍥哄畾浠g爜
//娓呯┖鐣岄潰
@@ -403,6 +408,9 @@
ERPMode = oSystemParameter.omodel.WMS_WMSStockCtl_ERPMode;
CampanyName = oSystemParameter.omodel.WMS_CampanyName;
SourceQtyCtl = oSystemParameter.omodel.BarCode_SourceQtyCtl;
+ PrintQty = oSystemParameter.omodel.BarCode_PrintQty;
+ PrintQtyCtl = oSystemParameter.omodel.BarCode_PrintQtyCtl;
+ UpdatePrintQtyCtl = oSystemParameter.omodel.BarCode_UpdatePrintQtyCtl;
}
cmbHWorksNumber.Items.Clear();
@@ -677,10 +685,10 @@
string HMaterNumber = ""; //鐗╂枡浠g爜
double HSumQty = 0; //浜у搧鏁伴噺
double HMinQty = 0; //鏈�灏忓寘瑁呮暟
- int HBQty = 0; //绠辨暟
+ Int64 HBQty = 0; //绠辨暟
double HQty = 0; //鏁伴噺
string WeiShu = ""; //灏炬暟
- int LSH = 0; //娴佹按鍙�
+ Int64 LSH = 0; //娴佹按鍙�
string LSH2 = ""; //娴佹按鍙疯浆鎹㈡垚瀛楃
string sDate = ""; //鏃ユ湡
string sYear = ""; //骞�
@@ -693,7 +701,7 @@
string HBarCodeBatchNo = ""; //鏉$爜鎵规鍙�
string HBarCodeDate = ""; //鏉$爜鏃ユ湡
int k = 0;
- int n = 0; //鍚屼竴鎵圭敓鎴愭潯鐮佷腑鐨勭鍑犳潯
+ Int64 n = 0; //鍚屼竴鎵圭敓鎴愭潯鐮佷腑鐨勭鍑犳潯
string sTMNumber = ""; //鏉$爜鑷畾涔夊墠缂�
DataSet Ds;
//Ds = oCn.RunProcReturn("exec GetLSH '" + ClsPub.GetServerDate(0) + "'", "GetLSH");
@@ -740,7 +748,7 @@
sTMNumber = HNumber + sYear + sPeriod + sDay;
Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else if (CampanyName == "椋為緳")
{
@@ -755,7 +763,7 @@
sTMNumber = HWorksNumber + HNumber + sYear + sPeriod + sDay;
Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else //閫氱敤鏂规硶
{
@@ -763,7 +771,7 @@
sTMNumber = HOrgNumber + HNumber + sYear + sPeriod + sDay;
Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
}
else if (cmbHBarCodeType.Text == "鍝佺鏉$爜")
@@ -787,7 +795,7 @@
sTMNumber = HMaterNumber + sYear + sPeriod + sDay;
Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 4;
}
else if (cmbHBarCodeType.Text == "浠櫒鎴愬搧鏉$爜瑙勫垯") //鍙﹀澶勭悊浜�
@@ -796,7 +804,7 @@
//sTMNumber = HMaterNumber + sYear + sPeriod + sDay;
//Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
// //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- //LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ //LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
}
else if (cmbHBarCodeType.Text == "璇曞墏鎴愬搧鏉$爜瑙勫垯")
{
@@ -804,7 +812,7 @@
sTMNumber = HMaterNumber + HBatchNo ;
Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 6;
}
else if (cmbHBarCodeType.Text == "鍐呴攢鏈烘潯鐮�")
@@ -814,7 +822,7 @@
sTMNumber = "1" + HModelName + HBarCodeDate + HBarCodeBatchNo + HYasuoji + "00" ;
Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 5;
if (sTMNumber.Length != 16)
{
@@ -829,7 +837,7 @@
sTMNumber = HMaterNumber.Replace( "." , "" ) + HBarCodeDate + HBarCodeBatchNo;
Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 5;
if (sTMNumber.Length != 18)
{
@@ -843,7 +851,7 @@
sTMNumber = HICMOBillNo;
Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿
//oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
- LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+ LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
LSHlen = 5;
}
//else if (cmbHBarCodeType.Text == "鎵樼洏鏉$爜")
@@ -856,7 +864,7 @@
return;
}
- HBQty = HBQty + ClsPub.isInt(grdMain.Rows[j].Cells[HBQtyCol].Value);
+ HBQty = HBQty + ClsPub.isLong(grdMain.Rows[j].Cells[HBQtyCol].Value);
HMinQty = ClsPub.isDoule(grdMain.Rows[j].Cells[HMinQtyCol].Value);
HSumQty = ClsPub.isDoule(grdMain.Rows[j].Cells[HQtyCol].Value);
n = 0;
@@ -964,6 +972,7 @@
grdSub.Rows[i].Cells[HSourceName2Col].Value = grdMain.Rows[j].Cells[HSourceNameCol].Value;
grdSub.Rows[i].Cells[HEndDate2Col].Value = grdMain.Rows[j].Cells[HEndDateCol].Value;
grdSub.Rows[i].Cells[HSeOrderBillNo2Col].Value = grdMain.Rows[j].Cells[HSeOrderBillNoCol].Value;
+ grdSub.Rows[i].Cells[HSeOrderSEQ2Col].Value = grdMain.Rows[j].Cells[HSeOrderSEQCol].Value;
grdSub.Rows[i].Cells[HInnerBillNo2Col].Value = grdMain.Rows[j].Cells[HInnerBillNoCol].Value;
grdSub.Rows[i].Cells[HMaker2Col].Value = grdMain.Rows[j].Cells[HMakerCol].Value;
grdSub.Rows[i].Cells[HGiveAwayFlag2Col].Value = grdMain.Rows[j].Cells[HGiveAwayFlagCol].Value;
@@ -1009,6 +1018,7 @@
DateTime HEndDate;
string HWorkLineName = "";
string HSeOrderBillNo = "";
+ Int64 HSeOrderSEQ = 0;
string HInnerBillNo = "";
bool HGiveAwayFlag = false;
Int64 HEntryID = 0;
@@ -1054,6 +1064,7 @@
HEndDate = ClsPub.isDate(grdSub.Rows[i].Cells[HEndDate2Col].Value);
HWorkLineName = ClsPub.isStrNull(grdSub.Rows[i].Cells[HSourceName2Col].Value);
HSeOrderBillNo = ClsPub.isStrNull(grdSub.Rows[i].Cells[HSeOrderBillNo2Col].Value);
+ HSeOrderSEQ = ClsPub.isLong(grdSub.Rows[i].Cells[HSeOrderSEQ2Col].Value);
HInnerBillNo = ClsPub.isStrNull(grdSub.Rows[i].Cells[HInnerBillNo2Col].Value);
HGiveAwayFlag = ClsPub.isBool(grdSub.Rows[i].Cells[HGiveAwayFlag2Col].Value);
oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
@@ -1062,7 +1073,7 @@
",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
- ",HGiveAwayFlag " +
+ ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " +
",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
") values ("
+ "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
@@ -1071,7 +1082,7 @@
+ ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
+ ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'"
+ ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() + "," + HEntryID.ToString() + ""
- + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag)
+ + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + HSeOrderSEQ.ToString() + "," + HSourceEntryID.ToString()
+ ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "')");
@@ -1154,7 +1165,7 @@
string HMaterNumber = ""; //鐗╂枡浠g爜
double HSumQty = 0; //浜у搧鏁伴噺
double HMinQty = 0; //鏈�灏忓寘瑁呮暟
- int HBQty = 0; //绠辨暟
+ Int64 HBQty = 0; //绠辨暟
double HQty = 0; //鏁伴噺
string WeiShu = ""; //灏炬暟
//int LSH = 0; //娴佹按鍙�
@@ -1205,7 +1216,7 @@
// return;
//}
- HBQty = HBQty + ClsPub.isInt(grdMain.Rows[j].Cells[HBQtyCol].Value);
+ HBQty = HBQty + ClsPub.isLong(grdMain.Rows[j].Cells[HBQtyCol].Value);
HMinQty = ClsPub.isDoule(grdMain.Rows[j].Cells[HMinQtyCol].Value);
HSumQty = ClsPub.isDoule(grdMain.Rows[j].Cells[HQtyCol].Value);
n = 0;
@@ -1478,7 +1489,7 @@
//
grdMain.RowCount = 0;
grdSub.RowCount = 0;
- grdMain.ColumnCount = 62; //鎬诲垪鏁�
+ grdMain.ColumnCount = 63; //鎬诲垪鏁�
DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name);
grdMain.Columns[HSnoCol].HeaderText = "搴忓彿";
grdMain.Columns[HMainIDCol].HeaderText = "婧愬崟涓籌D";
@@ -1520,6 +1531,7 @@
grdMain.Columns[HSPNameCol].HeaderText = "浠撲綅";
grdMain.Columns[HInstructNoCol].HeaderText = "鎸囦护鍗曞彿";
grdMain.Columns[HSeOrderBillNoCol].HeaderText = "閿�鍞鍗曞彿";
+ grdMain.Columns[HSeOrderSEQCol].HeaderText = "閿�鍞鍗曡鍙�";
grdMain.Columns[HDateCol].HeaderText = "杩涙枡鏃ユ湡";
grdMain.Columns[HRemarkCol].HeaderText = "澶囨敞";
grdMain.Columns[HMTONoCol].HeaderText = "璁″垝璺熻釜鍙�";
@@ -1611,7 +1623,7 @@
DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol,oSumGrid);
//----------------------------
- grdSub.ColumnCount = 59; //鎬诲垪鏁�
+ grdSub.ColumnCount = 60; //鎬诲垪鏁�
DBUtility.Xt_BaseBillFun.initGridFst(grdSub, this.Name);
grdSub.Columns[HSelectCol].HeaderText = "閫夋嫨";
grdSub.Columns[HTMCol].HeaderText = "鏉$爜缂栧彿";
@@ -1640,6 +1652,7 @@
grdSub.Columns[HSourceBillNo2Col].HeaderText = "婧愬崟鍗曞彿";
grdSub.Columns[HSourceBillType2Col].HeaderText = "婧愬崟绫诲瀷";
grdSub.Columns[HSeOrderBillNo2Col].HeaderText = "閿�鍞鍗曞彿";
+ grdSub.Columns[HSeOrderSEQ2Col].HeaderText = "閿�鍞鍗曡鍙�";
grdSub.Columns[HBarcodeNoCol].HeaderText = "鎵樺彿";
grdSub.Columns[HBarcodeQtysCol].HeaderText = "鎬绘墭鏁�";
grdSub.Columns[HSupID2Col].HeaderText = "渚涘簲鍟咺D";
@@ -2459,6 +2472,8 @@
{
grdMain.Rows[i].Cells[HGiveAwayFlagCol].Value = 0;
}
+ grdMain.Rows[i].Cells[HSeOrderBillNoCol].Value = oTable.Rows[0]["閿�鍞鍗曞彿"].ToString();
+ grdMain.Rows[i].Cells[HSeOrderSEQCol].Value = oTable.Rows[0]["閿�鍞鍗曡鍙�"].ToString();
}
}
@@ -2698,9 +2713,10 @@
#region //鎵撳嵃璁剧疆
GridppReport Report;
+ int CurRows = 0;
+ string sBarCodeItemID = ""; //鏉$爜鑷鍒�
//棰勮
- int CurRows = 0;
private void yl_Click(object sender, EventArgs e)
{
//鍒ゆ柇鏄惁宸茬粡鐢熸垚鏉$爜
@@ -2729,32 +2745,68 @@
}
}
- //鎵撳嵃鍓嶅垽鏂潯鐮佹槸鍚﹀凡鎵撳嵃杩�
+ //鎵撳嵃
+ private void dy_Click(object sender, EventArgs e)
+ {
+ //鍒ゆ柇鏄惁宸茬粡鐢熸垚鏉$爜
+ if (DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].Value) == "")
+ {
+ MessageBox.Show("鏉$爜鏈敓鎴愶紝璇峰厛鐢熸垚鏉$爜鍚庡啀鎵撳嵃锛�");
+ return;
+ }
+
+ //鎵撳嵃鍓嶅垽鏂潯鐮佹槸鍚﹀凡鎵撳嵃杩�
+ if (ReportPrintBegin())
+ {
+ return;
+ }
+
+ //閫夋嫨鎵撳嵃妯℃澘
+ BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp();
+ oFrm.sBillName = ModName;
+ oFrm.sBillModel = ModCaption;
+ oFrm.ShowDialog();
+ if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
+ {
+ //寰幆閫変腑琛�
+ Sub_SetReport(oFrm.sOpenTmp);
+ Report.Print(true);
+ Thread.Sleep(1000);
+ }
+ }
+
+ ////鎵撳嵃鍓嶅垽鏂潯鐮佹槸鍚﹀凡鎵撳嵃杩�
+ //private bool ReportPrintBegin()
+ //{
+ // string sRelQty = "";
+
+ // if (oBar.Set_BPrintQty(DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].Value), ref sRelQty))
+ // {
+ // MessageBox.Show("鏉$爜宸茬粡鎵撳嵃杩囷紝涓嶅彲閲嶅鎵撳嵃锛�");
+ // return true;
+ // }
+ // else
+ // {
+ // return false;
+ // }
+ //}
+
+ //鎵撳嵃鍓嶅垽鏂潯鐮佹槸鍚﹁秴杩囧厑璁稿彲鎵撳嵃娆℃暟
private bool ReportPrintBegin()
{
- string sRelQty = "";
-
- if (oBar.Set_BPrintQty(DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].Value), ref sRelQty))
+ string sHRemark = "";
+ if (PrintQtyCtl == "Y")
{
- MessageBox.Show("鏉$爜宸茬粡鎵撳嵃杩囷紝涓嶅彲閲嶅鎵撳嵃锛�");
- return true;
+ if (oBar.Set_CheckPrintQty_SD(HInterID, PrintQty, ref sHRemark))
+ {
+ MessageBox.Show(sHRemark);
+ return true;
+ }
+ return false;
}
else
{
return false;
- }
- }
-
- //鎵撳嵃缁撴潫鍚庡洖濉潯鐮佹墦鍗版鏁�
- private void ReportPrintEnd()
- {
- try
- {
- oCn.RunProc("update Gy_BarCodeBill set HPrintQty=isnull(HPrintQty,0)+1 where HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
- }
- catch (Exception e)
- {
- MessageBox.Show("鎵撳嵃澶辫触!鎵撳嵃缁撴潫 锛�" + e.Message);
}
}
@@ -2764,26 +2816,6 @@
for (int i = 0; i < grdList.Rows.Count; i++)
{
grdList.Rows[i].Cells[0].Value = "*";
- }
- //
- Report = new GridppReport();
- Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf"); //here .
- Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord);
- Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable);
- Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd);
- }
-
-
- private void Sub_SetReportView(string sOpenTmp)
- {
- //鍒ゆ柇琛屾暟
- for (int i = 0; i < grdList.Rows.Count; i++)
- {
- grdList.Rows[i].Cells[0].Value = "";
- }
- for (int i = 0; i < grdList.SelectedRows.Count; i++)
- {
- grdList.Rows[grdList.SelectedRows[i].Index].Cells[0].Value = "*";
}
//
Report = new GridppReport();
@@ -2815,11 +2847,7 @@
}
}
- private Int32 Fun_GetCol(string sCol)
- {
- return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdList);
- }
-
+ //濉叆鍗曟嵁琛ㄤ綋淇℃伅
private void ReportFetchRecordByDataTable()
{
try
@@ -2833,17 +2861,40 @@
}
}
- private void dy_Click(object sender, EventArgs e)
+ ////鎵撳嵃缁撴潫鍚庡洖濉潯鐮佹墦鍗版鏁�
+ //private void ReportPrintEnd()
+ //{
+ // try
+ // {
+ // oCn.RunProc("update Gy_BarCodeBill set HPrintQty=isnull(HPrintQty,0)+1 where HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ // }
+ // catch (Exception e)
+ // {
+ // MessageBox.Show("鎵撳嵃澶辫触!鎵撳嵃缁撴潫 锛�" + e.Message);
+ // }
+ //}
+
+ //鎵撳嵃缁撴潫鍚庡洖濉潯鐮佹墦鍗版鏁�
+ private void ReportPrintEnd()
+ {
+ if (UpdatePrintQtyCtl == "Y")
+ {
+ oBar.Set_UpdatePrintQty_SD(HInterID);
+ }
+ }
+
+ //璇曟墦鍗�
+ private void sdy_Click(object sender, EventArgs e)
{
//鍒ゆ柇鏄惁宸茬粡鐢熸垚鏉$爜
if (DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].Value) == "")
{
- MessageBox.Show("鏉$爜鏈敓鎴愶紝璇峰厛鐢熸垚鏉$爜鍚庡啀鎵撳嵃锛�");
+ MessageBox.Show("鏉$爜鏈敓鎴愶紝璇峰厛鐢熸垚鏉$爜鍚庡啀棰勮锛�");
return;
}
//鎵撳嵃鍓嶅垽鏂潯鐮佹槸鍚﹀凡鎵撳嵃杩�
- if (ReportPrintBegin())
+ if (ReportPrintBegin_SDY())
{
return;
}
@@ -2855,12 +2906,71 @@
oFrm.ShowDialog();
if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
{
- //寰幆閫変腑琛�
- Sub_SetReport(oFrm.sOpenTmp);
- Report.Print(true);
+ Sub_SetReportView(oFrm.sOpenTmp);
+ Report.PrintPreview(false);
Thread.Sleep(1000);
}
}
+
+ //鎵撳嵃鍓嶅垽鏂潯鐮佹槸鍚﹁秴杩囧厑璁稿彲鎵撳嵃娆℃暟
+ private bool ReportPrintBegin_SDY()
+ {
+ string sHRemark = "";
+ sBarCodeItemID = "";
+ for (int i = 0; i < grdList.SelectedRows.Count; i++)
+ {
+ sBarCodeItemID = sBarCodeItemID + "," + DBUtility.ClsPub.isLong(grdList.Rows[grdList.SelectedRows[i].Index].Cells[Fun_GetCol("HItemID")].Value).ToString();
+ }
+ sBarCodeItemID = sBarCodeItemID.Remove(0, 1);
+
+ if (PrintQtyCtl == "Y")
+ {
+ if (oBar.Set_CheckPrintQty(sBarCodeItemID, PrintQty, ref sHRemark))
+ {
+ MessageBox.Show(sHRemark);
+ return true;
+ }
+ return false;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ private void Sub_SetReportView(string sOpenTmp)
+ {
+ //鍒ゆ柇琛屾暟
+ for (int i = 0; i < grdList.Rows.Count; i++)
+ {
+ grdList.Rows[i].Cells[0].Value = "";
+ }
+ for (int i = 0; i < grdList.SelectedRows.Count; i++)
+ {
+ grdList.Rows[grdList.SelectedRows[i].Index].Cells[0].Value = "*";
+ }
+ //
+ Report = new GridppReport();
+ Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf"); //here .
+ Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord);
+ Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable);
+ Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd_SDY);
+ }
+
+ //鎵撳嵃缁撴潫鍚庡洖濉潯鐮佹墦鍗版鏁�
+ private void ReportPrintEnd_SDY()
+ {
+ if (UpdatePrintQtyCtl == "Y")
+ {
+ oBar.Set_UpdatePrintQty(sBarCodeItemID);
+ }
+ }
+
+ private Int32 Fun_GetCol(string sCol)
+ {
+ return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdList);
+ }
+
#endregion
@@ -2904,7 +3014,7 @@
}
sWhere = " and HOrgID =" + sHOrgID.ToString();
BLL.Cls_S_KF_ICInventoryList_IF oadd = new BLL.Cls_S_KF_ICInventoryList_IF();
- if (oadd.Refresh("")) //閫夋嫨鍘熷崟
+ if (oadd.Refresh(sWhere)) //閫夋嫨鍘熷崟
//if (oadd.Refresh(" and HErpClsID in (1,2,3) ")) //閫夋嫨鍘熷崟
{
FillSelectData(oadd.oBillSelectColl);
@@ -3003,6 +3113,12 @@
grdMain.Rows[row + r].Cells[HMTONoCol].Value = grdMain.Rows[row].Cells[HMTONoCol].Value;
grdMain.Rows[row + r].Cells[HInnerBillNoCol].Value = grdMain.Rows[row].Cells[HInnerBillNoCol].Value;
grdMain.Rows[row + r].Cells[HMakerCol].Value = grdMain.Rows[row].Cells[HMakerCol].Value;
+ //缃戞牸鎵撳嬀
+ DataGridViewCheckBoxCell oCell = new DataGridViewCheckBoxCell();
+ oCell.ThreeState = false;
+ oCell.Value = grdMain.Rows[row].Cells[HGiveAwayFlagCol].Value;
+ oCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
+ grdMain.Rows[row + r].Cells[HGiveAwayFlagCol] = oCell;
}
DBUtility.Xt_BaseBillFun.SetSumGrid(oSumGrid);
@@ -3191,33 +3307,6 @@
}
}
- private void sdy_Click(object sender, EventArgs e)
- {
- //鍒ゆ柇鏄惁宸茬粡鐢熸垚鏉$爜
- if (DBUtility.ClsPub.isStrNull(grdSub.Rows[0].Cells[HTMCol].Value) == "")
- {
- MessageBox.Show("鏉$爜鏈敓鎴愶紝璇峰厛鐢熸垚鏉$爜鍚庡啀棰勮锛�");
- return;
- }
-
- //鎵撳嵃鍓嶅垽鏂潯鐮佹槸鍚﹀凡鎵撳嵃杩�
- if (ReportPrintBegin())
- {
- return;
- }
-
- //閫夋嫨鎵撳嵃妯℃澘
- BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp();
- oFrm.sBillName = ModName;
- oFrm.sBillModel = ModCaption;
- oFrm.ShowDialog();
- if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
- {
- Sub_SetReportView(oFrm.sOpenTmp);
- Report.PrintPreview(false);
- Thread.Sleep(1000);
- }
- }
//鐢熸垚澶栫鐮�
private void wxm_Click(object sender, EventArgs e)
--
Gitblit v1.9.1