Beispiel #1
0
        public override bool buscarID(ClasseBase obj)
        {
            bool resultado = false;
            SigletonConexaoFB.carregaStrcnx();
            FbCommand command = new FbCommand();
            FbDataReader reader;

            try
            {
                command.Connection = SigletonConexaoFB.getConexao();
                command.CommandText = "SELECT COD_CLIENTE,FANTASIA,RAZAO_SOCIAL,SITUACAO " +
                    "FROM TB_CLIENTE WHERE COD_CLIENTE=" + ((Cliente)obj).Cod_cliente;
                command.Connection.Open();
                reader = command.ExecuteReader();
                if (reader.Read())
                {
                    ((Cliente)obj).Fantasia = reader["FANTASIA"].ToString();
                    ((Cliente)obj).Razao_social = reader["RAZAO_SOCIAL"].ToString();
                    ((Cliente)obj).Situacao = int.Parse(reader["SITUACAO"].ToString());
                }
                reader.Close();
                resultado = true;
            }
            catch (Exception ex)
            {
                throw new Exception("Erro ao carregar dados do cliente: " + ex.Message);
            }
            finally
            {
                command.Connection.Close();
            }
            return resultado;
        }
Beispiel #2
0
 public virtual bool aplicar(ClasseBase obj)
 {
     bool resultado = true;
     switch (obj.State)
     {
         case StateObj.stNovo:
             this.inserir(obj);
             break;
         case StateObj.stEditar:
             this.alterar(obj);
             break;
         case StateObj.stExcluir:
             this.excluir(obj);
             break;
     }
     return resultado;
 }
Beispiel #3
0
        public virtual bool aplicar(ClasseBase obj)
        {
            bool resultado = true;

            switch (obj.State)
            {
            case StateObj.stNovo:
                this.inserir(obj);
                break;

            case StateObj.stEditar:
                this.alterar(obj);
                break;

            case StateObj.stExcluir:
                this.excluir(obj);
                break;
            }
            return(resultado);
        }
Beispiel #4
0
        public override bool buscarID(ClasseBase obj)
        {
            bool resultado = false;
            SigletonConexaoFB.carregaStrcnx();
            FbCommand command = new FbCommand();
            FbDataReader reader;

            try
            {
                command.Connection = SigletonConexaoFB.getConexao();
                command.CommandText = "SELECT ID,COD_CLIENTE,DATA_VENDA,DATA_CRIACAO_BD, " +
                    "SITUACAO FROM TB_LICENCA_CLIENTE WHERE ID=" + ((Licenca_cliente)obj).Id;
                command.Connection.Open();
                reader = command.ExecuteReader();
                if (reader.Read())
                {
                    ((Licenca_cliente)obj).Cliente.Cod_cliente = int.Parse(reader["COD_CLIENTE"].ToString());
                    ((Licenca_cliente)obj).Data_venda = DateTime.Parse(reader["DATA_VENDA"].ToString());
                    ((Licenca_cliente)obj).Data_criacao_bd = DateTime.Parse(reader["DATA_CRIACAO_BD"].ToString());
                    if (!reader.IsDBNull(reader.GetOrdinal("SITUACAO")))
                    {
                        ((Licenca_cliente)obj).Situacao = int.Parse(reader["SITUACAO"].ToString());
                    }
                }
                reader.Close();
                resultado = true;
            }
            catch (Exception ex)
            {
                throw new Exception("Erro ao carregar dados do cliente: " + ex.Message);
            }
            finally
            {
                command.Connection.Close();
            }
            return resultado;
        }
Beispiel #5
0
 public abstract bool buscarID(ClasseBase obj);
Beispiel #6
0
 public abstract void alterar(ClasseBase obj);
Beispiel #7
0
 public abstract void excluir(ClasseBase obj);
Beispiel #8
0
 public abstract void inserir(ClasseBase obj);
Beispiel #9
0
 public override void alterar(ClasseBase obj)
 {
     throw new NotImplementedException();
 }
Beispiel #10
0
 public override void alterar(ClasseBase obj)
 {
     throw new Exception("Método Alterar da Classe DAOLicenca_cliente sem implementação");
 }
Beispiel #11
0
 public abstract bool buscarID(ClasseBase obj);
Beispiel #12
0
 public abstract void alterar(ClasseBase obj);
Beispiel #13
0
 public abstract void excluir(ClasseBase obj);
Beispiel #14
0
 public abstract void inserir(ClasseBase obj);
Beispiel #15
0
 public override void alterar(ClasseBase obj)
 {
     throw new Exception("Método Alterar da Classe DAOHistAtualizReg sem implementação");
 }
Beispiel #16
0
 public override bool buscarID(ClasseBase obj)
 {
     throw new Exception("Método BuscarID da Classe DAOHistAtualizReg sem implementação");
 }
Beispiel #17
0
 public bool buscarAtualizCliente(ClasseBase obj)
 {
     throw new Exception("Método BuscarID da Classe DAOCliente sem implementação");
 }
Beispiel #18
0
 public override bool buscarID(ClasseBase obj)
 {
     throw new NotImplementedException();
 }
Beispiel #19
0
 public override void excluir(ClasseBase obj)
 {
     throw new Exception("Método Excluir da Classe DAOCliente sem implementação");
 }