Пример #1
0
        protected override void LoadToControls()
        {
            base.LoadToControls();

            if (Id != null)
            {
                CaixaBLL = new CaixaBLL();
                Caixa Caixa = CaixaBLL.Localizar(Id);

                if (Caixa != null)
                {
                    txtId.Text         = Caixa.Id.ToString();
                    txtNumero.Text     = Caixa.numero;
                    chkInativo.Checked = Caixa.inativo == "S";
                    txtNumero.Focus();
                }
            }
        }
Пример #2
0
 protected override void excluirRegistro(int Id)
 {
     base.excluirRegistro(Id);
     CaixaBLL = new CaixaBLL();
     try
     {
         if (Convert.ToInt32(dgvDados[0, dgvDados.CurrentRow.Index].Value) > 0)
         {
             Caixa Caixa = CaixaBLL.Localizar(Convert.ToInt32(dgvDados[0, dgvDados.CurrentRow.Index].Value));
             if (MessageBox.Show("Deseja realmente excluir o registro : " + Caixa.Id.ToString() + " - " + Caixa.numero, Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
             {
                 CaixaBLL.ExcluirCaixa(Caixa);
             }
         }
     }
     finally
     {
         CaixaBLL.Dispose();
     }
 }