Exemple #1
0
 private void lblGravar_Click(object sender, EventArgs e)
 {
     if (Verifica())
     {
         Camadas.MODEL.ChaveProduto cp = new Camadas.MODEL.ChaveProduto();
         cp.idJogo = Convert.ToInt32(lblid.Text);
         cp.chave  = txtChave.Text;
         cp.status = Convert.ToChar(txtStatus.Text);
         Camadas.BLL.ChaveProduto bllCp = new Camadas.BLL.ChaveProduto();
         bllCp.Insert(cp);
         dgvChaves.DataSource = bllCp.Select();
     }
 }
Exemple #2
0
 private void lblEditar_Click(object sender, EventArgs e)
 {
     if (lblCodigo.Text != "0")
     {
         Camadas.MODEL.ChaveProduto cp = new Camadas.MODEL.ChaveProduto();
         cp.codigo = Convert.ToInt32(lblCodigo.Text);
         cp.idJogo = Convert.ToInt32(lblid.Text);
         cp.chave  = txtChave.Text;
         cp.status = Convert.ToChar(txtStatus.Text);
         Camadas.BLL.ChaveProduto bllCp = new Camadas.BLL.ChaveProduto();
         bllCp.Update(cp);
         dgvChaves.DataSource = bllCp.Select();
         Limpar();
     }
     else
     {
         string msg = "Selecione um item da tabela";
         MessageBox.Show(msg, "Aviso!", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }