| | |
| | | txtHBarCode.Text = ""; |
| | | grdMain.DataSource = null; |
| | | grdSub.DataSource = null; |
| | | chkHDYFlag.Checked = true; |
| | | } |
| | | |
| | | //çªä½å è½½ |
| | |
| | | BarCode_Display(); |
| | | grdMain.Rows[0].Selected = true; |
| | | |
| | | //æå°æ¡ç |
| | | sBarCodeItemID = DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[0].Index].Cells[Fun_GetCol("HItemID")].Value).ToString(); |
| | | Sub_SetReport("ç©ææ¡ç "); |
| | | Report.Print(false); |
| | | Thread.Sleep(1000); |
| | | //èªå¨æå° |
| | | if (chkHDYFlag.Checked == true) |
| | | { |
| | | //æå°æ¡ç |
| | | Sub_SetReport("ç©ææ¡ç "); |
| | | Report.Print(false); |
| | | Thread.Sleep(1000); |
| | | } |
| | | else |
| | | { |
| | | //éæ©æå°æ¨¡æ¿ |
| | | 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(false); |
| | | Thread.Sleep(1000); |
| | | } |
| | | } |
| | | |
| | | txtHQty.Text = ""; |
| | | txtHWeightQyt.Text = ""; |
| | | txtHKDQty.Text = ""; |
| | | txtHBarcodeNo.Text = ""; |
| | | txtHRemark.Text = ""; |
| | | txtHRemark.Tag = 0; |
| | | txtHQty.Focus(); |
| | | } |
| | | |
| | |
| | | else if (DBUtility.ClsPub.isDoule( txtHWeightQyt.Text) == 0) |
| | | { |
| | | MessageBox.Show("请è¾å
¥æ£ç¡®ééï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | else if (DBUtility.ClsPub.isInt(txtHBarcodeNo.Text) == 0) |
| | | { |
| | | MessageBox.Show("请è¾å
¥å
å·ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | else if (HWhID==0) |
| | |
| | | string HMaterName = ""; |
| | | string HMaterModel = ""; |
| | | string ProcessExchangeBillNo = ""; |
| | | Int64 HBarcodeNo = 0; //å
æ° |
| | | Int64 HBadReasonID = 0; //ä¸è¯åå ID |
| | | |
| | | HBarCode = TM; |
| | | HBarCodeType = DBUtility.ClsPub.isStrNull(cmbHBarCodeType.Text); |
| | |
| | | HMaterName = DBUtility.ClsPub.isStrNull(txtHMaterName.Text); |
| | | HMaterModel = DBUtility.ClsPub.isStrNull(txtHMaterModel.Text); |
| | | ProcessExchangeBillNo = DBUtility.ClsPub.isStrNull(txtHBillNo.Text); |
| | | HBarcodeNo = DBUtility.ClsPub.isLong(txtHBarcodeNo.Text); |
| | | HBadReasonID = DBUtility.ClsPub.isLong(txtHRemark.Tag); |
| | | |
| | | try |
| | | { |
| | |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate,HMaterialJQty,HMaterialMQty " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HGiveAwayFlag " + |
| | | ",HOrderInterID,HOrderEntryID,HOrderBillNo " + |
| | | ",HOrderInterID,HOrderEntryID,HOrderBillNo,HCustomQty1 " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " + |
| | | ") Values (" |
| | | + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() |
| | | + ",'" + HBatchNo + "'," + HSupID.ToString() + ",0,'" + HMaker + "',getdate(),0," + HQty.ToString() |
| | | + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "',''" |
| | | + ", 1,1," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'" |
| | | + ", 1," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'" |
| | | + ", 0,'',getdate(),'','" + sDate + "'," + HMaterialJQty.ToString() + "," + HMaterialMQty.ToString() |
| | | + ", " + HStockOrgID.ToString() + "," + HStockOrgID.ToString() + ",''," + HInterID.ToString() + ",0" |
| | | + ", " + ProcessExchangeInterID.ToString() + ",0,'" + ProcessExchangeBillNo + "'" |
| | | + ", " + ProcessExchangeInterID.ToString() + ",0,'" + ProcessExchangeBillNo + "'," + HBadReasonID.ToString() |
| | | + ",'" + HMaterName + "','" + HMaterModel + "',''," + HAuxPropID.ToString() + ",'','')"); |
| | | |
| | | //åå¡«æå¤§æµæ°´å· |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo_QTY '" + sTMNumber + "',1 "); |
| | | |
| | | //åå¡«æºå临æ¶è¡¨HInterID |
| | | oCn.RunProc("update a set a.HInterID=" + HInterID.ToString() + " from KF_WeighSource_Temp a where a.HInterID<>" + HInterID.ToString() + " and a.HMaker='" + HMaker + "' and convert(varchar(10),a.HMakeDate,120)=convert(varchar(10),getdate(),120)"); |
| | | oCn.RunProc("update a set a.HInterID=" + HInterID.ToString() + ",a.HBillNo='" + HBillNo + "' from KF_WeighSource_Temp a where a.HInterID<>" + HInterID.ToString() + " and a.HMaker='" + HMaker + "' and convert(varchar(10),a.HMakeDate,120)=convert(varchar(10),getdate(),120)"); |
| | | |
| | | //åå
¥æ¡ç åºå
¥åºä¸´æ¶è¡¨ |
| | | oCn.RunProc("Insert into KF_PonderationBillMain_Temp " + |
| | |
| | | + "," + HWhID.ToString() + ",0," + HSPID.ToString() + ",0,0,''" |
| | | +",0," + HQty.ToString() + ",1,'" + HBatchNo + "','" + HBarCode + "',''" |
| | | +",'" + HMaker + "',getdate()," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillType + "','" + HSourceBillNo + "'" |
| | | +",0,0,'0',0,'',0" |
| | | +",0,0,'',0,'',0" |
| | | +"," + HStockOrgID.ToString() + "," + HStockOrgID.ToString() + "," + HStockOrgID.ToString() + ",'','ç§°éå
¥åºçæ','2'" |
| | | +",0,0,'',0)"); |
| | | |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region //ä½åº |
| | | private void cmdZF_Click(object sender, EventArgs e) |
| | | { |
| | | if (grdMain.CurrentRow == null) |
| | | { |
| | | MessageBox.Show("请å
éæ©éè¦ä½åºçæ¡ç ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (MessageBox.Show("ç¡®å®è¦ä½åºæéæ¡ç ï¼", "æç¤º", MessageBoxButtons.OKCancel) == DialogResult.Cancel) |
| | | { |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | string HRemark = ""; |
| | | string HItemID = ""; |
| | | string HBarCode = ""; |
| | | string HBarCode2 = ""; |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | HItemID = HItemID + "," + DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value.ToString()); |
| | | HBarCode = HBarCode + ",'" + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value) + "'"; |
| | | if (i != 0 && i % 100 == 0) |
| | | { |
| | | HBarCode2 = HBarCode2 + "#" + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | } |
| | | else |
| | | { |
| | | HBarCode2 = HBarCode2 + "," + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("ä½åºæ è®°")].Value) != "") |
| | | { |
| | | HRemark = HRemark + "ã" + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | } |
| | | } |
| | | if (HRemark != "") |
| | | { |
| | | MessageBox.Show("æéæ¡ç ç¼å·ï¼"+ HRemark.Remove(0, 1)+" å·²ä½åºï¼ä¸å
许éå¤ä½åºï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | HItemID = HItemID.Remove(0, 1); //廿å符串第ä¸ä¸ªå符 |
| | | HBarCode = HBarCode.Remove(0, 1); |
| | | HBarCode2 = HBarCode2.Remove(0, 1); |
| | | |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | string[] NewBarCode; |
| | | NewBarCode = HBarCode2.Split(Convert.ToChar("#")); |
| | | |
| | | //ä½åºæ¡ç |
| | | oCn.RunProc("update Gy_BarCodeBill set HStopflag=1,HDeleteMan='" + DBUtility.ClsPub.CurUserName + "',HDeleteDate=getdate() where HItemID in (" + HItemID + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å 餿¡ç åºå
¥åºä¸´æ¶è¡¨è®°å½ |
| | | oCn.RunProc("delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HBarCode in (" + HBarCode + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //åå
¥ç³»ç»æ¥å¿ |
| | | for (int i = 0; i <= NewBarCode.Length - 1; i++) |
| | | { |
| | | oCn.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','ä½åºæ¡ç ï¼" + NewBarCode[i] + "','ç§°éå
¥åºæ¨¡å','" + DBUtility.ClsPub.IPAddress + "','ä½åº'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | oCn.Commit(); |
| | | } |
| | | catch (Exception e2) |
| | | { |
| | | oCn.RollBack(); |
| | | MessageBox.Show("ä½åºæ¡ç 失败ï¼" + e2.Message, "æç¤º"); |
| | | return; |
| | | } |
| | | //å·æ°ç§°éè®°å½åè¡¨ä¿¡æ¯ |
| | | BarCode_Display(); |
| | | MessageBox.Show("æéæ¡ç ç¼å·ï¼" + HBarCode.Remove(0, 1) + " ä½åºæåï¼", "æç¤º"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region //åä½åº |
| | | private void cmdFZF_Click(object sender, EventArgs e) |
| | | { |
| | | if (grdMain.CurrentRow == null) |
| | | { |
| | | MessageBox.Show("请å
éæ©éè¦åä½åºçæ¡ç ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (MessageBox.Show("ç¡®å®è¦åä½åºæéæ¡ç ï¼", "æç¤º", MessageBoxButtons.OKCancel) == DialogResult.Cancel) |
| | | { |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | string HRemark = ""; |
| | | string HItemID = ""; |
| | | string HBarCode = ""; |
| | | string HBarCode2 = ""; |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | HItemID = HItemID + "," + DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value.ToString()); |
| | | HBarCode = HBarCode + ",'" + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value) + "'"; |
| | | if (i != 0 && i % 100 == 0) |
| | | { |
| | | HBarCode2 = HBarCode2 + "#" + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | } |
| | | else |
| | | { |
| | | HBarCode2 = HBarCode2 + "," + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("ä½åºæ è®°")].Value) == "") |
| | | { |
| | | HRemark = HRemark + "ã" + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | } |
| | | } |
| | | if (HRemark != "") |
| | | { |
| | | MessageBox.Show("æéæ¡ç ç¼å·ï¼" + HRemark.Remove(0, 1) + " æªä½åºï¼ä¸å
许åä½åºï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | HItemID = HItemID.Remove(0, 1); //廿å符串第ä¸ä¸ªå符 |
| | | HBarCode = HBarCode.Remove(0, 1); |
| | | HBarCode2 = HBarCode2.Remove(0, 1); |
| | | |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | string[] NewBarCode; |
| | | NewBarCode = HBarCode2.Split(Convert.ToChar("#")); |
| | | |
| | | //åä½åºæ¡ç |
| | | oCn.RunProc("update Gy_BarCodeBill set HStopflag=0,HDeleteMan='',HDeleteDate=null where HItemID in (" + HItemID + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | //å 餿¡ç åºå
¥åºä¸´æ¶è¡¨è®°å½ |
| | | oCn.RunProc("delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HBarCode in (" + HBarCode + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | //åå
¥æ¡ç åºå
¥åºä¸´æ¶è¡¨ |
| | | oCn.RunProc("Insert into KF_PonderationBillMain_Temp " + |
| | | "(HInterID,HBillNo,HBillType,HMaterID,HAuxPropID,HProcID" + |
| | | ",HWhID,HSCWHID,HStockPlaceID,HOutStockPlaceID,HGroupID,HAddr" + |
| | | ",HQtyMust,HQty,HPieceQty,HBatchNo,HBarCode,HBarCode_Pack" + |
| | | ",HMaker,HMakeDate,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo" + |
| | | ",HRelationInterID,HRelationEntryID,HRelationBillNo,HRedBlueFlag,HMTONo,HPlanMode" + |
| | | ",HSTOCKORGID,HOtherOrgID,HOWNERID,HOWNERTYPEID,HExpressNumber,HSubBillType" + |
| | | ",HCusID,HDeptID,HCusBarCode,HMulSourceBill) " + |
| | | " select " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "',HMaterID,HAuxPropID,0" + |
| | | ",HWhID,0,HSPID,0,0,''" + |
| | | ",0,HQty,1,HBatchNo,HBarCode,''" + |
| | | ",'" + HMaker + "',getdate(),HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo" + |
| | | ",0,0,'',0,'',0" + |
| | | ",HSTOCKORGID,HSTOCKORGID,HSTOCKORGID,'','ç§°éå
¥åºçæ-åä½åº','2'" + |
| | | ",0,0,'',0" + |
| | | "from Gy_BarCodeBill with(nolock) where HItemID in (" + HItemID + ")" |
| | | ); |
| | | |
| | | //åå
¥ç³»ç»æ¥å¿ |
| | | for (int i = 0; i <= NewBarCode.Length - 1; i++) |
| | | { |
| | | oCn.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','åä½åºæ¡ç ï¼" + NewBarCode[i] + "','ç§°éå
¥åºæ¨¡å','" + DBUtility.ClsPub.IPAddress + "','åä½åº'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | oCn.Commit(); |
| | | } |
| | | catch (Exception e2) |
| | | { |
| | | oCn.RollBack(); |
| | | MessageBox.Show("åä½åºæ¡ç 失败ï¼" + e2.Message, "æç¤º"); |
| | | return; |
| | | } |
| | | //å·æ°ç§°éè®°å½åè¡¨ä¿¡æ¯ |
| | | BarCode_Display(); |
| | | MessageBox.Show("æéæ¡ç ç¼å·ï¼" + HBarCode.Remove(0, 1) + " åä½åºæåï¼", "æç¤º"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region //夿³¨ ä¸è¯åå éæ© |
| | | private void cmdHBadReasonID_Click(object sender, EventArgs e) |
| | | { |
| | | DAL.ClsGy_BadReason_View oBadReason = new DAL.ClsGy_BadReason_View(); |
| | | if (oBadReason.RefreshView()) |
| | | { |
| | | this.txtHRemark.Text = oBadReason.oModel.HName; |
| | | this.txtHRemark.Tag = oBadReason.oModel.HItemID.ToString(); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |