public void Delete()
 {
     try
     {
         using (ProgramaPL pl = new ProgramaPL())
         {
             pl.SP_DELETAR_PROGRAMA(this.Instance.Codigo);
         };
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public int Insert()
 {
     ProgramaPL pl = null;
     try
     {
         pl = new ProgramaPL();
         return pl.SP_SALVAR_PROGRAMA(this.Instance);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         if (pl != null)
             GC.SuppressFinalize(pl);
     }
 }
 public List<DBLayers.DAL.Entidades.Programa> List(string NomePrograma)
 {
     ProgramaPL pl = null;
     List<DBLayers.DAL.Entidades.Programa> retorno = new List<DAL.Entidades.Programa>();
     try
     {
         pl = new ProgramaPL();
         retorno =
             pl.SP_CONSULTAR_PROGRAMA(NomePrograma);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         if (pl != null)
             pl.Dispose();
     }
     return retorno;
 }
 public void Select(int Codigo)
 {
     ProgramaPL pl = null;
     try
     {
         pl = new ProgramaPL();
         this.Instance = pl.SP_SELECIONAR_PROGRAMA(Codigo);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public DBLayers.DAL.Entidades.Programa ListProgramaEngatado()
        {
            ProgramaPL pl = null;
            DBLayers.DAL.Entidades.Programa retorno = null;
            try
            {
                pl = new ProgramaPL();

                retorno =
                    pl.SP_ABRIR_PROGRAMA_ENGATADO();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (pl != null)
                    pl.Dispose();
            }
            return retorno;
        }