| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsSb_EquipWorkBeforeCheckBill : DBUtility.ClsXt_BaseBill |
| | | public class ClsSb_EquipWorkBeforeCheckBill : DBUtility.ClsXt_BaseBill |
| | | { |
| | | public Model.ClsSb_EquipWorkBeforeCheckBillMain omodel = new Model.ClsSb_EquipWorkBeforeCheckBillMain(); |
| | | public List<Model.ClsSb_EquipWorkBeforeCheckBillSub> DetailColl = new List<Model.ClsSb_EquipWorkBeforeCheckBillSub>(); |
| | |
| | | base.MvarItemKeySub2 = ""; |
| | | base.MvarItemKeySub3 = ""; |
| | | base.MvarItemKeySub4 = ""; |
| | | base.MvarItemKey = "Sb_EquipWorkBeforeCheckBillMain"; |
| | | base.MvarReportTitle = "è®¾å¤æäº§æ£éªéªæ¶å"; |
| | | base.MvarItemKey= "Sb_EquipWorkBeforeCheckBillMain"; |
| | | base.MvarReportTitle= "è®¾å¤æäº§æ£éªéªæ¶å"; |
| | | base.BillType = "3915"; |
| | | base.HBillSubType = "3915"; |
| | | |
| | | } |
| | | |
| | | #region åºå®ä»£ç |
| | | |
| | | ~ClsSb_EquipWorkBeforeCheckBill() |
| | | { |
| | | DetailColl = null; |
| | | } |
| | | |
| | | #endregion èªå®ä¹æ¹æ³ |
| | | //ä¿®æ¹åæ® |
| | | public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc("UpDate Sb_EquipWorkBeforeCheckBillMain set " + |
| | | " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== |
| | | ",HDate='" + omodel.HDate + "'" + |
| | | //",HDate='" + omodel.HDate + "'" + |
| | | ",HYear='" + omodel.HYear.ToString() + "'" + |
| | | ",HPeriod='" + omodel.HPeriod.ToString() + "'" + |
| | | ",HBillStatus=" + omodel.HBillStatus.ToString() + |
| | | ",HRemark='" + omodel.HRemark + "'" + |
| | | ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" + |
| | | ",HCheckerResult='" + omodel.HCheckerResult + "'" + |
| | | ",HUpDater='" + omodel.HMaker + "'" + |
| | | ",HUpDateDate=getdate()" + |
| | | //======================================== |
| | | ",HSupID=" + omodel.HSupID.ToString() + |
| | | ",HEquipID=" + omodel.HEquipID.ToString() + |
| | | ",HSupID=" + omodel.HSupID.ToString() + |
| | | ",HFirstCheckEmp=" + omodel.HFirstCheckEmp.ToString() + |
| | | ",HCheckerResult ='" + omodel.HCheckerResult.ToString() + "'" + |
| | | " where HInterID=" + lngBillKey.ToString()); |
| | | //å é¤å
³è |
| | | DeleteRelation(ref sReturn, lngBillKey); |
| | |
| | | foreach (Model.ClsSb_EquipWorkBeforeCheckBillSub oSub in DetailColl) |
| | | { |
| | | oCn.RunProc("Insert into Sb_EquipWorkBeforeCheckBillSub " + |
| | | " (HInterID,HEntryID,HCloseMan,HCloseType,HRemark,HBillNo_bak" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HItemSubID,HQCCheckClassID,HQCCheckItemID,HQCStd,HQCRelValue,HResult,HProcCheckEmp,HProcCheckTime" + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "','" + omodel.HBillNo + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | "," + 0 + "," + oSub.HQCCheckClassID + "," + oSub.HQCCheckItemID + ",'" + oSub.HQCStd + "','" + oSub.HQCRelValue + "','" + oSub.HResult + "'," + oSub.HProcCheckEmp + |
| | | ",'" + oSub.HProcCheckTime + "'" + ") "); |
| | | " (HInterID,HEntryID,HCloseMan, HEntryCloseDate, HCloseType" + |
| | | ", HRemark, HSourceInterID, HSourceEntryID, HSourceBillNo, HSourceBillType" + |
| | | ", HRelationQty, HRelationMoney,HQCCheckClassID, HQCCheckItemID, HQCStd" + |
| | | ", HQCRelValue, HResult, HProcCheckEmp, HProcCheckTime, HBillNo_bak) values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + 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.HQCCheckClassID + "','" + oSub.HQCCheckItemID + "','" + oSub.HQCStd + |
| | | "','" + oSub.HQCRelValue + "','" + oSub.HResult.ToString() + "','" + oSub.HProcCheckEmp + "','" + oSub.HProcCheckTime + "','') "); |
| | | } |
| | | |
| | | sReturn = "ä¿®æ¹åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //æ°å¢åæ® |
| | | public override bool AddBill(ref string sReturn) |
| | | { |
| | |
| | | { |
| | | //å¾å°mainid |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | if (IsExistBillNo(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HBillNo, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew, omodel.HInterID)) |
| | | { |
| | | omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | } |
| | | if (IsExistMainID(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HInterID, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew)) |
| | | { |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | // |
| | | oCn.BeginTran(); |
| | | //HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | // ,HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID |
| | | // ,HMainSourceEntryID,HMainSourceBillNo,HPrintQty,HSupID,HEquipID,HFirstCheckEmp,HCheckerResult |
| | | //主表 |
| | | oCn.RunProc("Insert Into Sb_EquipWorkBeforeCheckBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + |
| | | ",HYear,HPeriod,HRemark,HMaker,HMakeDate,HSupID,HFirstCheckEmp" + |
| | | ",HBillStatus,HBackRemark,HMaker,HMakeDate,HMainSourceBillType" + |
| | | ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HPrintQty" + |
| | | ",HCheckItemNowID,HCheckItemNextID,HCheckFlowID,HBacker,HChecker,HUpDater,HCloseMan,HCloseType,HDeleteMan,HEquipID,HCheckerResult" + |
| | | ") " + |
| | | " 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.HSupID.ToString() + "," + omodel.HFirstCheckEmp.ToString() + "," + 1 + ",'" + omodel.HBackRemark + |
| | | "','" + omodel.HMaker + "','" + omodel.HMakeDate + "','" + omodel.HMainSourceBillType + "'," + omodel.HMainSourceInterID + |
| | | "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "'," + omodel.HPrintQty + ",0,0,0" + ",'" + omodel.HBacker + |
| | | "','" + omodel.HChecker + "','" + omodel.HUpDater + "','" + omodel.HCloseMan + "'," + 0 + ",'" + omodel.HDeleteMan + |
| | | "'," + omodel.HEquipID + ",'" + omodel.HCheckerResult + "'" + ") "); |
| | | "(HBillType,HBillSubType,HInterID,HBillNo , HDate, HMaker, HMakeDate" + |
| | | ", HYear, HPeriod , HRemark, HEquipID, HSupID, HFirstCheckEmp, HCheckerResult" + |
| | | ", HBackRemark, HMainSourceBillType, HMainSourceInterID, HMainSourceEntryID, HMainSourceBillNo) " + |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" + |
| | | "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEquipID.ToString() + |
| | | ",'" + omodel.HSupID + "','" + omodel.HFirstCheckEmp + "','" + omodel.HCheckerResult + "'" + |
| | | ",'','',0,0,'') "); |
| | | //æå
¥å表 |
| | | foreach (Model.ClsSb_EquipWorkBeforeCheckBillSub oSub in DetailColl) |
| | | { |
| | | oCn.RunProc("Insert into Sb_EquipWorkBeforeCheckBillSub " + |
| | | " (HInterID,HEntryID,HCloseMan,HCloseType,HRemark,HBillNo_bak" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HItemSubID,HQCCheckClassID,HQCCheckItemID,HQCStd,HQCRelValue,HResult,HProcCheckEmp,HProcCheckTime" + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "','" + omodel.HBillNo + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | "," + 0 + "," + oSub.HQCCheckClassID + "," + oSub.HQCCheckItemID + ",'" + oSub.HQCStd + "','" + oSub.HQCRelValue + "','" + oSub.HResult + "'," + oSub.HProcCheckEmp + |
| | | ",'" + oSub.HProcCheckTime + "'" + ") "); |
| | | " (HInterID,HEntryID,HCloseMan, HEntryCloseDate, HCloseType" + |
| | | ", HRemark, HSourceInterID, HSourceEntryID, HSourceBillNo, HSourceBillType" + |
| | | ", HRelationQty, HRelationMoney,HQCCheckClassID, HQCCheckItemID, HQCStd" + |
| | | ", HQCRelValue, HResult, HProcCheckEmp, HProcCheckTime, HBillNo_bak) values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + 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.HQCCheckClassID + "','" + oSub.HQCCheckItemID + "','" + oSub.HQCStd + |
| | | "','" + oSub.HQCRelValue + "','" + oSub.HResult.ToString() + "','" + oSub.HProcCheckEmp + "','" + oSub.HProcCheckTime + "','') "); |
| | | } |
| | | |
| | | sReturn = "æ°å¢åæ®æåï¼"; |
| | | oCn.Commit(); |
| | | return true; |
| | |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //æ¾ç¤ºåæ® |
| | | public override bool ShowBill(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | //æ¥è¯¢ä¸»è¡¨ |
| | | DataSet Ds; |
| | | Ds = oCn.RunProcReturn("Select * from Sb_EquipWorkBeforeCheckBillMain Where HInterID=" + lngBillKey.ToString(), "Sb_EquipWorkBeforeCheckBillMain"); |
| | | if (Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sReturn = "åæ®æªæ¾å°ï¼"; |
| | | return false; |
| | | } |
| | | //åºå®èµå¼=========================================== |
| | | omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); |
| | | omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); |
| | | omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); |
| | | omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); |
| | | omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); |
| | | omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); |
| | | omodel.HBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillNo"]); |
| | | omodel.HBillStatus = 1; |
| | | omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); |
| | | omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); |
| | | omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]); |
| | | omodel.HRemark = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | omodel.HBackDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBackDate"]); |
| | | omodel.HBacker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBacker"]); |
| | | omodel.HCheckDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCheckDate"]); |
| | | omodel.HChecker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HChecker"]); |
| | | omodel.HMaker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaker"]); |
| | | omodel.HMakeDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMakeDate"]); |
| | | omodel.HUpDateDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUpDateDate"]); |
| | | omodel.HUpDater = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUpDater"]); |
| | | omodel.HCloseDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCloseDate"]); |
| | | omodel.HCloseMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCloseMan"]); |
| | | omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); |
| | | omodel.HDeleteDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeleteDate"]); |
| | | omodel.HDeleteMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeleteMan"]); |
| | | omodel.HMainSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMainSourceBillType"]); |
| | | omodel.HMainSourceInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMainSourceInterID"]); |
| | | omodel.HMainSourceEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMainSourceEntryID"]); |
| | | omodel.HMainSourceBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMainSourceBillNo"]); |
| | | omodel.HPrintQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPrintQty"]); |
| | | //======================================================== |
| | | omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]); |
| | | omodel.HFirstCheckEmp = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HFirstCheckEmp"]); |
| | | omodel.HEquipID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEquipID"]); |
| | | omodel.HCheckerResult = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCheckerResult"]); |
| | | |
| | | //å¾ªç¯ |
| | | DataSet DsSub; |
| | | DsSub = oCn.RunProcReturn("Select * from Sb_EquipWorkBeforeCheckBillSub Where HInterID=" + lngBillKey.ToString(), "Sb_EquipWorkBeforeCheckBillSub"); |
| | | DetailColl.Clear();//æ¸
空 |
| | | for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) |
| | | { |
| | | Model.ClsSb_EquipWorkBeforeCheckBillSub oSub = new Model.ClsSb_EquipWorkBeforeCheckBillSub(); |
| | | // åºå®èµå¼=============================================== |
| | | oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); |
| | | oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); |
| | | oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); |
| | | oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); |
| | | oSub.HSourceBillType = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSourceBillType"]); |
| | | oSub.HSourceBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSourceBillNo"]); |
| | | oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); |
| | | oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); |
| | | oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); |
| | | oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); |
| | | oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]); |
| | | oSub.HRemark = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HRemark"]); |
| | | oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBillNo_bak"]); |
| | | //=================================================== |
| | | oSub.HQCCheckClassID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQCCheckClassID"]); |
| | | oSub.HQCCheckItemID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQCCheckItemID"]); |
| | | oSub.HQCStd = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCStd"]); |
| | | oSub.HQCRelValue = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCRelValue"]); |
| | | oSub.HResult = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HResult"]); |
| | | oSub.HProcCheckEmp = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcCheckEmp"]); |
| | | oSub.HProcCheckTime = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HProcCheckTime"]); |
| | | |
| | | DetailColl.Add(oSub); |
| | | } |
| | | sReturn = "æ¾ç¤ºåæ®æåï¼"; |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |