示例#1
0
        public void TestMethod1()
        {
            //
            // TODO: Add test logic here
            //

            UnitOfWork unitOfWork = new UnitOfWork();

            IRoleRepository rrepository = RepositoryFactory.GetRepository<IRoleRepository, Role>(unitOfWork);

            IAccountRepository arepository = RepositoryFactory.GetRepository<IAccountRepository, Account>(unitOfWork);

            IAccountRoleRepository arrepository = RepositoryFactory.GetRepository<IAccountRoleRepository, AccountRole>(unitOfWork);

            Role role = rrepository.FindBy(5);

            Account account = arepository.FindBy(1);

            //AccountRole accountRole = new AccountRole(new AccountRoleKey(account, role));

            //accountRole.Description = "this is description!!!!";

            //arrepository.Add(accountRole);

            AccountRole accountRole = arrepository.FindBy(new AccountRoleKey(account, role));

            accountRole.Description = accountRole.Description + "I xy";

            arrepository[accountRole.Key] = accountRole;

            unitOfWork.Commit();
        }
        public void TestMethod1()
        {
            //
            // TODO: Add test logic here
            //

            UnitOfWork unitOfWork = new UnitOfWork();

            IFunctionRepository frepository = RepositoryFactory.GetRepository<IFunctionRepository, Function>(unitOfWork);

            IAccountRepository arepository = RepositoryFactory.GetRepository<IAccountRepository, Account>(unitOfWork);

            IAccountFunctionRepository repository = RepositoryFactory.GetRepository<IAccountFunctionRepository, AccountFunction>(unitOfWork);

            Account account = arepository.FindBy(1);

            Function function = frepository.FindBy(2);

            AccountFunction accountFunction = repository.FindBy(new AccountFunctionKey(account, function));

            accountFunction.Description = "windowserrere";

            repository[accountFunction.Key] = accountFunction;

            unitOfWork.Commit();
        }
示例#3
0
        public void TestMethod1()
        {
            //
            // TODO: Add test logic here
            //
            UnitOfWork unitOfWork = new UnitOfWork();
            IModuleRepository repository = RepositoryFactory.GetRepository<IModuleRepository, Module>(unitOfWork);

            IList<Module> module= repository.FindAll();

            Console.WriteLine(module.Count);

            Console.Read();
        }
示例#4
0
        public void TestMethod1()
        {
            //
            // TODO: Add test logic here
            //

            UnitOfWork unitOfWork = new UnitOfWork();

            IFunctionRepository repository = RepositoryFactory.GetRepository<IFunctionRepository, Function>(unitOfWork);

            IModuleRepository mrepository = RepositoryFactory.GetRepository<IModuleRepository, Module>(unitOfWork);

            IList<Function> function = repository.FindAll();

            Console.WriteLine(function.Count);

            Function fun = new Function();

            fun.Name = "F**k";

            fun.Controller = "controller";

            fun.AddDate = (DateTime?)DateTime.Now;

            fun.Description = "this is description";

            fun.Module = mrepository.FindBy(1);

            fun.Action = "News";

            fun.Status = FunctionStatus.Normal;

               // fun.Uri = new Uri("http://www.google.com");

            repository.Add(fun);

            unitOfWork.Commit();

            Console.Read();
        }
示例#5
0
        public void TestMethod1()
        {
            //
            // TODO: Add test logic here
            //

            UnitOfWork unitOfWork = new UnitOfWork();

            IRoleRepository repository = RepositoryFactory.GetRepository<IRoleRepository, Role>(unitOfWork);

            Role roleinstance = new Role();

            /*
            IList<Role> role = repository.FindAll();

            roleinstance.Name = "f**k yx1";

            roleinstance.AddDate = (DateTime?)DateTime.Now;

            roleinstance.Description = "this is the description";

            roleinstance.Status = RoleStatus.Normal;

            repository.Add(roleinstance);

            unitOfWork.Commit();

            */

            roleinstance = repository.FindBy(5);

            roleinstance.Name = "helo pussy";

            repository[roleinstance.Key] = roleinstance;

            unitOfWork.Commit();

            Console.Read();
        }
示例#6
0
        public void TestMethod1()
        {
            //
            // TODO: Add test logic here
            //

            UnitOfWork unitOfWork = new UnitOfWork();

            IRoleFunctionRepository repository = RepositoryFactory.GetRepository<IRoleFunctionRepository, RoleFunction>(unitOfWork);

            RoleFunctionKey key = new RoleFunctionKey();

            key.Function = new Function(2);

            key.Role = new Role(5);

            RoleFunction rolefunction = new RoleFunction(key);

            rolefunction.Status = RoleFunctionStatus.Normal;

            rolefunction.Description = "this is description";

            repository.Add(rolefunction);

            unitOfWork.Commit();

            //IList<RoleFunction> rolefunctions = repository.FindAll();

            //int rolesize = rolefunctions.Count;

            //Console.Read();

            //Console.WriteLine(rolefunctions.Count);

            //Console.Read();
        }