Example #1
0
 public ActionResult Add(HttpNotifyAddUpdate model)
 {
     try
     {
         var httpMessage = HttpMessageBLL.GetByID(model.HttpMessageID);
         var entity      = model.ToEntity(null);
         entity.AppID   = httpMessage.AppID;
         entity.Method  = httpMessage.Method;
         entity.Version = httpMessage.Version;
         new HttpNotifyRep().Add(entity);
         return(Json(new { err = "", result = true }));
     }
     catch (Exception ex)
     {
         return(Json(new { err = ex.Message, result = false }));
     }
 }
Example #2
0
 public ActionResult Update(HttpNotifyAddUpdate model)
 {
     try
     {
         var entity = new HttpNotifyRep().GetByID(model.ID);
         if (model.Names == null || model.Names.Length == 0)
         {
             new HttpNotifyRep().Delete(entity);
         }
         else
         {
             entity = model.ToEntity(entity);
             new HttpNotifyRep().Update(entity);
         }
         return(Json(new { err = "", result = true }));
     }
     catch (Exception ex)
     {
         return(Json(new { err = ex.Message, result = false }));
     }
 }