public static bool UpdateAffiche(AfficheInfo affiche) { bool result; if (null == affiche) { result = false; } else { Globals.EntityCoding(affiche, true); result = new AfficheDao().UpdateAffiche(affiche); } return(result); }
public static IList <AfficheInfo> GetAfficheList(bool iscached = true) { IList <AfficheInfo> list = null; if (iscached) { list = HiCache.Get <List <AfficheInfo> >("DataCache-Affiches"); } if (list == null) { list = new AfficheDao().Gets <AfficheInfo>("AddedDate", SortAction.Desc, null); if (iscached) { HiCache.Insert("DataCache-Affiches", list, 1800); } } return(list); }
public static int DeleteAffiches(List <int> affiches) { if (affiches == null || affiches.Count == 0) { return(0); } AfficheDao afficheDao = new AfficheDao(); int num = 0; foreach (int affich in affiches) { if (afficheDao.Delete <AfficheInfo>(affich)) { num++; } } if (num > 0) { HiCache.Remove("DataCache-Affiches"); } return(num); }