//If this table type will exist as cached data, uncomment the CachePattern region below and edit. /* #region CachePattern //This region can be eliminated if this is not a table type with cached data. //If leaving this region in place, be sure to add RefreshCache and FillCache //to the Cache.cs file with all the other Cache types. ///<summary>A list of all MedLabFacAttaches.</summary> private static List<MedLabFacAttach> listt; ///<summary>A list of all MedLabFacAttaches.</summary> public static List<MedLabFacAttach> Listt{ get { if(listt==null) { RefreshCache(); } return listt; } set { listt=value; } } ///<summary></summary> public static DataTable RefreshCache(){ //No need to check RemotingRole; Calls GetTableRemotelyIfNeeded(). string command="SELECT * FROM medlabfacattach ORDER BY ItemOrder";//stub query probably needs to be changed DataTable table=Cache.GetTableRemotelyIfNeeded(MethodBase.GetCurrentMethod(),command); table.TableName="MedLabFacAttach"; FillCache(table); return table; } ///<summary></summary> public static void FillCache(DataTable table){ //No need to check RemotingRole; no call to db. listt=Crud.MedLabFacAttachCrud.TableToList(table); } #endregion */ ///<summary></summary> public static long Insert(MedLabFacAttach medLabFacAttach) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { medLabFacAttach.MedLabFacAttachNum=Meth.GetLong(MethodBase.GetCurrentMethod(),medLabFacAttach); return medLabFacAttach.MedLabFacAttachNum; } return Crud.MedLabFacAttachCrud.Insert(medLabFacAttach); }
//If this table type will exist as cached data, uncomment the CachePattern region below and edit. /* #region CachePattern * * private class MedLabFacAttachCache : CacheListAbs<MedLabFacAttach> { * protected override List<MedLabFacAttach> GetCacheFromDb() { * string command="SELECT * FROM MedLabFacAttach ORDER BY ItemOrder"; * return Crud.MedLabFacAttachCrud.SelectMany(command); * } * protected override List<MedLabFacAttach> TableToList(DataTable table) { * return Crud.MedLabFacAttachCrud.TableToList(table); * } * protected override MedLabFacAttach Copy(MedLabFacAttach MedLabFacAttach) { * return MedLabFacAttach.Clone(); * } * protected override DataTable ListToTable(List<MedLabFacAttach> listMedLabFacAttachs) { * return Crud.MedLabFacAttachCrud.ListToTable(listMedLabFacAttachs,"MedLabFacAttach"); * } * protected override void FillCacheIfNeeded() { * MedLabFacAttachs.GetTableFromCache(false); * } * protected override bool IsInListShort(MedLabFacAttach MedLabFacAttach) { * return !MedLabFacAttach.IsHidden; * } * } * * ///<summary>The object that accesses the cache in a thread-safe manner.</summary> * private static MedLabFacAttachCache _MedLabFacAttachCache=new MedLabFacAttachCache(); * * ///<summary>A list of all MedLabFacAttachs. Returns a deep copy.</summary> * public static List<MedLabFacAttach> ListDeep { * get { * return _MedLabFacAttachCache.ListDeep; * } * } * * ///<summary>A list of all visible MedLabFacAttachs. Returns a deep copy.</summary> * public static List<MedLabFacAttach> ListShortDeep { * get { * return _MedLabFacAttachCache.ListShortDeep; * } * } * * ///<summary>A list of all MedLabFacAttachs. Returns a shallow copy.</summary> * public static List<MedLabFacAttach> ListShallow { * get { * return _MedLabFacAttachCache.ListShallow; * } * } * * ///<summary>A list of all visible MedLabFacAttachs. Returns a shallow copy.</summary> * public static List<MedLabFacAttach> ListShort { * get { * return _MedLabFacAttachCache.ListShallowShort; * } * } * * ///<summary>Refreshes the cache and returns it as a DataTable. This will refresh the ClientWeb's cache and the ServerWeb's cache.</summary> * public static DataTable RefreshCache() { * return GetTableFromCache(true); * } * * ///<summary>Fills the local cache with the passed in DataTable.</summary> * public static void FillCacheFromTable(DataTable table) { * _MedLabFacAttachCache.FillCacheFromTable(table); * } * * ///<summary>Always refreshes the ClientWeb's cache.</summary> * public static DataTable GetTableFromCache(bool doRefreshCache) { * if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { * DataTable table=Meth.GetTable(MethodBase.GetCurrentMethod(),doRefreshCache); * _MedLabFacAttachCache.FillCacheFromTable(table); * return table; * } * return _MedLabFacAttachCache.GetTableFromCache(doRefreshCache); * } * #endregion */ ///<summary></summary> public static long Insert(MedLabFacAttach medLabFacAttach) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { medLabFacAttach.MedLabFacAttachNum = Meth.GetLong(MethodBase.GetCurrentMethod(), medLabFacAttach); return(medLabFacAttach.MedLabFacAttachNum); } return(Crud.MedLabFacAttachCrud.Insert(medLabFacAttach)); }