コード例 #1
0
ファイル: admPerfil.aspx.cs プロジェクト: eldersontc/xyzsge
 public static object Agregar(Sesion sesion, Perfil perfil)
 {
     object resultado = new { };
     try
     {
         blPerfil blPerfil = new blPerfil(sesion);
         blPerfil.Agregar(perfil);
         resultado = new { correcto = true };
     }
     catch (Exception)
     {
         resultado = new { correcto = false };
     }
     return resultado;
 }
コード例 #2
0
ファイル: blPerfil.cs プロジェクト: eldersontc/xyzsge
 public bool Agregar(Perfil perfil)
 {
     try
     {
         daPerfil = new daPerfil();
         daPerfil.IniciarTransaccion();
         daPerfil.Agregar(perfil);
         daPerfil.ConfirmarTransaccion();
     }
     catch (Exception)
     {
         daPerfil.AbortarTransaccion();
         throw;
     }
     finally
     {
         daPerfil.CerrarSesion();
     }
     return true;
 }
コード例 #3
0
ファイル: blPerfil.cs プロジェクト: eldersontc/xyzsge
 public bool Actualizar(Perfil perfil)
 {
     try
     {
         daPerfil = new daPerfil();
         daPerfil.IniciarTransaccion();
         Perfil perfil_ = daPerfil.ObtenerPorId(perfil.idPerfil);
         perfil_.nombre = perfil.nombre;
         perfil_.activo = perfil.activo;
         daPerfil.ConfirmarTransaccion();
     }
     catch (Exception)
     {
         daPerfil.AbortarTransaccion();
         throw;
     }
     finally
     {
         daPerfil.CerrarSesion();
     }
     return true;
 }