Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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 void Insert(int CityID,int AccountID)
        {
            CityAccountMap item = new CityAccountMap();

            item.CityID = CityID;

            item.AccountID = AccountID;

            item.Save(UserName);
        }
        public void Update(int CityAccountMapID,int CityID,int AccountID)
        {
            CityAccountMap item = new CityAccountMap();

                item.CityAccountMapID = CityAccountMapID;

                item.CityID = CityID;

                item.AccountID = AccountID;

            item.MarkOld();
            item.Save(UserName);
        }