| | |
| | | public List<Model.ClsGy_BarCodeEdit_Model> DetailColl_Pay = new List<Model.ClsGy_BarCodeEdit_Model>(); |
| | | |
| | | |
| | | public bool AddBill(ref string sReturn) |
| | | public bool AddBill(ref string sReturn,string HBillNo) |
| | | { |
| | | try |
| | | { |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCn.BeginTran(); |
| | | string sql = "delete Gy_BarCodeBill where HBarCode='" + omodel.HBarCode + "'"; |
| | | string sql = "delete Gy_BarCodeBill where HBarCode='" + HBillNo + "'"; |
| | | oCn.RunProc(sql); |
| | | ////æå
¥å表 |
| | | foreach (Model.ClsGy_BarCodeEdit_Model oSub in DetailColl_Mater) |
| | |
| | | ",HSendGoodsBillNo,HServerItemID,HBadReasonList,HProdLev,HInnerBillNo,HCusBarCode,HStatus,HInitSourceEntryID" + |
| | | ",HOldSourceBillType,HMZ,HGiveAwayFlag" + |
| | | ") " + |
| | | " values("+ oSub.HInterID + ",1,'3710',0," + oSub.HBarCode + ",'" + oSub.HBarCodeType + "','" + oSub.HItemSubID+ |
| | | "'," + oSub.HMaterID + ","+ oSub.HUnitID + ",0,"+ oSub.HQty + ","+ oSub.HBatchNo + ","+ oSub.HSupID + "," + oSub.HGroupID + "," + oSub.HDeptID + "," + oSub.HEmpID + |
| | | "," + oSub.HMaker + ",'" + oSub.HMakeDate + "',0," + oSub.HSourceInterID + ","+ oSub.HSourceEntryID + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + |
| | | "'','" + oSub.HUseFlag + "','',''," + oSub.HStopflag + ",'',0,"+ oSub.HInitQty+",0"+ |
| | | " values("+ oSub.HInterID + ",1,'3710',0,'" + oSub.HBarCode + "','" + oSub.HBarCodeType + "','" + oSub.HItemSubID+ |
| | | "'," + oSub.HMaterID + ","+ oSub.HUnitID + ",0,"+ oSub.HQty + ",'"+oSub.HBatchNo + "',"+ oSub.HSupID + "," + oSub.HGroupID + "," + oSub.HDeptID + "," + oSub.HEmpID + |
| | | ",'" + oSub.HMaker + "','" + oSub.HMakeDate + "',0," + oSub.HSourceInterID + ","+ oSub.HSourceEntryID + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + |
| | | "'','" + oSub.HUseFlag + "','','',0,'',0,"+ oSub.HInitQty+",0"+ |
| | | ",'',0,'',"+ oSub.HSourceID+",'','',"+ oSub.HCusID+","+ oSub.HSTOCKORGID+","+ oSub.HOWNERID + |
| | | ",'','','','','','','',0,"+ |
| | | "0,'','"+oSub.HBarCodeDate+"','',0,0"+ |
| | |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | return true; |
| | | } |
| | | } |
| | | return true; |
| | |
| | | //夿ä¼è®¡ææ¯å¦åç |
| | | string HBillNo = txtHBillNo.Text; |
| | | DataSet Ds; |
| | | double sum = 0; |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | Ds = oCn.RunProcReturn("select top 1* from h_v_Gy_BarCodeBill_ChaiMa where æ¡ç ç¼å·='" + HBillNo + "'", "h_v_Gy_BarCodeBill_ChaiMa"); |
| | | Ds = oCn.RunProcReturn("select top 1* from Gy_BarCodeBill where HBarCode='" + HBillNo + "'", "h_v_Gy_BarCodeBill_ChaiMa"); |
| | | for (i = 0; i <= grdMain_Pay.RowCount - 1; i++) |
| | | { |
| | | if (ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HSnoCol2].Value) != 0) |
| | | { |
| | | |
| | | Model.ClsGy_BarCodeEdit_Model model = new Model.ClsGy_BarCodeEdit_Model(); |
| | | //åºå®èµå¼======================================== |
| | | model.HEntryID = i + 1; |
| | |
| | | model.HSourceBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillNo"].ToString()); |
| | | model.HSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillType"].ToString()); |
| | | model.HUseFlag = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUseFlag"].ToString()); |
| | | model.HStopflag = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HStopflag"].ToString()); |
| | | model.HInitQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HInitQty"].ToString()); |
| | | model.HSourceID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInitQty"].ToString()); |
| | | model.HCusID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCusID"].ToString()); |
| | |
| | | model.HMakeDate = DateTime.Now; |
| | | model.HMaker = ClsPub.CurUserName; |
| | | |
| | | if (model.HPieceQty <= 0 || model.HPieceQty.ToString() == "") |
| | | if (model.HQty <= 0 || model.HQty.ToString() == "") |
| | | { |
| | | MessageBox.Show("第" + ClsPub.isStrNull(i + 1) + "è¡ï¼æåæ°éå¿
须大äº0ï¼"); |
| | | MessageBox.Show("页2第" + ClsPub.isStrNull(i + 1) + "è¡ï¼æåæ°éå¿
须大äº0ï¼"); |
| | | return false; |
| | | } |
| | | sum += model.HQty; |
| | | BillNew.DetailColl_Mater.Add(model); |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | //ä¿å |
| | | bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo); |
| | | //æç¤º |
| | | if (bResult == true) |
| | | if (sum > DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells[HQty].Value)) |
| | | { |
| | | MessageBox.Show("åæ®åç宿¯!åæ®å·:" + this.txtHBillNo.Text.Trim(), "æç¤º"); |
| | | return true; |
| | | MessageBox.Show("页2æåæ°éä¹åå¿
é¡»å°äºæ¡ç æ°éï¼"); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("ä¿å失败!åå :" + ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return false; |
| | | //ä¿å |
| | | bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo, HBillNo); |
| | | //æç¤º |
| | | if (bResult == true) |
| | | { |
| | | MessageBox.Show("åæ®åç宿¯!åæ®å·:" + this.txtHBillNo.Text.Trim(), "æç¤º"); |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("ä¿å失败!åå :" + ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return false; |
| | | } |
| | | } |
| | | //} |
| | | //else |
| | | //{ |
| | | // return false; |
| | | //} |
| | | } |
| | | //ç¡®å®æé® |
| | | private void button1_Click(object sender, EventArgs e) |