| | |
| | | public bool SaveICMOProductReportBill_ICMO_CLD_Layui(Model.ClsSc_ICMOReportBillMain oMain,string workcode,int HSourceID, string sHSourceType, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //建立一个 事务; |
| | | string aa = ""; |
| | | try |
| | | { |
| | | |
| | |
| | | oMain.HGroupID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HGroupID"]); |
| | | oMain.HDeptID = DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HDeptID"]); |
| | | oMain.HPRDORGID = DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HPRDORGID"]); |
| | | aa = "aa:" + oMain.HGroupID + "bb:" + oMain.HDeptID + "cc:" + oMain.HPRDORGID; |
| | | //插入子表 |
| | | oCn.RunProc("exec h_p_Sc_ICMOReportBillSub_Insert_WorkQty " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + sHSourceType + "'"); |
| | | //插入主表 |
| | |
| | | ", " + oMain.HYear.ToString() + "," + oMain.HPeriod.ToString() + ",'" + oMain.HRemark + "','" + oMain.HMaker + "',convert(varchar(10),getdate(),120)" + |
| | | ", " + oMain.HEmpID.ToString() + "," + oMain.HGroupID.ToString() + "," + oMain.HDeptID.ToString() + "," + oMain.HPRDORGID.ToString() + |
| | | ") "); |
| | | |
| | | //更新生产状态临时表(当日完工数量)HDateFinishQty |
| | | //string sql1 = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set |
| | | // HICMOReportInterID ='" + oMain.HInterID + "', HICMOReportBillNo='" + oMain.HBillNo + "' from Sc_ICMOBillWorkQtyStatus_Tmp a where a.HICMOBillNo='" + workcode + "' and a.HSourceID='" + HSourceID + "' and HICMOInterID='" + oMain.HMainSourceInterID + "' and a.HICMOEntryID='" + oMain.HMainSourceEntryID + "' and a.HMaker='" + oMain.HMaker + "' and HRelationInterID='0'"); |
| | | //oCn.RunProc(sql1); |
| | | |
| | | //更新关联数量 |
| | | oCn.RunProc("exec h_p_Sc_UpDateRelation_ICMOToICMOReport_Add " + oMain.HInterID.ToString()); |
| | | |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sErrMsg = "生成生产汇报单失败!" + e.Message+ aa; |
| | | sErrMsg = "生成生产汇报单失败!" + e.Message; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |