Ejemplo n.º 1
0
 //TODO se verifca existenta fisierului de save -> daca exista se face load/ daca nu exista se creeaza un user nou
 public void CreateNewUser()
 {
     username      = "******";
     businessLevel = new BusinessLevel {
         currentLevel = BusinessLevel.LevelType.NOUBIE
     };
 }
Ejemplo n.º 2
0
        public async Task SaveBusinessLevelAsync(BusinessLevel bl)
        {
            using (ISession session = SessionFactory.OpenSession())
                using (ITransaction transaction = session.BeginTransaction())
                {
                    await session.SaveOrUpdateAsync(bl);

                    transaction.Commit();
                }
        }
Ejemplo n.º 3
0
        public async Task <BusinessLevelBackendDTO> CreateAndSaveBusinessLevel(string businessLevelDesc)
        {
            var businessLevel = BusinessLevel.Create(businessLevelDesc);

            await _repository.SaveBusinessLevelAsync(businessLevel);

            return(new BusinessLevelBackendDTO()
            {
                Id = businessLevel.Id, BusinessLevelDescription = businessLevel.BusinessLevelDesc
            });
        }
Ejemplo n.º 4
0
 public virtual void Update(string name, string email, string password, Realm realm, Region region, BusinessLevel businessLevel, bool isAdmin)
 {
     this.Password                      = password;
     this.UserInformation.Name          = name;
     this.UserInformation.Email         = email;
     this.UserInformation.BusinessLevel = businessLevel;
     this.UserInformation.Realm         = realm;
     this.UserInformation.Region        = region;
     this.UserInformation.IsAdmin       = isAdmin;
 }
Ejemplo n.º 5
0
        public static User Create(string login, string name, string email, string password, Realm realm, Region region, BusinessLevel businessLevel, bool isAdmin)
        {
            var entity = new User()
            {
                Login = login, Password = password
            };
            var userInformation = UserInformation.Create(entity, name, email, realm, region, businessLevel, isAdmin);

            entity.UserInformation = userInformation;

            return(entity);
        }
Ejemplo n.º 6
0
        public static UserInformation Create(User user, string name, string email, Realm realm, Region region, BusinessLevel businessLevel, bool isAdmin)
        {
            var entity = new UserInformation()
            {
                User          = user,
                Name          = name,
                Email         = email,
                BusinessLevel = businessLevel,
                Realm         = realm,
                Region        = region,
                IsAdmin       = isAdmin
            };

            return(entity);
        }