| | |
| | | |
| | | public ClsGy_QCVerificationBillMain() |
| | | { |
| | | base.MvarItemKeySub = "Gy_QCVerificationBillMain"; |
| | | base.MvarItemKeySub = "Gy_QCVerificationBillSub"; |
| | | base.MvarItemKeySub2 = ""; |
| | | base.MvarItemKeySub3 = ""; |
| | | base.MvarItemKeySub4 = ""; |
| | |
| | | { |
| | | // |
| | | oCn.BeginTran(); |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2 ", "h_p_Gy_QCVerificationBill_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return false; |
| | | } |
| | | //========================================================= |
| | | |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc("UpDate Gy_QCVerificationBillMain set " + |
| | | " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== |
| | |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | "," + oSub.HInspectInstruMentID.ToString() + ",'" + oSub.HBeginDate + "','" + oSub.HEndDate.ToString() + "','" + oSub.HHCalibrationStatus.ToString() + "'" + |
| | | ") "); |
| | | oCn.RunProc("update UPDATE from Gy_InspectInstruMent set HValidDate='" + oSub.HBeginDate + "',HExpiryDay='" + oSub.HEndDate + "'where HItemID=" + omodel.HInterID); |
| | | ") "); |
| | | } |
| | | |
| | | //=========================ä¿ååæ§å¶ |
| | | DataSet ds2 = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_Gy_QCVerificationBill_AfterSaveCtrl"); |
| | | |
| | | |
| | | if (ds2 == null) |
| | | { |
| | | sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================ |
| | | |
| | | sReturn = "ä¿®æ¹åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | |
| | | //ä¿ååæ§å¶========================================= |
| | | string HBillNote = ""; |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MouldRepairWorkBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1,1 ", "h_p_Sc_MouldRepairWorkBill_BeforeSaveCtrl"); |
| | | DataSet ds = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_QCVerificationBill_BeforeSaveCtrl"); |
| | | if (ds == null) |
| | | { |
| | | sReturn = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | |
| | | } |
| | | //========================================================= |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | |
| | | oCn.BeginTran(); |
| | | oCn.RunProc("Insert Into Gy_QCVerificationBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + |
| | | ",HYear,HPeriod,HRemark,HMaker,HMakeDate," + |
| | | "HMainSourceBillType,HMainSourceBillNo,HMainSourceInterID,HMainSourceEntryID," + |
| | | "HCheckEmp,HDeptID) " + |
| | | "values('" + (this.BillType ?? "") + "','" + (this.HBillSubType ?? "") + "'," + |
| | | (omodel.HInterID.ToString() ?? "0") + ",'" + (omodel.HBillNo ?? "") + "','" + (omodel.HDate) + "'" + |
| | | "," + (omodel.HYear.ToString() ?? "0") + "," + (omodel.HPeriod.ToString() ?? "0") + |
| | | ",'" + (omodel.HRemark ?? "") + "','" + (omodel.HMaker ?? "") + "',getdate(),'" + |
| | | (omodel.HMainSourceBillType ?? "") + "','" + (omodel.HMainSourceBillNo ?? "") + "'," + |
| | | (omodel.HMainSourceInterID.ToString() ?? "0") + "," + (omodel.HMainSourceEntryID.ToString() ?? "0") + |
| | | "," + (omodel.HCheckEmp.ToString() ?? "0") + "," + (omodel.HDeptID.ToString() ?? "0") + ")"); |
| | | //主表 |
| | | //oCn.RunProc("Insert Into Gy_QCVerificationBillMain " + |
| | | //"(HBillType,HBillSubType,HInterID,HBillNo,HDate" + |
| | | //",HYear,HPeriod,HRemark,HMaker,HMakeDate," + |
| | | //"HMainSourceBillType,HMainSourceBillNo,HMainSourceInterID,HMainSourceEntryID," |
| | | //+ "HCheckEmp,HDeptID" + |
| | | //") " + |
| | | //" values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + |
| | | //"," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + ",'" + omodel.HMainSourceBillType + "','" + omodel.HMainSourceBillNo + "'," + omodel.HMainSourceInterID.ToString() + "," + omodel.HMainSourceEntryID.ToString() + "," + omodel.HCheckEmp.ToString() + "," + omodel.HDeptID.ToString() + "') "); |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + |
| | | ",HYear,HPeriod,HRemark,HMaker,HMakeDate," + |
| | | "HMainSourceBillType,HMainSourceBillNo,HMainSourceInterID,HMainSourceEntryID," + |
| | | "HCheckEmp,HDeptID,HOrgID) " + |
| | | "values('" + (this.BillType ?? "") + "','" + (this.HBillSubType ?? "") + "'," + |
| | | (omodel.HInterID.ToString() ?? "0") + ",'" + (omodel.HBillNo ?? "") + "','" + (omodel.HDate) + "'" + |
| | | "," + (omodel.HYear.ToString() ?? "0") + "," + (omodel.HPeriod.ToString() ?? "0") + |
| | | ",'" + (omodel.HRemark ?? "") + "','" + (omodel.HMaker ?? "") + "',getdate(),'" + |
| | | (omodel.HMainSourceBillType ?? "") + "','" + (omodel.HMainSourceBillNo ?? "") + "'," + |
| | | (omodel.HMainSourceInterID.ToString() ?? "0") + "," + (omodel.HMainSourceEntryID.ToString() ?? "0") + |
| | | "," + (omodel.HCheckEmp.ToString() ?? "0") + "," + (omodel.HDeptID.ToString() ?? "0") + "," + (omodel.HOrgID.ToString() ?? "0") + ")"); |
| | | //主表 |
| | | //æå
¥å表 |
| | | |
| | | foreach (Model.ClsGy_QCVerificationBillSub oSub in DetailColl) |
| | | { |
| | | if (oSub.HBeginDate.Trim()==""|| oSub.HBeginDate.Trim() == null) |
| | | { |
| | | oSub.HBeginDate = DateTime.Now.ToString(); |
| | | oSub.HEndDate = DateTime.Now.AddYears(10).ToString(); |
| | | |
| | | } |
| | | if(oSub.HHCalibrationStatus==""|| oSub.HHCalibrationStatus==null) |
| | | { |
| | | oSub.HHCalibrationStatus = "åæ ¼"; |
| | | } |
| | | oCn.RunProc("Insert into Gy_QCVerificationBillSub " + |
| | | oCn.RunProc("Insert into Gy_QCVerificationBillSub " + |
| | | " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HInspectInstruMentID,HBeginDate,HEndDate,HHCalibrationStatus" + |
| | |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | "," + oSub.HInspectInstruMentID.ToString() + ",'" + oSub.HBeginDate + "','" + oSub.HEndDate.ToString() + "','" + oSub.HHCalibrationStatus.ToString() +"'"+ |
| | | ") "); |
| | | oCn.RunProc("update UPDATE from Gy_InspectInstruMent set HValidDate='" + oSub.HBeginDate + "',HExpiryDay='" + oSub.HEndDate + "'where HItemID="+ omodel.HInterID ); |
| | | ") "); |
| | | } |
| | | |
| | | //=========================ä¿ååæ§å¶ |
| | | //DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldRepairWorkBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1,1 ", "h_p_Sc_MouldRepairWorkBill_AfterSaveCtrl"); |
| | | |
| | | DataSet ds2 = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1", "h_p_Gy_QCVerificationBill_AfterSaveCtrl"); |
| | | |
| | | //if (ds2 == null) |
| | | //{ |
| | | // sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | // oCn.RollBack(); |
| | | // return false; |
| | | //} |
| | | //if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | //{ |
| | | // sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | // oCn.RollBack(); |
| | | // return false; |
| | | //} |
| | | if (ds2 == null) |
| | | { |
| | | sReturn = "ä¿ååæ§å¶å¤æå¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") |
| | | { |
| | | sReturn = "ä¿å失败2ï¼" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================ |
| | | |
| | | sReturn = "æ°å¢åæ®æåï¼"; |