private TblUF uf; // <---- SQL aqui também

        #endregion Fields

        #region Constructors

        public formCadastroCliente(bool pesquisaHabilitado)
            : base(pesquisaHabilitado)
        {
            InitializeComponent();
            if (pesquisaHabilitado)
                pesquisa = new formPesquisaCliente(this, false);
            comboTipo.Enabled = false;
            clienteSQL = new GerCliente();
            uf = new TblUF();
        }
Exemple #2
0
        public void selecionar(
            int codigo, 
            dsFROGIOS.FORNECEDORDataTable fornecedor, 
            dsFROGIOS.FORNECEDOR_FISICODataTable fisico, 
            dsFROGIOS.FORNECEDOR_JURIDICODataTable juridico,
            dsFROGIOS.UFDataTable uf)
        {
            fornecedor.Clear();

            TblFornecedor fornecedorSql = new TblFornecedor();
            fornecedor.Load(
                fornecedorSql.selecionar(
                fornecedor.FORNECEDOR_CODIGOColumn.ColumnName,
                codigo.ToString(),
                true
                )
            );

            TblUF ufSql = new TblUF();
            uf.Clear();
            uf.Load(ufSql.selecionar(
                uf.UF_CODIGOColumn.ColumnName,
                Convert.ToString(((dsFROGIOS.FORNECEDORRow)fornecedor.Rows[0]).FORNECEDOR_UF),
                true
                ));

            if (fisico != null) {
                fisico.Clear();
                TblFornecedorFisico fisicoSql = new TblFornecedorFisico();
                fisico.Load(
                    fisicoSql.selecionar(
                        fisico.FORNECEDOR_FISICO_FORNECEDORColumn.ColumnName,
                        codigo.ToString(),
                        true
                    )
                );
            } else if (juridico != null) {
                juridico.Clear();
                TblFornecedorJuridico juridicoSql = new TblFornecedorJuridico();
                juridico.Load(
                    juridicoSql.selecionar(
                        juridico.FORNECEDOR_JURIDICO_FORNECEDORColumn.ColumnName,
                        codigo.ToString(),
                        true
                    )
                );
            }
        }