| | |
| | | ",HProcExchEntryID=" + omodel.HProcExchEntryID.ToString() + |
| | | ",HProcExchBillNo='" + omodel.HProcExchBillNo + "'" + |
| | | ",HICMOInterID=" + omodel.HICMOInterID.ToString() + |
| | | ",HICMOEntryID=" + omodel.HICMOEntryID.ToString() + |
| | | ",HICMOBillNo='" + omodel.HICMOBillNo + "'" + |
| | | ",HMainSourceBillType=" + omodel.HMainSourceBillType.ToString() + |
| | | ",HMainSourceInterID=" + omodel.HMainSourceInterID.ToString() + |
| | | ",HMainSourceEntryID=" + omodel.HMainSourceEntryID.ToString() + |
| | | ",HMainSourceBillNo=" + omodel.HMainSourceBillNo.ToString() + |
| | | ",HSourceID=" + omodel.HSourceID.ToString() + |
| | | ",HProcID=" + omodel.HProcID.ToString() + |
| | | ",HMaterID=" + omodel.HMaterID.ToString() + |
| | |
| | | oCn.RunProc("Insert Into Sc_MaterToSourceBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + |
| | | ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + |
| | | ",HProcExchInterID,HProcExchEntryID,HProcExchBillNo,HICMOInterID,HICMOBillNo" + |
| | | ",HProcExchInterID,HProcExchEntryID,HProcExchBillNo,HICMOInterID,HICMOEntryID,HICMOBillNo" + |
| | | ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" + |
| | | ",HSourceID,HProcID,HMaterID,HSourceBarCode,HEquipID,HWorkerID,HWorkerBarCode" + |
| | | ",HGroupID" + |
| | | ") " + |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + |
| | | ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + |
| | | "," + omodel.HProcExchInterID.ToString() + "," + omodel.HProcExchEntryID.ToString() + ",'" + omodel.HProcExchBillNo + "'," + omodel.HICMOInterID.ToString() + ",'" + omodel.HICMOBillNo + "'" + |
| | | "," + omodel.HProcExchInterID.ToString() + "," + omodel.HProcExchEntryID.ToString() + ",'" + omodel.HProcExchBillNo + "'," + omodel.HICMOInterID.ToString() + ","+ omodel.HICMOEntryID.ToString() + ",'" + omodel.HICMOBillNo + "'" + |
| | | "," + omodel.HMainSourceBillType.ToString() + "," + omodel.HMainSourceInterID.ToString() + "," + omodel.HMainSourceEntryID.ToString() + ",'" + omodel.HMainSourceBillNo + "'" + |
| | | "," + omodel.HSourceID.ToString() + "," + omodel.HProcID.ToString() + "," + omodel.HMaterID.ToString() + ",'" + omodel.HSourceBarCode + "'," + omodel.HEquipID.ToString() + "," + omodel.HWorkerID.ToString() + ",'" + omodel.HWorkerBarCode + "'" + |
| | | "," + omodel.HGroupID.ToString() + |
| | | ") "); |
| | |
| | | { |
| | | string HChecker = DBUtility.ClsPub.CurUserName; |
| | | string HCheckDate = DBUtility.ClsPub.GetServerDate(-1); |
| | | oCn.RunProc(" Update " + MvarItemKey + " set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString()); |
| | | oCn.BeginTran(); |
| | | oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='2', HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString()); |
| | | //生成调拨单 |
| | | //得到调拨单 mainid 单据号 |
| | | //long NewInterID = DBUtility.ClsPub.CreateBillID("1207", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //string NewBillNo = DBUtility.ClsPub.CreateBillCode("1207", ref DBUtility.ClsPub.sExeReturnInfo, true);//得到新单号 |
| | | //oCn.RunProc("exec h_p_Kf_MoveStockBill_Add " + lngBillKey.ToString() + "," + NewInterID.ToString() + ",'" + NewBillNo + "','" + HChecker + "'"); |
| | | // |
| | | //再次验证 保存是否 合理 |
| | | DataSet ds = oCn.RunProcReturn("exec h_p_Sc_MaterToSourceBill_AddRelation @HInterId=" + omodel.HInterID + "", "h_p_Sc_MaterToSourceBill_AddRelation"); |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | sReturn = "无验证数据!"; |
| | | oCn.RollBack(); |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2") |
| | | { |
| | | sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | } |
| | | |
| | | oCn.Commit(); |
| | | sReturn = ""; |
| | | return true; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | //反审核 |
| | | public bool AbandonCheck(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | | |
| | | try |
| | | { |
| | | string HChecker = DBUtility.ClsPub.CurUserName; |
| | | string HCheckDate = DBUtility.ClsPub.GetServerDate(-1); |
| | | oCn.BeginTran(); |
| | | oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='1', HChecker='',HCheckDate=null Where HInterID=" + lngBillKey.ToString()); |
| | | //生成调拨单 |
| | | //得到调拨单 mainid 单据号 |
| | | //long NewInterID = DBUtility.ClsPub.CreateBillID("1207", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //string NewBillNo = DBUtility.ClsPub.CreateBillCode("1207", ref DBUtility.ClsPub.sExeReturnInfo, true);//得到新单号 |
| | | //oCn.RunProc("exec h_p_Kf_MoveStockBill_Add " + lngBillKey.ToString() + "," + NewInterID.ToString() + ",'" + NewBillNo + "','" + HChecker + "'"); |
| | | // |
| | | //再次验证 保存是否 合理 |
| | | DataSet ds = oCn.RunProcReturn("exec h_p_Sc_MaterToSourceBill_DelRelation @HInterId=" + omodel.HInterID + "", "h_p_Sc_MaterToSourceBill_DelRelation"); |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | sReturn = "无验证数据!"; |
| | | oCn.RollBack(); |
| | | |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2") |
| | | { |
| | | sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | |
| | | |
| | | } |
| | | |
| | | oCn.Commit(); |
| | | sReturn = ""; |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | throw (e); |
| | | } |
| | | } |
| | | } |
| | | } |