public CityAccountMapCollection FetchAll() { CityAccountMapCollection coll = new CityAccountMapCollection(); Query qry = new Query(CityAccountMap.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
public void RemoveFromAccount() { CityAccountMapCollection collection = new CityAccountMapCollection(); CityAccountMap findMe = new CityAccountMap(); findMe.CityID = this.CityId; findMe.AccountID = CurrentUser.CurrentAccount.AccountId; collection.LoadAndCloseReader(CityAccountMap.Find(findMe)); foreach (CityAccountMap deleteMe in collection) { CityAccountMap.Delete(deleteMe.CityAccountMapID); } }
public static void AssociateWithCurrentAccount(int cityId) { CityAccountMapCollection collection = new CityAccountMapCollection(); CityAccountMap findMe = new CityAccountMap(); findMe.CityID = cityId; findMe.AccountID = CurrentUser.CurrentAccount.AccountId; collection.LoadAndCloseReader(CityAccountMap.Find(findMe)); if (collection.Count == 0) { CityAccountMap newMap = new CityAccountMap(); newMap.CityID = cityId; newMap.AccountID = CurrentUser.CurrentAccount.AccountId; newMap.Save(); } }
public CityAccountMapCollection FetchByQuery(Query qry) { CityAccountMapCollection coll = new CityAccountMapCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
public CityAccountMapCollection FetchByID(object CityAccountMapID) { CityAccountMapCollection coll = new CityAccountMapCollection().Where("CityAccountMapID", CityAccountMapID).Load(); return coll; }