private bool OfCreateCommand(ERP_MSSQLDAL pApDao, string ps_TargetTable, string ps_TargetColumn, string ps_ViewTable, bool pGenNonSelectCommand = true) { if (pApDao == null) { return(false); } ps_TargetTable = GlobalFn.isNullRet(ps_TargetTable, ""); ps_ViewTable = GlobalFn.isNullRet(ps_ViewTable, ""); ps_TargetColumn = GlobalFn.isNullRet(ps_TargetColumn, ""); // 如未指定 view table ,則以 target table 為 view table if (ps_ViewTable == "") { ps_ViewTable = ps_TargetTable; } if (ps_TargetColumn == "") { ps_TargetColumn = "*"; } // 如有指定 CRUD Table, 則以 update table 建構 m_ap_dao if (ps_TargetTable.Length > 0 || ps_ViewTable.Length > 0) { ((YR.DAL.DALBase) this.m_ap_dao).OfCreateCommand(ps_TargetTable, ps_ViewTable, TRAN, pGenNonSelectCommand); } return(true); }
public static YR.ERP.DAL.ERP_MSSQLDAL CreateDAO(string pAssemblyName, string pDalClass, string pDbType, System.Data.Common.DbConnection pConnection) { Assembly asm = GetAssembly(pAssemblyName, pDalClass); ERP_MSSQLDAL dalReturn = (ERP_MSSQLDAL)asm.CreateInstance(pDalClass); if (dalReturn != null) { dalReturn.OfInitialConnection(pConnection);; int iDbType; int.TryParse(pDbType, out iDbType); ((YR.DAL.DALBase)dalReturn).DB_TYPE = (DB_TYPE)iDbType; } return(dalReturn); }
public static YR.ERP.DAL.ERP_MSSQLDAL CreateDAO(string pAssemblyName, string pDalClass, string pDbType, string pConnectionString) { if (pAssemblyName == null || pDalClass == null || pConnectionString == null) { return(null); } Assembly asm = GetAssembly(pAssemblyName, pDalClass); ERP_MSSQLDAL dalReturn = (ERP_MSSQLDAL)asm.CreateInstance(pDalClass); if (dalReturn != null) { dalReturn.OfInitialConnection(pConnectionString);; int iDbType; int.TryParse(pDbType, out iDbType); ((YR.DAL.DALBase)dalReturn).DB_TYPE = (DB_TYPE)iDbType; } return(dalReturn); }