| | |
| | | InitializeComponent(); |
| | | } |
| | | public frmBillQueryCondition_New frmCondition; |
| | | public string ViewName = "Sc_ICMOBillStatus_Tmp"; |
| | | public string ModCaption = "ç§°éå
¥åº"; |
| | | public const string ModName = "85"; |
| | | public Int64 HInterID = 0; |
| | |
| | | public Int64 HSourceEntryID = 0; |
| | | public string HSourceBillNo = ""; |
| | | public string HSourceBillType = ""; |
| | | public Int64 ProcessExchangeInterID = 0; |
| | | public Int64 HSupID = 0; |
| | | public double HSourceQty = 0; |
| | | public double HMaterWeight = 0; //ç©æå
é |
| | | public string HMaker = DBUtility.ClsPub.CurUserName; |
| | | public Int64 HStockOrgID = DBUtility.ClsPub.HOrgID; |
| | | public DateTime HDate = DateTime.Today; |
| | |
| | | cmbHBarCodeType.Items.Clear(); |
| | | cmbHBarCodeType.Items.Add("å¯ä¸æ¡ç "); |
| | | DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp); |
| | | txtHBarCode.Text = ""; |
| | | grdMain.DataSource = null; |
| | | grdSub.DataSource = null; |
| | | chkHDYFlag.Checked = true; |
| | | } |
| | | |
| | | //çªä½å è½½ |
| | |
| | | { |
| | | frmCondition = new frmBillQueryCondition_New(); |
| | | this.Text = ModCaption; |
| | | initGrid(); |
| | | Sub_GetSystemParameter(); |
| | | } |
| | | |
| | |
| | | HInterID = DBUtility.ClsPub.CreateBillID_Prod(HBillType, ref DBUtility.ClsPub.sExeReturnInfo); //å¾å°æ°åæ®ID |
| | | HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(HBillType, ref DBUtility.ClsPub.sExeReturnInfo, true); //å¾å°æ°åæ®å· |
| | | } |
| | | else if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | HInterID = DBUtility.ClsPub.CreateBillID_Prod(HBillType, ref DBUtility.ClsPub.sExeReturnInfo); //å¾å°æ°åæ®ID |
| | | HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(HBillType, ref DBUtility.ClsPub.sExeReturnInfo, true); //å¾å°æ°åæ®å· |
| | | } |
| | | else |
| | | { |
| | | HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); |
| | |
| | | GraphicsGrid(); |
| | | } |
| | | |
| | | private void grdSub_Paint(object sender, PaintEventArgs e) |
| | | { |
| | | GraphicsGrid(); |
| | | } |
| | | |
| | | private void GraphicsGrid() |
| | | { |
| | | DBUtility.Xt_BaseBillFun.GraphicsGrid(grdMain); |
| | | } |
| | | |
| | | private void grdSub_Paint(object sender, PaintEventArgs e) |
| | | { |
| | | GraphicsGridSub(); |
| | | } |
| | | |
| | | private void GraphicsGridSub() |
| | | { |
| | | DBUtility.Xt_BaseBillFun.GraphicsGrid(grdSub); |
| | | } |
| | | |
| | |
| | | |
| | | private bool Sub_SaveBill() |
| | | { |
| | | //ç§°éè®°å½å表æ¯å¦æè®°å½å¤æ |
| | | bool b = false; |
| | | for (int i = 0; i < grdMain.RowCount; i++) |
| | | { |
| | | b = true; |
| | | break; |
| | | } |
| | | if (b == false) |
| | | { |
| | | MessageBox.Show("å½åç§°éè®°å½åè¡¨æ æ°æ®ï¼ä¸å
许æ¢ççæåæ®ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | |
| | | //夿ä¼è®¡ææ¯å¦åç |
| | | string s = ""; |
| | | int sYear = 0; |
| | |
| | | oCn.BeginTran(); |
| | | //çæåºå
¥åºåæ® |
| | | //æå
¥å表 |
| | | oCn.RunProc("EXEC h_p_Kf_ProductInBillSub_Insert_New " + HInterID.ToString() + ",'" + HBillNo + "','" + HSourceBillType + "'"); |
| | | DataSet ds = oCn.RunProcReturn("EXEC h_p_Kf_ProductInBillSub_Insert_New " + HInterID.ToString() + ",'" + HBillNo + "','" + HSourceBillType + "'", "h_p_Kf_ProductInBillSub_Insert_New"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | } |
| | | else if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0][0]) != "OK") |
| | | { |
| | | oCn.RollBack(); |
| | | MessageBox.Show("çæå
¥åºå失败ï¼å½åç§°éè®°å½åè¡¨æ æ°æ®ï¼ä¸å
许æ¢ççæåæ®ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | //æå
¥ä¸»è¡¨ |
| | | oCn.RunProc("Insert Into Kf_ICStockBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMainSourceBillType" + |
| | |
| | | + ", " + HStockOrgID.ToString() + "," + HStockOrgID.ToString() + ") "); |
| | | //æ´æ°å
³èæ°é |
| | | oCn.RunProc("exec h_p_Sc_UpDateRelation_ICMOToProductIn_Add " + HInterID.ToString()); |
| | | //åå¡«å·²çåç¶æ |
| | | oCn.RunProc("Update KF_WeighSource_Temp set HRelationInterID=1 where HInterID= " + HInterID.ToString()); |
| | | MessageBox.Show("çæç产å
¥åºåï¼" + HBillNo + " æåï¼", "æç¤º"); |
| | | oCn.Commit(); |
| | | return 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(); |
| | | } |
| | | |
| | | //æ¡ç çæå夿 |
| | | private bool Sub_AllowSave() |
| | | { |
| | | //夿å½ååæ®IDæ¯å¦å·²ä¸ä¼ çæåæ® |
| | | DataSet Ds = oCn.RunProcReturn("select top 1 1 from KF_WeighSource_Temp with(nolock) where HInterID=" + HInterID.ToString() + " and HRelationInterID=1 ", "KF_WeighSource_Temp", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("å½åæ¡ç è®°å½å·²æ¢çä¸ä¼ çæåæ®ï¼è¯·éåºåéæ°è¿å
¥è¯¥æ¨¡åè¿è¡æ¡ç çææä½ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | |
| | | if (HInterID==0 || HBillNo=="") |
| | | { |
| | | MessageBox.Show("è·åæ¡ç 对åºåæ®IDæåæ®å·å¤±è´¥ï¼è¯·éæ°å·æ°çé¢ï¼", "æç¤º"); |
| | |
| | | MessageBox.Show("请è¾å
¥æ£ç¡®ééï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | else if (DBUtility.ClsPub.isDoule(txtHQty.Text)- DBUtility.ClsPub.isDoule(txtHKDQty.Text) <= 0) |
| | | { |
| | | MessageBox.Show("è¾å
¥çæ£ç¹æ°ä¸è½å¤§äºç±³æ°ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | else if (DBUtility.ClsPub.isInt(txtHBarcodeNo.Text) == 0) |
| | | { |
| | | MessageBox.Show("请è¾å
¥å
å·ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | else if (HWhID==0) |
| | | { |
| | | MessageBox.Show("ç©ææªè®¾ç½®é»è®¤ä»åºï¼è·åä»åºä¿¡æ¯å¤±è´¥ï¼è¯·å
è®¾ç½®ç©æé»è®¤ä»åºï¼", "æç¤º"); |
| | |
| | | { |
| | | MessageBox.Show("ç©æé»è®¤ä»åºå¯ç¨äºä»ä½ï¼ä½æªè®¾ç½®ä»ä½ï¼è·åä»ä½ä¿¡æ¯å¤±è´¥ï¼è¯·å
è®¾ç½®ç©æé»è®¤ä»ä½ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | |
| | | //å®é
å
é=éé/ç±³æ°*1000ï¼å®é
å
éè¶
åºç©æç»´æ¤å
éçç¾åä¹äºåæä¸è¶³ç©æç»´æ¤å
éçç¾åä¹å
«åï¼é¢è¦æç¤º |
| | | double sQty = 0; //å®é
å
é |
| | | sQty = DBUtility.ClsPub.isDoule(txtHWeightQyt.Text) / DBUtility.ClsPub.isDoule(txtHQty.Text) * 1000; |
| | | |
| | | if (sQty > HMaterWeight * 1.2 || sQty < HMaterWeight * 0.8) |
| | | { |
| | | if (MessageBox.Show("ç©æç»´æ¤å
é为ï¼"+HMaterWeight.ToString()+ "ï¼å®é
å
é为ï¼" + sQty.ToString() + "ï¼æè¾å
¥å®é
å
éè¶
åºç©æç»´æ¤å
éçç¾åä¹äºåæä¸è¶³ç©æç»´æ¤å
éçç¾åä¹å
«åï¼è¯·æ£æ¥è¾å
¥çæ°æ®æ¯å¦æ£ç¡®ï¼", "æç¤º", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | |
| | | |
| | | string HBarCode = ""; |
| | | string HBarCodeType = ""; |
| | | double HQty = 0; //ç±³æ° |
| | | double HNowQty = 0; //ç±³æ° |
| | | double HMaterialJQty = 0; //éé |
| | | double HMaterialMQty = 0; //æ£ç¹æ° |
| | | double HQty = 0; //æ°é |
| | | Int64 HDeptID = 0; |
| | | string HRemark = ""; |
| | | string HMaterName = ""; |
| | | string HMaterModel = ""; |
| | | string ProcessExchangeBillNo = ""; |
| | | Int64 HBarcodeNo = 0; //å
æ° |
| | | Int64 HBadReasonID = 0; //ä¸è¯åå ID |
| | | string HCusMaterName = ""; //客æ·ç©æåç§° |
| | | string HCusModel = ""; //客æ·è§æ ¼åå· |
| | | |
| | | HBarCode = TM; |
| | | HBarCodeType = DBUtility.ClsPub.isStrNull(cmbHBarCodeType.Text); |
| | | HQty = DBUtility.ClsPub.isDoule(txtHQty.Text); |
| | | HNowQty = DBUtility.ClsPub.isDoule(txtHQty.Text); |
| | | HMaterialJQty = DBUtility.ClsPub.isDoule(txtHWeightQyt.Text); |
| | | HMaterialMQty = DBUtility.ClsPub.isDoule(txtHKDQty.Text); |
| | | HQty = HNowQty- HMaterialMQty; |
| | | HDeptID = DBUtility.ClsPub.isLong(txtHDeptName.Tag); |
| | | HRemark = DBUtility.ClsPub.isStrNull(txtHRemark.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); |
| | | HCusMaterName = DBUtility.ClsPub.isStrNull(txtHCusMaterName.Text); |
| | | HCusModel = DBUtility.ClsPub.isStrNull(txtHCusModel.Text); |
| | | |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | //åå
¥æ¡ç æ¡£æ¡ |
| | | //åå
¥æ¡ç æ¡£æ¡ (客æ·ç©æåç§°HCusMaterNameåå
¥HMaterialModelåæ®µï¼å®¢æ·è§æ ¼åå·HCusModelåå
¥HCusModelåæ®µï¼ä¸è¯åå IDåå
¥HCustomQty1åæ®µï¼ |
| | | oCn.RunProc("Insert into Gy_BarCodeBill " + |
| | | "(HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate,HMaterialJQty,HMaterialMQty " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate,HMaterialJQty,HMaterialMQty,HNowQty " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HGiveAwayFlag " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " + |
| | | ",HOrderInterID,HOrderEntryID,HOrderBillNo,HCustomQty1,HMaterialModel,HCusModel " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo,HLogo " + |
| | | ") Values (" |
| | | + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString() |
| | | + ",'" + HBatchNo + "',0,0,'" + HMaker + "',getdate(),0," + 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 + "'" |
| | | + ", 0,'',getdate(),'','" + sDate + "'," + HMaterialJQty.ToString() + "," + HMaterialMQty.ToString() |
| | | + ", 1," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'" |
| | | + ", 0,'',getdate(),'','" + sDate + "'," + HMaterialJQty.ToString() + "," + HMaterialMQty.ToString() + "," + HNowQty.ToString() |
| | | + ", " + HStockOrgID.ToString() + "," + HStockOrgID.ToString() + ",''," + HInterID.ToString() + ",0" |
| | | + ",'" + HMaterName + "','" + HMaterModel + "',''," + HAuxPropID.ToString() + ",'','')"); |
| | | + ", " + ProcessExchangeInterID.ToString() + ",0,'" + ProcessExchangeBillNo + "'," + HBadReasonID.ToString() + ",'" + HCusMaterName + "','" + HCusModel + "'" |
| | | + ",'" + HMaterName + "','" + HMaterModel + "',''," + HAuxPropID.ToString() + ",'','','1')"); |
| | | |
| | | //åå¡«æå¤§æµæ°´å· |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo_QTY '" + sTMNumber + "',1 "); |
| | | |
| | | //åå¡«æºå临æ¶è¡¨HInterID |
| | | oCn.RunProc("update a set a.HInterID=" + HInterID.ToString() + ",a.HBillNo='" + HBillNo +"',a.HRelationInterID= 0 from KF_WeighSource_Temp a where a.HInterID<>" + HInterID.ToString() + " and a.HMaker='" + HMaker + "' and a.HSourceBillNo='" + ProcessExchangeBillNo + "'"); |
| | | |
| | | //åå
¥æ¡ç åºå
¥åºä¸´æ¶è¡¨ |
| | | 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)"); |
| | | |
| | |
| | | txtHMaterName.Text = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("ç©æåç§°")].Value); |
| | | txtHMaterModel.Text = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("è§æ ¼åå·")].Value); |
| | | txtHBatchNo.Text = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("æ¹å·")].Value); |
| | | txtHCusMaterName.Text = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HCusMaterName")].Value); |
| | | txtHCusModel.Text = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HCusModel")].Value); |
| | | HAuxPropID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HAuxPropID")].Value); |
| | | HUnitID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HUnitID")].Value); |
| | | HWhID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HWhID")].Value); |
| | |
| | | HSourceBillNo = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("ç产订å")].Value); |
| | | HSourceBillType = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HSourceBillType")].Value); |
| | | HSourceQty = DBUtility.ClsPub.isDoule(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("æ°é")].Value); |
| | | ProcessExchangeInterID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("ProcessExchangeInterID")].Value); |
| | | HSupID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HSupID")].Value); |
| | | HMaterWeight = DBUtility.ClsPub.isDoule(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HMaterWeight")].Value); |
| | | } |
| | | |
| | | //è¿åæºååè¡¨ä¿¡æ¯ |
| | |
| | | |
| | | #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 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |