| | |
| | | public const Int16 HWMinQtyCol = 33; |
| | | public const Int16 HWBQtyCol = 34; |
| | | public const Int16 HCustomQty1Col = 35; |
| | | public const Int16 HZMinQtyCol = 36; |
| | | public const Int16 HZBQtyCol = 37; |
| | | public const Int16 HCustomQty2Col = 38; |
| | | public const Int16 HProduceDateCol = 39; |
| | | public const Int16 HExpiryDateCol = 40; |
| | | public const Int16 HCusIDCol = 41; |
| | | public const Int16 HCusNumberCol = 42; |
| | | public const Int16 HCusNameCol = 43; |
| | | public const Int16 HSourceInterIDCol = 44; |
| | | public const Int16 HSourceEntryIDCol = 45; |
| | | public const Int16 HSourceBillNoCol = 46; |
| | | public const Int16 HSourceBillTypeCol = 47; |
| | | public const Int16 HInitQtyCol = 48; |
| | | public const Int16 HMTONoCol = 49; |
| | | public const Int16 HISKFPERIODCol = 50; |
| | | public const Int16 HEXPUNITCol = 51; |
| | | public const Int16 HEXPPERIODCol = 52; |
| | | public const Int16 HLSHCol = 53; |
| | | public const Int16 HBaNoCol = 54; |
| | | public const Int16 HCusModelCol = 55; |
| | | public const Int16 HRemarkCol = 56; |
| | | public const Int16 HCustomQty3Col = 36; |
| | | public const Int16 HZMinQtyCol = 37; |
| | | public const Int16 HZBQtyCol = 38; |
| | | public const Int16 HCustomQty2Col = 39; |
| | | public const Int16 HCustomQty4Col = 40; |
| | | public const Int16 HProduceDateCol = 41; |
| | | public const Int16 HExpiryDateCol = 42; |
| | | public const Int16 HCusIDCol = 43; |
| | | public const Int16 HCusNumberCol = 44; |
| | | public const Int16 HCusNameCol = 45; |
| | | public const Int16 HSourceInterIDCol = 46; |
| | | public const Int16 HSourceEntryIDCol = 47; |
| | | public const Int16 HSourceBillNoCol = 48; |
| | | public const Int16 HSourceBillTypeCol = 49; |
| | | public const Int16 HInitQtyCol = 50; |
| | | public const Int16 HMTONoCol = 51; |
| | | public const Int16 HISKFPERIODCol = 52; |
| | | public const Int16 HEXPUNITCol = 53; |
| | | public const Int16 HEXPPERIODCol = 54; |
| | | public const Int16 HLSHCol = 55; |
| | | public const Int16 HBaNoCol = 56; |
| | | public const Int16 HCusModelCol = 57; |
| | | public const Int16 HRemarkCol = 58; |
| | | // |
| | | public string ModName = "85"; |
| | | public string ModCaption = "èæ³å®¢æ·æ ç¾çæ"; |
| | |
| | | string HCustom6 = ""; //æåæå· |
| | | double HCustomQty1 = 0; //æ´ç®±æ¯é |
| | | double HCustomQty2 = 0; //æ´æ æ¯é |
| | | string HWei = ""; //尾箱/å°¾æ æ è®° |
| | | Int64 HSno = 0; //æ¹æ¬¡åºåå· |
| | | string HBoxNo = ""; //æ¹æ¬¡çæåç¼ |
| | | string sHBaNo = ""; //çé¢ä¸è¾å
¥çæ¹æ¬¡ä½ |
| | |
| | | } |
| | | // |
| | | LSH = LSH + 1; |
| | | LSH2 = ConvertToBase(ClsPub.isInt(LSH), 33); |
| | | LSH2 = ConvertToBase(ClsPub.isInt(LSH), 32); |
| | | while (LSH2.Length < LSHlen) //å¦ææµæ°´å·ä½æ°å°äº LSHlen åé¢è¡¥0 |
| | | { |
| | | LSH2 = "0" + LSH2; |
| | |
| | | nn = 0; //æ¬æ¬¡æµæ°´å·ç´¯è®¡ä½¿ç¨ä¸ªæ° |
| | | for (int i = 0; i < HWBQty; i++) |
| | | { |
| | | if (HSumQty - HWMinQty > 0) |
| | | if (HSumQty - HWMinQty >= 0) |
| | | { |
| | | HWei = ""; |
| | | HSumQty = HSumQty - HWMinQty; |
| | | HCustomQty1 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty1Col].Value); // æ´ç®±æ¯é çé¢ä¸è¾å
¥ |
| | | } |
| | | else |
| | | { |
| | | HWei = "å°¾æ°"; |
| | | HWMinQty = HSumQty; |
| | | HCustomQty1 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty3Col].Value); // 尾箱æ¯é çé¢ä¸è¾å
¥ |
| | | if (HCustomQty1 <= 0) |
| | | { |
| | | MessageBox.Show("第 " + ClsPub.isStrNull(grdMain.Rows[j].Cells[HSnoCol].Value) + " è¡ç©æï¼å°¾ç®±æ¯éä¸å
许å°äº 0 ï¼"); |
| | | bc.Enabled = true; |
| | | oCn.RollBack(); |
| | | return; |
| | | } |
| | | } |
| | | // |
| | | LWSH = LWSH + 1; |
| | | LSH2 = ConvertToBase(ClsPub.isInt(LWSH), 33); |
| | | LSH2 = LWSH.ToString(); |
| | | while (LSH2.Length < LWSHlen) //妿å¤ç®±æµæ°´å·ä½æ°å°äº å¤ç®±æµæ°´å·é¿åº¦ åé¢è¡¥0 |
| | | { |
| | | LSH2 = "0" + LSH2; |
| | |
| | | HCustom4 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCustom4Col].Value); // FRU çé¢ä¸è¾å
¥ |
| | | HCustom5 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCustom5Col].Value); // EC çé¢ä¸è¾å
¥ |
| | | HCustom6 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCustom6Col].Value); // æåæå· çé¢ä¸è¾å
¥ |
| | | HCustomQty1 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty1Col].Value); // æ´ç®±æ¯é çé¢ä¸è¾å
¥ |
| | | HCustomQty2 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty2Col].Value); // æ´æ æ¯é çé¢ä¸è¾å
¥ |
| | | |
| | | //FRU HCustom4ãEC HCustom5ãæåæå· HCustom6ãæ´ç®±æ¯éHCustomQty1ãæ´æ æ¯éHCustomQty2 |
| | |
| | | ") values (" + HInterID + "," + HEntryID + ",'','" + HBarCode + "','" + HBarCodeType + "'" |
| | | + "," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HAuxPropID.ToString() + ",'" + HBatchNo + "'," + HQty.ToString() |
| | | + "," + HCusID.ToString() + ",'" + HCusModel + "','" + HCusModelName + "','" + sDate + "',''" |
| | | + "," + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + DBUtility.ClsPub.BoolToString(HISKFPERIOD) + ",''" |
| | | + "," + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + DBUtility.ClsPub.BoolToString(HISKFPERIOD) + ",'" + HWei + "'" |
| | | + "," + (HProduceDate == "" ? "NULL" : "'" + HProduceDate + "'") + "," + (HExpiryDate == "" ? "NULL" : "'" + HExpiryDate + "'") |
| | | + "," + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + ",1,0" |
| | | + "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "'" |
| | |
| | | nn = 0; //æ¬æ¬¡æµæ°´å·ç´¯è®¡ä½¿ç¨ä¸ªæ° |
| | | for (int i = 0; i < HZBQty; i++) |
| | | { |
| | | if (HSumQty - HZMinQty > 0) |
| | | if (HSumQty - HZMinQty >= 0) |
| | | { |
| | | HWei = ""; |
| | | HSumQty = HSumQty - HZMinQty; |
| | | HCustomQty2 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty2Col].Value); // æ´æ æ¯é çé¢ä¸è¾å
¥ |
| | | } |
| | | else |
| | | { |
| | | HWei = "å°¾æ°"; |
| | | HZMinQty = HSumQty; |
| | | HCustomQty2 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty4Col].Value); // å°¾æ æ¯é çé¢ä¸è¾å
¥ |
| | | if (HCustomQty2 <= 0) |
| | | { |
| | | MessageBox.Show("第 "+ClsPub.isStrNull(grdMain.Rows[j].Cells[HSnoCol].Value)+" è¡ç©æï¼å°¾æ æ¯éä¸å
许å°äº 0 ï¼"); |
| | | bc.Enabled = true; |
| | | oCn.RollBack(); |
| | | return; |
| | | } |
| | | } |
| | | // |
| | | LZSH = LZSH + 1; |
| | | LSH2 = ConvertToBase(ClsPub.isInt(LZSH), 33); |
| | | LSH2 = LZSH.ToString(); |
| | | while (LSH2.Length < LWSHlen) //妿å¤ç®±æµæ°´å·ä½æ°å°äº å¤ç®±æµæ°´å·é¿åº¦ åé¢è¡¥0 |
| | | { |
| | | LSH2 = "0" + LSH2; |
| | |
| | | HCustom5 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCustom5Col].Value); // EC çé¢ä¸è¾å
¥ |
| | | HCustom6 = ClsPub.isStrNull(grdMain.Rows[j].Cells[HCustom6Col].Value); // æåæå· çé¢ä¸è¾å
¥ |
| | | HCustomQty1 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty1Col].Value); // æ´ç®±æ¯é çé¢ä¸è¾å
¥ |
| | | HCustomQty2 = ClsPub.isDoule(grdMain.Rows[j].Cells[HCustomQty2Col].Value); // æ´æ æ¯é çé¢ä¸è¾å
¥ |
| | | |
| | | //FRU HCustom4ãEC HCustom5ãæåæå· HCustom6ãæ´ç®±æ¯éHCustomQty1ãæ´æ æ¯éHCustomQty2 |
| | | oCn.RunProc("insert into Gy_BarCodeBill_Cus" + |
| | |
| | | ") values (" + HInterID + "," + HEntryID + ",'','" + HBarCode + "','" + HBarCodeType + "'" |
| | | + "," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HAuxPropID.ToString() + ",'" + HBatchNo + "'," + HQty.ToString() |
| | | + "," + HCusID.ToString() + ",'" + HCusModel + "','" + HCusModelName + "','" + sDate + "',''" |
| | | + "," + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + DBUtility.ClsPub.BoolToString(HISKFPERIOD) + ",''" |
| | | + "," + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + DBUtility.ClsPub.BoolToString(HISKFPERIOD) + ",'" + HWei + "'" |
| | | + "," + (HProduceDate == "" ? "NULL" : "'" + HProduceDate + "'") + "," + (HExpiryDate == "" ? "NULL" : "'" + HExpiryDate + "'") |
| | | + "," + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + ",1,0" |
| | | + "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "'" |
| | |
| | | #region å°åè¿å¶æ°å¼è½¬ææå®è¿å¶æ°å¼ï¼num为è¦è½¬æ¢çåè¿è¡æ°å¼ï¼nbase为æå®è¿å¶ï¼ |
| | | public string ConvertToBase(int num, int nbase) |
| | | { |
| | | string chars = "0123456789ABCDEFGHJKLMNPQRSTVWXYZ"; |
| | | string chars = "0123456789ABCDEFGHJKLMNPRSTVWXYZ"; //æ°å+忝ç»åï¼åæ¯ä¸å
å«IOQU |
| | | if (nbase < 2 || nbase > chars.Length) |
| | | return ""; |
| | | int r; |
| | |
| | | private void initGrid() |
| | | { |
| | | grdMain.RowCount = 0; |
| | | grdMain.ColumnCount = 57; //æ»åæ° |
| | | grdMain.ColumnCount = 59; //æ»åæ° |
| | | DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name); |
| | | grdMain.Columns[HSnoCol].HeaderText = "åºå·"; |
| | | grdMain.Columns[HMainIDCol].HeaderText = "æºå主ID"; |
| | |
| | | grdMain.Columns[HCustom6Col].HeaderText = "æåæå·"; |
| | | grdMain.Columns[HCustomQty1Col].HeaderText = "æ´ç®±æ¯é"; |
| | | grdMain.Columns[HCustomQty2Col].HeaderText = "æ´æ æ¯é"; |
| | | grdMain.Columns[HCustomQty3Col].HeaderText = "尾箱æ¯é"; |
| | | grdMain.Columns[HCustomQty4Col].HeaderText = "å°¾æ æ¯é"; |
| | | |
| | | //æ ¼å¼å éèå |
| | | grdMain.Columns[HTagCol].Visible = false; |
| | |
| | | "," + HCustom6Col.ToString() + |
| | | "," + HCustomQty1Col.ToString() + |
| | | "," + HCustomQty2Col.ToString() + |
| | | "," + HCustomQty3Col.ToString() + |
| | | "," + HCustomQty4Col.ToString() + |
| | | "," + HRemarkCol.ToString(); |
| | | |
| | | //设置å计å |
| | |
| | | "," + HCustom6Col.ToString() + |
| | | "," + HCustomQty1Col.ToString() + |
| | | "," + HCustomQty2Col.ToString() + |
| | | "," + HCustomQty3Col.ToString() + |
| | | "," + HCustomQty4Col.ToString() + |
| | | "," + HRemarkCol.ToString(); |
| | | grdMain.Columns[HBillNoCol].ReadOnly = true; |
| | | //设置å计å |