示例#1
0
        public Retorno Alterar(AcessoSistema Entity)
        {
            try
            {
                Retorno retorno = PreenchimentoObrigatorio(Entity);
                if (retorno.IsValido)
                {
                    retorno = new DataAcessoSistema().Alterar(Entity);
                }
                return(retorno);
            }
            catch (Exception ex)
            {
                ISEmail.EnviarErro(String.Format(Mensagens.MSG_26, ex.Message, "Na camada Business ao ALTERAR Acesso Sistema"));

                return(new Retorno(false, String.Format(Mensagens.MSG_05, ex.Message, "Alterar Acesso Sistema")));
            }
        }
示例#2
0
        public Retorno PreenchimentoObrigatorio(AcessoSistema Entity)
        {
            if (Entity.Data == DateTime.MinValue)
            {
                return(new Retorno(false, String.Format(Mensagens.MSG_01, "Data")));
            }

            if (Entity.Backup == false)
            {
                return(new Retorno(false, String.Format(Mensagens.MSG_01, "Backup")));
            }

            if (Entity.Bloqueado == false)
            {
                return(new Retorno(false, String.Format(Mensagens.MSG_01, "Bloqueado")));
            }

            return(new Retorno(true));
        }
示例#3
0
        public Retorno Excluir(AcessoSistema Entity)
        {
            try
            {
                CommandSQL = new StringBuilder();
                CommandSQL.AppendLine("DELETE FROM TB_ACESSO_SISTEMA WHERE DATA = @DATA");
                Command = CriaComandoSQL(CommandSQL.ToString());
                Command.Parameters.AddWithValue("@DATA", Entity.Data);
                Abrir();
                Command.ExecuteNonQuery();
                return(new Retorno(true, String.Format(Mensagens.MSG_02, "Acesso Sistema", "Excluido ")));
            }
            catch (Exception ex)
            {
                ISEmail.EnviarErro(String.Format(Mensagens.MSG_26, ex.Message, "Na camada de dados ao EXCLUIR Acesso Sistema"));

                return(new Retorno(false, String.Format(Mensagens.MSG_05, ex.Message, "Excluir Acesso Sistema")));
            }
            finally { Fechar(); }
        }
示例#4
0
 public bool ValidarAcessoSistema(AdmSistema x)
 {
     acesso = new AcessoSistema();
     return(acesso.ValidarAcesso(x));
 }