コード例 #1
0
ファイル: NGCliente.cs プロジェクト: dopaco/SistemaVenda
        public bool incluir(Cliente p_objCliente)
        {
            #region Validação de campos Obrigatorios
            if (p_objCliente.ID == int.MinValue)
            {
                throw new Exception("O campo ID é obrigatorio");
            }
            if (p_objCliente.Nome == string.Empty)
            {
                throw new Exception("O campo nome é obrigatorio");
            }
            if (p_objCliente.DataCadastro == string.Empty)
            {
                throw new Exception("O campo Data Cadastro é obrigatorio");
            }
            if (p_objCliente.CNPJ == string.Empty)
            {
                throw new Exception("O campo CNPJ é obrigatorio");
            }
            #endregion

            DBCliente objDados = new DBCliente();
            return objDados.incluir(p_objCliente);
        }
コード例 #2
0
ファイル: NGCliente.cs プロジェクト: dopaco/SistemaVenda
 public List<Cliente> Concultar(int p_intID)
 {
     DBCliente objDados = new DBCliente();
     return objDados.consultar(p_intID);
 }