Exemple #1
0
        protected override void LoadToControls()
        {
            base.LoadToControls();

            if (Id != null)
            {
                Tipo_LenteBLL = new Tipo_LenteBLL();
                Tipo_Lente Tipo_Lente = Tipo_LenteBLL.Localizar(Id);

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