public EFAccount CreateUser()
        {
            EFAccount account = new EFAccount()
            {
                TrackingState = TrackingState.Added
            };

            return(account);
        }
        public EFAccountView InsertUser(EFAccount account)
        {
            _AuthorizationRepository.InsertUser(DataContext, account);
            EFAccount user = _AuthorizationRepository.GetUser(DataContext, account.Id);

            return(new EFAccountView()
            {
                UserName = user.UserName, Id = user.Id, InUse = user.InUse, Name = user.Name, Surname = user.Surname
            });
        }
Beispiel #3
0
        public ICollection <EFAccount> GetVaraUsuario(EFAccount efAccount)
        {
            List <SqlParameter> parameters = new List <SqlParameter>();

            parameters.Add(new SqlParameter("@veExecutor", 1));
            parameters.Add(new SqlParameter("@veParametro", 7));
            parameters.Add(new SqlParameter("@veEFUserID", efAccount.EFUserID));

            return(this.databaseQueryCommand.Select <EFAccount>(Procedure, parameters));
        }
Beispiel #4
0
        public ICollection <EFAccount> GetComararcaAlocacao(EFAccount efAccount)
        {
            List <SqlParameter> parameters = new List <SqlParameter>();

            parameters.Add(new SqlParameter("@veExecutor", 1));
            parameters.Add(new SqlParameter("@veParametro", 5));
            parameters.Add(new SqlParameter("@veComarcaAlocacaoID", efAccount.ComarcaAlocacao));
            parameters.Add(new SqlParameter("@veSomenteAtiva", efAccount.SomenteAtiva));

            return(this.databaseQueryCommand.Select <EFAccount>(Procedure, parameters));
        }
Beispiel #5
0
        public ICollection <EFAccount> GetVaraUsuario(EFAccount efAccount)
        {
            ICollection <EFAccount> result = new List <EFAccount>();

            if (efAccount.EFRegiaoID.HasValue)
            {
                result = accountRepository.GetVaraComarca(efAccount);
            }

            if (efAccount.Categoria == 1 || efAccount.Categoria == 5)
            {
                result = accountRepository.GetVaraUsuario(efAccount);
            }

            //Recupera Todas as Comarcas pois o usuário é SPI ou RECALL
            if (efAccount.Categoria == 2 || efAccount.Categoria == 3 || efAccount.Categoria == 4)
            {
                result = accountRepository.GetVaraComarca(efAccount);
            }

            return(result);
        }
 public EFAccountView InsertUser(EFAccount user) => Channel.InsertUser(user);
 public bool CheckIfUserExists(EFAccount user) => Channel.CheckIfUserExists(user);
 public EFAccount UpdateUser(EFAccount user) => Channel.UpdateUser(user);
Beispiel #9
0
 public EFAccountView InsertUser(EFAccount user) => Get <EFAccountView>(user);
Beispiel #10
0
 public EFAccount UpdateUser(EFAccount user) => Get <EFAccount>(user);
 public bool CheckIfUserExists(EFAccount user)
 {
     return(_AuthorizationRepository.CheckIfUserExists(DataContext, user.UserName, user.Id));
 }
 public EFAccount UpdateUser(EFAccount user)
 {
     return(_AuthorizationRepository.UpdateUser(DataContext, user));
 }
 protected override string GetUserType(EFAccount account)
 {
     return(UserType.GetUserType(account?.Permissions)?.Name);
 }
Beispiel #14
0
 public bool CheckIfUserExists(EFAccount user)
 => Get <bool>(user);