| using System; | 
| using System.Collections.Generic; | 
| using System.Text; | 
| using System.Data; | 
|   | 
| namespace DAL | 
| { | 
|     public class ClsSc_ICMOReportBillSub_WMS : DBUtility.ClsXt_BaseBill  | 
|     { | 
|         //Éú²ú»ã±¨µ¥Ã÷ϸ±í | 
|   | 
|          | 
|         public Model.ClsSc_ICMOReportBillSub_WMS omodel = new Model.ClsSc_ICMOReportBillSub_WMS();  | 
|   | 
|         public ClsSc_ICMOReportBillSub_WMS() | 
|         { | 
|             base.MvarItemKeySub = ""; | 
|             base.MvarItemKeySub2 = ""; | 
|             base.MvarItemKeySub3 = ""; | 
|             base.MvarItemKeySub4 = ""; | 
|             base.MvarItemKey="Sc_ICMOReportBillSub_WMS"; | 
|             base.MvarReportTitle="Éú²ú»ã±¨µ¥Ã÷ϸ±í"; | 
|             base.BillType = "3728";  | 
|         } | 
|   | 
|         #region ¹Ì¶¨´úÂë | 
|   | 
|         ~ClsSc_ICMOReportBillSub_WMS() | 
|         {  | 
|         } | 
|         | 
|         #endregion   ×Ô¶¨Òå·½·¨ | 
|         //Ð޸ĵ¥¾Ý | 
|         public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) | 
|         { | 
|             try | 
|             { | 
|                 // | 
|                 oCn.BeginTran(); | 
|                 //¸üÐÂÖ÷±í | 
|                 oCn.RunProc("UpDate Sc_ICMOReportBillSub_WMS set  " + | 
|                 "HReportEntryID=" + omodel.HReportEntryID.ToString() + | 
|                 ",HReportType=" + omodel.HReportType.ToString() + | 
|                 ",HPieceQty=" + omodel.HPieceQty.ToString() + | 
|                 ",HQty=" + omodel.HQty.ToString() + | 
|                 ",HBarCode='" + omodel.HBarCode + "'" + | 
|                 ",HAddr='" + omodel.HAddr + "'" + | 
|                 ",HSourceInterID=" + omodel.HSourceInterID.ToString() + | 
|                 ",HSourceEntryID=" + omodel.HSourceEntryID.ToString() + | 
|                 ",HSourceBillNo='" + omodel.HSourceBillNo + "'" + | 
|                 ",HSourceBillType='" + omodel.HSourceBillType + "'" + | 
|                 ",HRelationInterID=" + omodel.HRelationInterID.ToString() + | 
|                 ",HRelationEntryID=" + omodel.HRelationEntryID.ToString() + | 
|                 ",HRelationBillNo='" + omodel.HRelationBillNo + "'" + | 
|                 " where HInterID=" + lngBillKey.ToString()); | 
|                 //ɾ³ý¹ØÁª | 
|                 DeleteRelation(ref sReturn, lngBillKey); | 
|                  | 
|                 sReturn = "Ð޸ĵ¥¾Ý³É¹¦£¡"; | 
|                 oCn.Commit(); | 
|                 return true; | 
|             } | 
|             catch (Exception e) | 
|             { | 
|                 sReturn = e.Message; | 
|                 oCn.RollBack(); | 
|                 throw (e); | 
|             } | 
|         } | 
|         //ÐÂÔöµ¥¾Ý | 
|         public override bool AddBill(ref string sReturn) | 
|         { | 
|             try | 
|             { | 
|                 //µÃµ½mainid | 
|                 omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); | 
|                 //ÈôMAINDIÖØ¸´ÔòÖØÐ»ñÈ¡ | 
|                 oCn.BeginTran(); | 
|                 //Ö÷±í | 
|                 oCn.RunProc("Insert Into Sc_ICMOReportBillSub_WMS   " + | 
|                 "(HInterID,HReportEntryID,HBillType,HReportType,HPieceQty" + | 
|                 ",HQty,HBarCode,HAddr,HMaker,HMakeDate" + | 
|                 ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + | 
|                 ",HRelationInterID,HRelationEntryID,HRelationBillNo" + | 
|                 ") " + | 
|                 " values(" + omodel.HInterID.ToString() + "," + omodel.HReportEntryID.ToString() + ",'" + BillType + "'," + omodel.HReportType.ToString() + "," + omodel.HPieceQty.ToString() + | 
|                 "," + omodel.HQty.ToString() + ",'" + omodel.HBarCode + "','" + omodel.HAddr + "','" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.GetServerDate(-1) + "'" + | 
|                 "," + omodel.HSourceInterID.ToString() + "," + omodel.HSourceEntryID.ToString() + ",'" + omodel.HSourceBillNo + "','"  + omodel.HSourceBillType + "'" + | 
|                 "," + omodel.HRelationInterID.ToString() + "," + omodel.HRelationEntryID.ToString() + ",'" + omodel.HRelationBillNo + "'" +  | 
|                 ") "); | 
|                   | 
|                 sReturn = "ÐÂÔöµ¥¾Ý³É¹¦£¡"; | 
|                 oCn.Commit(); | 
|                 return true; | 
|             } | 
|             catch (Exception e) | 
|             { | 
|                 sReturn = e.Message; | 
|                 oCn.RollBack(); | 
|                 throw (e); | 
|             } | 
|         } | 
|         //ÏÔʾµ¥¾Ý | 
|         public override bool ShowBill(Int64 lngBillKey, ref string sReturn) | 
|         { | 
|             try | 
|             { | 
|                 //²éѯÖ÷±í | 
|                 DataSet Ds ; | 
|                 Ds = oCn.RunProcReturn("Select * from Sc_ICMOReportBillSub_WMS Where HInterID=" + lngBillKey.ToString(), "Sc_ICMOReportBillSub_WMS"); | 
|                 if(Ds.Tables[0].Rows.Count==0) | 
|                 { | 
|                     sReturn = "µ¥¾ÝδÕÒµ½£¡"; | 
|                     return false; | 
|                 } | 
|                 //¸³Öµ | 
|                 omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); | 
|                 omodel.HReportEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HReportEntryID"]); | 
|                 omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); | 
|                 omodel.HReportType = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HReportType"]); | 
|                 omodel.HPieceQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPieceQty"]); | 
|                 omodel.HQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HQty"]); | 
|                 omodel.HBarCode = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBarCode"]); | 
|                 omodel.HAddr = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HAddr"]); | 
|                 omodel.HMaker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaker"]); | 
|                 omodel.HMakeDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HMakeDate"]); | 
|                 omodel.HSourceInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceInterID"]); | 
|                 omodel.HSourceEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceEntryID"]); | 
|                 omodel.HSourceBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillNo"]); | 
|                 omodel.HSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillType"]); | 
|                 omodel.HRelationInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HRelationInterID"]); | 
|                 omodel.HRelationEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HRelationEntryID"]); | 
|                 omodel.HRelationBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRelationBillNo"]); | 
|                  | 
|                   | 
|                 sReturn = "ÏÔʾµ¥¾Ý³É¹¦£¡"; | 
|                 return true; | 
|             } | 
|             catch (Exception e) | 
|             { | 
|                 sReturn = e.Message; | 
|                 throw (e); | 
|             } | 
|         } | 
|   | 
|         //ÅжÏÊÇ·ñÍ깤 | 
|         public bool IsEnded(long HInterID, ref string sReturn) | 
|         { | 
|             try | 
|             { | 
|                 DataSet DS; | 
|                 DS = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_WMSQty " + HInterID.ToString(), "Sc_ICMOReportBillSub_WMS"); | 
|                 if (DS.Tables[0].Rows.Count == 0) | 
|                 { | 
|                     return false; | 
|                 } | 
|                 if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HBool"]) != "") | 
|                 { | 
|                     sReturn = "ÒÑÍ깤£¡"; | 
|                     return true; | 
|                 } | 
|                 else | 
|                 { | 
|                     sReturn = "δÍ깤£¡"; | 
|                     return false; | 
|                 } | 
|             } | 
|             catch (Exception e) | 
|             { | 
|                 sReturn = e.Message; | 
|                 throw (e); | 
|             } | 
|         } | 
|   | 
|         | 
|     }  | 
|   | 
| } |