public LanguageAccountMapCollection FetchAll()
 {
     LanguageAccountMapCollection coll = new LanguageAccountMapCollection();
     Query qry = new Query(LanguageAccountMap.Schema);
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
예제 #2
0
 public void RemoveLanguageFromCurrentAccount()
 {
     LanguageAccountMapCollection collection = new LanguageAccountMapCollection();
     SubSonic.Query q = LanguageAccountMap.CreateQuery();
     q.AddWhere(LanguageAccountMap.Columns.AccountId, CurrentUser.CurrentAccount.AccountId);
     q.AND(LanguageAccountMap.Columns.LanguageId, LanguageId);
     collection.Load(LanguageAccountMap.FetchByQuery(q));
     foreach (LanguageAccountMap thisMap in collection)
     {
         LanguageAccountMap.Delete(thisMap.LanguageAccountMapId);
     }
 }
예제 #3
0
 public void AddLanguageToCurrentAccount()
 {
     LanguageAccountMapCollection collection = new LanguageAccountMapCollection();
     SubSonic.Query  q = LanguageAccountMap.CreateQuery();
     q.AddWhere(LanguageAccountMap.Columns.AccountId, CurrentUser.CurrentAccount.AccountId);
     q.AND(LanguageAccountMap.Columns.LanguageId,LanguageId);
     collection.Load(LanguageAccountMap.FetchByQuery(q));
     if (collection.Count == 0)
     {
         LanguageAccountMap newMap = new LanguageAccountMap();
         newMap.AccountId = CurrentUser.CurrentAccount.AccountId;
         newMap.LanguageId = LanguageId;
         newMap.Save();
     }
 }
 public LanguageAccountMapCollection FetchByQuery(Query qry)
 {
     LanguageAccountMapCollection coll = new LanguageAccountMapCollection();
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
 public LanguageAccountMapCollection FetchByID(object LanguageAccountMapId)
 {
     LanguageAccountMapCollection coll = new LanguageAccountMapCollection().Where("LanguageAccountMapId", LanguageAccountMapId).Load();
     return coll;
 }