//Hämtar alla kontakttyper returnernar ett List objekt innehållande referenser till ContactType objekt. public IEnumerable <KontaktTyp> GetKontaktTypes(bool refresh = false) { // Försöker hämta lista med kontakttyper från cachen. var kategoriTypes = HttpContext.Current.Cache["KategoriTypes"] as IEnumerable <KontaktTyp>; // Om det inte finns det en lista med kontakttyper if (kategoriTypes == null || refresh) { // ...hämtar då lista med kontakttyper kategoriTypes = KontaktDAL.GetKontakter(); // ...och cachar dessa. List-objektet, inklusive alla ContactType-objekt, kommer att cachas // under 5 minuter, varefter de automatiskt avallokeras från webbserverns primärminne. HttpContext.Current.Cache.Insert("KategoriTypes", kategoriTypes, null, DateTime.Now.AddMinutes(5), TimeSpan.Zero); } // Returnerar listan med kontakttyper. return(kategoriTypes); }
public void DeletKontaktInfo(KontaktTyp K) { KontaktDAL.DeletKontaktInfoById(K); }
public void AddKontaktInfo(KontaktTyp K) { KontaktDAL.AddKontaktInfoById(K); }
public void UpdateKontaktInfo(KontaktTyp K) { KontaktDAL.UpdateKontaktInfoById(K); }
//Kontakt public IEnumerable <KontaktTyp> GetMemberKontaktTinfo(int memberId) { return(KontaktDAL.GetMemberKontaktInfoById(memberId)); }