Beispiel #1
0
        public void removeAllManagers_test()
        {
            try
            {
                Init();
                //create one owner
                StoreManager storeManagerFirstOwner = storeOwner.getStoreManagerOb(store);
                storeManagerFirstOwner.CreateNewManager(storeOwner2, ownerRoles);
                storeManagerFirstOwner.CreateNewManager(storeManager, ownerRoles);
                //create one manager sub the new owner
                StoreManager storeManagerSecondOwner = storeOwner2.getStoreManagerOb(store);
                try
                {
                    storeManagerSecondOwner.CreateNewManager(storeManager2, ownerRoles);
                    Assert.IsTrue(false);
                } catch (Exception ex)
                {
                    Assert.IsTrue(true);
                }
                //delete the owner see if he and is sub are removed

                storeManagerFirstOwner.removeAllManagers();


                //Assert.IsTrue(storeManagerSecondOwner.subManagers.Count == 0);
                //Assert.IsTrue(storeManagerFirstOwner.subManagers.Count == 0);
            }
            finally
            {
                Cealup();
            }
        }
Beispiel #2
0
        public bool makeStoreOwner(string username, Roles role, int StoreID)
        {
            Store        store        = GetStore(StoreID);
            StoreManager myStoreRoles = getStoreManagerOb(store);
            Member       candidate    = ConnectionStubTemp.getMember(username);

            if (candidate.isStoresManagers())
            {
                try
                {
                    candidate.GetStore(StoreID);
                }
                catch (WorkShopDbException dbExc)
                {
                    throw dbExc;
                }
                catch (Exception ex)
                {
                    myStoreRoles.CreateNewManager(candidate, role);
                }
            }
            else
            {
                myStoreRoles.CreateNewManager(candidate, role);
            }
            StoreManager candidateStoreManager = candidate.getStoreManagerOb(store);

            candidateStoreManager.SetStoreOwnerTrue();
            ConnectionStubTemp.Update(ConnectionStubTemp.getMember(username));//shira
            return(true);
        }
        public void CreateNewManager_test()
        {
            StoreManager storeManagerFirstOwner = storeOwner.getStoreManagerOb(store);

            storeManagerFirstOwner.CreateNewManager(someMember, ownerRoles);

            Assert.IsTrue(someMember.getStoreManagerRoles(store).isStoreOwner());
            Assert.IsTrue(someMember.getStoreManagerOb(store).GetFather().GetStore().Id == storeId);
        }
Beispiel #4
0
        public bool addManager(string username, Roles role, int StoreID)
        {
            Store        store        = GetStore(StoreID);
            StoreManager myStoreRoles = getStoreManagerOb(store);
            bool         ret          = myStoreRoles.CreateNewManager(ConnectionStubTemp.getMember(username), role);

            ConnectionStubTemp.Update(ConnectionStubTemp.getMember(username));
            return(ret);
        }
Beispiel #5
0
        public void CreateNewManager_test()
        {
            try
            {
                Init();
                StoreManager storeManagerFirstOwner = storeOwner.getStoreManagerOb(store);
                storeManagerFirstOwner.CreateNewManager(storeOwner2, ownerRoles);

                Assert.IsTrue(storeManagerFirstOwner.isStoreOwner());
                Assert.IsTrue(storeOwner2.getStoreManagerOb(store).GetFather().GetStore().id == storeId);
            }
            finally
            {
                Cealup();
            }
        }
Beispiel #6
0
        public bool addManager(string username, Roles role, Store store)
        {
            StoreManager myStoreRoles = getStoreManagerOb(store);

            return(myStoreRoles.CreateNewManager(ConnectionStubTemp.getMember(username), role));
        }