Exemplo n.º 1
0
 public static bool Eliminar(PresupuestosCategorias presupuestoCategoria)
 {
     using (var context = new Respository <PresupuestosCategorias>())
     {
         try
         {
             return(context.Eliminar(presupuestoCategoria));
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            Detalle     = new PresupuestosCategorias();
            presupuesto = new Presupuestos();

            AlertSuccessPanel.Visible = false;
            AlertInfoPanel.Visible    = false;
            AlertDangerPanel.Visible  = false;

            if (!Page.IsPostBack)
            {
                LlenarCombo();
            }
        }
Exemplo n.º 3
0
 public static bool Guardar(PresupuestosCategorias presupuestoCategoria)
 {
     using (var context = new Respository <PresupuestosCategorias>())
     {
         try
         {
             if (Buscar(p => p.Id == presupuestoCategoria.Id) == null)
             {
                 return(context.Guardar(presupuestoCategoria));
             }
             else
             {
                 return(context.Modificar(presupuestoCategoria));
             }
         }
         catch (Exception)
         {
             throw;
         }
     }
 }