/**
  * BancoDataGrid constructor.
  */
 public function __construct()
 {
     parent::__construct();
     parent::setDatabase('sobcontrole');
     parent::setActiveRecord('banco');
     parent::setFilterField('nome');
     parent::setDefaultOrder('nome', 'asc');
     /** @var TQuickForm $this */
     $this->form = new \Adianti\Widget\Wrapper\TQuickForm('BancoDataGrid');
     $this->form->setFormTitle('Cadastro Bancos');
     $this->form->class = 'tform';
     $nome = new \Adianti\Widget\Form\TEntry('nome');
     $this->form->addQuickField('Nome: ', $nome, 250);
     $this->form->addQuickAction('Buscar', new \Adianti\Control\TAction(array($this, 'onSearch')), 'ico_find.png');
     $this->form->addQuickAction('Novo', new \Adianti\Control\TAction(array('BancoFormView', 'onClear')), 'ico_new.png');
     $this->form->setData(\Adianti\Registry\TSession::getValue('banco_filtro'));
     $this->datagrid = new \Adianti\Widget\Wrapper\TQuickGrid();
     $this->datagrid->style = 'width: 100%';
     $this->datagrid->setHeight(300);
     $this->datagrid->addQuickColumn('ID', 'idbanco', 'right', 50, new \Adianti\Control\TAction(array($this, 'onReload')), array('order', 'idbanco'));
     $this->datagrid->addQuickColumn('Nome', 'nome', 'right', 250, new \Adianti\Control\TAction(array($this, 'onReload')), array('order', 'nome'));
     $this->datagrid->addQuickColumn('Sigla', 'sigla', 'right', 100, new \Adianti\Control\TAction(array($this, 'onReload')), array('order', 'sigla'));
     $this->datagrid->addQuickAction('Editar', new \Adianti\Widget\Datagrid\TDataGridAction(array('BancoFormView', 'onEdit')), 'idbanco', 'ico_edit.png');
     $this->datagrid->addQuickAction('Excluir', new \Adianti\Widget\Datagrid\TDataGridAction(array($this, 'onDelete')), 'idbanco', 'ico_delete.png');
     $this->datagrid->createModel();
     $this->pageNavigation = new \Adianti\Widget\Datagrid\TPageNavigation();
     $this->pageNavigation->setAction(new \Adianti\Control\TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     $vbox = new TVBox();
     $vbox->add(new \Adianti\Widget\Util\TXMLBreadCrumb('menu.xml', 'BancoFormView'));
     $vbox->add($this->form);
     $vbox->add($this->datagrid);
     $vbox->add($this->pageNavigation);
     parent::add($vbox);
 }
 public function __construct()
 {
     parent::__construct();
     parent::setDatabase(APPLICATION_NAME);
     parent::setActiveRecord('contabancaria');
     parent::setFilterField('conta');
     parent::setDefaultOrder('conta', 'asc');
     /** @var TQuickForm $this */
     $this->form = new \Adianti\Widget\Wrapper\TQuickForm('ContabancariaDataGrid');
     $this->form->setFormTitle('Cadastro Contas Bancárias');
     $this->form->class = 'tform';
     $conta = new \Adianti\Widget\Form\TEntry('conta');
     $this->form->addQuickField('Conta: ', $conta, 100);
     $this->form->addQuickAction('Buscar', new TAction(array($this, 'onSearch')), 'ico_find.png');
     $this->form->addQuickAction('Novo', new TAction(array('ContabancariaFormView', 'onClear')), 'ico_new.png');
     $this->form->setData(\Adianti\Registry\TSession::getValue('contabancaria_filtro'));
     $this->datagrid = new \Adianti\Widget\Wrapper\TQuickGrid();
     $this->datagrid->style = 'width: 100%';
     $this->datagrid->setHeight(230);
     //$this->datagrid->addQuickColumn('ID','idcontabancaria','right',40,new TAction(array($this,'onReload')),array('order','idcontabancaria'));
     $this->datagrid->addQuickColumn('Agência', 'agencia', 'right', 40, new TAction(array($this, 'onReload')), array('order', 'agencia'));
     $this->datagrid->addQuickColumn('Conta', 'conta', 'right', 100, new TAction(array($this, 'onReload')), array('order', 'conta'));
     $this->datagrid->addQuickColumn('Banco', 'banco->nome', 'right', 200, new TAction(array($this, 'onReload')), array('order', 'banco->nome'));
     $this->datagrid->addQuickColumn('Tipo Conta', 'tipocontabancaria->descricao', 'right', 120, new TAction(array($this, 'onReload')), array('order', 'tipocontabancaria->descricao'));
     $this->datagrid->addQuickColumn('Titular', 'titular', 'right', 40, new TAction(array($this, 'onReload')), array('order', 'titular'));
     $this->datagrid->addQuickColumn('Cidade', 'cidade->nome', 'right', 100, new TAction(array($this, 'onReload')), array('order', 'cidade->nome'));
     $this->datagrid->addQuickAction('Editar', new TDataGridAction(array('ContabancariaFormView', 'onEdit')), 'idcontabancaria', 'ico_edit.png');
     $this->datagrid->addQuickAction('Excluir', new TDataGridAction(array($this, 'onDelete')), 'idcontabancaria', 'ico_delete.png');
     $this->datagrid->createModel();
     $this->pageNavigation = new \Adianti\Widget\Datagrid\TPageNavigation();
     $this->pageNavigation->setAction(new \Adianti\Control\TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     $vbox = new TVBox();
     $vbox->add(new \Adianti\Widget\Util\TXMLBreadCrumb('menu.xml', 'ContabancariaFormView'));
     $vbox->add($this->form);
     $vbox->add($this->datagrid);
     $vbox->add($this->pageNavigation);
     parent::add($vbox);
 }
 public function __construct()
 {
     parent::__construct();
     parent::setDatabase(APPLICATION_NAME);
     parent::setActiveRecord('pessoa');
     parent::setFilterField('nome');
     parent::setDefaultOrder('nome', 'asc');
     /** @var TQuickForm $this */
     $this->form = new \Adianti\Widget\Wrapper\TQuickForm('PessoaDataGrid');
     $this->form->setFormTitle('Cadastro de Pessoas');
     $this->form->class = 'tform';
     $nome = new \Adianti\Widget\Form\TEntry('nome');
     $this->form->addQuickField('Nome: ', $nome, 300);
     $this->form->addQuickAction('Buscar', new TAction(array($this, 'onSearch')), 'ico_find.png');
     $this->form->addQuickAction('Novo', new TAction(array('PessoaFormView', 'onClear')), 'ico_new.png');
     $this->form->setData(\Adianti\Registry\TSession::getValue('pessoa_filtro'));
     $this->datagrid = new \Adianti\Widget\Wrapper\TQuickGrid();
     $this->datagrid->style = 'width: 100%';
     $this->datagrid->setHeight(230);
     //$this->datagrid->addQuickColumn('ID','idpessoa','right',40,new TAction(array($this,'onReload')),array('order','idpessoa'));
     $this->datagrid->addQuickColumn('Nome', 'nome', 'right', 300, new TAction(array($this, 'onReload')), array('order', 'nome'));
     $this->datagrid->addQuickColumn('Natureza', 'natureza', 'right', 50, new TAction(array($this, 'onReload')), array('order', 'natureza'));
     $this->datagrid->addQuickColumn('Dt.Cadastro', 'dtcadastro', 'right', 40, new TAction(array($this, 'onReload')), array('order', 'dtcadastro'));
     $this->datagrid->addQuickColumn('Dt.Nascimento', 'dtnascimento', 'right', 40, new TAction(array($this, 'onReload')), array('order', 'dtnascimento'));
     $this->datagrid->addQuickColumn('Ramo Atividade', 'ramoatividade->descricao', 'right', 100, new TAction(array($this, 'onReload')), array('order', 'ramoatividade->descricao'));
     $this->datagrid->addQuickAction('Editar', new TDataGridAction(array('PessoaFormView', 'onEdit')), 'idpessoa', 'ico_edit.png');
     $this->datagrid->addQuickAction('Excluir', new TDataGridAction(array($this, 'onDelete')), 'idpessoa', 'ico_delete.png');
     $this->datagrid->createModel();
     $this->pageNavigation = new \Adianti\Widget\Datagrid\TPageNavigation();
     $this->pageNavigation->setAction(new \Adianti\Control\TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     $vbox = new TVBox();
     $vbox->add(new \Adianti\Widget\Util\TXMLBreadCrumb('menu.xml', 'PessoaFormView'));
     $vbox->add($this->form);
     $vbox->add($this->datagrid);
     $vbox->add($this->pageNavigation);
     parent::add($vbox);
 }