Example #1
0
 function xmoney_close_clicked()
 {
     $dialog = new Question($this->Owner, 'Sair do X-Money?');
     $result = $dialog->ask();
     if ($result != Gtk::RESPONSE_YES) {
         return;
     }
     Gtk::main_quit();
 }
Example #2
0
 function delete_event()
 {
     $dialog = new Question($this->Owner, 'Sair do X-Money?');
     $result = $dialog->ask();
     if ($result == Gtk::RESPONSE_YES) {
         exit(0);
     } else {
         return true;
     }
 }
Example #3
0
 function excluir_clicked()
 {
     if (!$this->grid->pega_dados()) {
         return;
     }
     $id = $this->grid->Valores[0];
     $dialog = new Question($this->Owner, ' Deseja mesmo remover o produto selecionado? ');
     $result = $dialog->ask();
     if ($result != Gtk::RESPONSE_YES) {
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     $sql = 'DELETE FROM Tb_Produtos WHERE Cod_S_Produto = ' . $id;
     if (!$db->query($sql)) {
         return;
     }
     $this->pega_dados();
     new Message($this->Owner, 'Produto removido com sucesso!');
 }
Example #4
0
 function excluir_clicked()
 {
     if (!$this->grid->pega_dados()) {
         return;
     }
     $id = $this->grid->Valores[0];
     $dialog = new Question($this->Owner, latin1(' Deseja mesmo remover o endereço selecionado ? '));
     $resp = $dialog->ask();
     if ($resp != Gtk::RESPONSE_YES) {
         return;
     }
     $sql = ' DELETE FROM Tb_End_Fornecedores WHERE Cod_S_Endereco = ' . $id;
     $db = new Database($this->Owner, false);
     if (!$db->link) {
         return;
     }
     if (!$db->query($sql)) {
         return;
     }
     $this->pega_dados();
     new Message($this->Owner, 'Endereco for fornecedor removido com sucesso!');
 }
Example #5
0
 function excluir_clicked()
 {
     if (!$this->grid->pega_dados()) {
         return;
     }
     $id = $this->grid->Valores[0];
     $dialog = new Question($this->Owner, latin1('Deseja mesmo remover a unidade de venda selecionada?'));
     $result = $dialog->ask();
     if ($result != Gtk::RESPONSE_YES) {
         return;
     }
     $db = new Database($this->Owner, false);
     if (!$db->link) {
         return;
     }
     $sql = 'DELETE FROM Tb_Unid_Vendas WHERE Cod_S_Unidade = ' . $id;
     if (!$db->query($sql)) {
         return;
     }
     $this->pega_dados();
     new Message($this->Owner, 'Unidade de venda removida com sucesso!');
 }
 function excluir_clicked()
 {
     if (!$this->grid->pega_dados()) {
         return;
     }
     $id = $this->grid->Valores[0];
     $dialog = new Question($this->Owner, ' Deseja mesmo remover a transportadora selecionada? ');
     $resp = $dialog->ask();
     if ($resp != Gtk::RESPONSE_YES) {
         return;
     }
     $db = new Database($this->Owner, false);
     if (!$db->link) {
         return;
     }
     $sql = ' DELETE FROM Tb_Transportadoras WHERE Cod_S_Trans = ' . $id;
     if (!$db->query($sql)) {
         return;
     }
     $this->pega_dados();
     new Message($this->Owner, 'Transportadora removida com sucesso!');
 }
function createPost()
{
    //take input here
    global $db;
    $q = new Question();
    echo "Enter the title of Question\n";
    $q->context = trim(fgets(STDIN));
    echo "Enter the statement of Question\n";
    $q->statement = trim(fgets(STDIN));
    if ($q->ask($db)) {
        echo "\n Question has been posted successfully\n";
    } else {
        echo "\n Try again :(\n ";
    }
}
Example #8
0
 function excluir_clicked()
 {
     if ($this->grid->pega_dados()) {
         $question = new Question($this, 'Deseja remover o produto selecionado?');
         if ($question->ask() == Gtk::RESPONSE_YES) {
             $db = new Database($this);
             if (!$db->conexao) {
                 return;
             }
             $query = 'UPDATE Tb_Produtos SET Inativo = 1 WHERE Cod_S_Pro = ' . $this->grid->Valores[0];
             if ($db->run('sistema', $query)) {
             }
             $this->pega_dados();
         }
     }
 }