Exemple #1
0
 public ActionResult Add(MenusModel model)
 {
     model.sesion = SessionDB.start(Request, Response, false, model.db);
     try
     {
         if (model.Add())
         {
             return(Json(new { msg = Notification.Succes("Ficha agregada con exito: " + model.Nombre) }));
         }
         else
         {
             return(Json(new { msg = Notification.Error(" Erro al agregar: " + model.Nombre) }));
         }
     }
     catch (Exception e)
     {
         return(Json(new { msg = Factory.Notification.Error(e.Message) }));
     }
 }
Exemple #2
0
 public ActionResult Add(MenusModel model)
 {
     model.sesion = SessionDB.start(Request, Response, false, model.db, SESSION_BEHAVIOR.AJAX);
     if (model.sesion == null)
     {
         return(Content(string.Empty));
     }
     try
     {
         if (model.Add())
         {
             return(Json(new { msg = Notification.Succes("Menu agregado con exito: " + model.Nombre) }));
         }
         else
         {
             return(Json(new { msg = Notification.Error("Error al agregar: " + model.Nombre) }));
         }
     }
     catch (Exception e)
     {
         return(Json(new { msg = Factory.Notification.Error(e.Message) }));
     }
 }