public ActionResult Index(Guid id) { var httpMessage = HttpMessageBLL.GetByID(id); var httpNotify = new HttpNotifyRep().GetHttpNotify(httpMessage.AppID, httpMessage.Method); if (httpNotify != null) { return(RedirectToAction("Update", new { id = httpNotify.ID })); } else { return(RedirectToAction("Add", new { id = httpMessage.ID })); } }
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 })); } }
public static HttpMessage GetHttpMessage(int appID, string method, HttpTag httpTag) { var httpMessage = HttpMessageBLL.GetByAppIDAndMethod(appID, method, httpTag.Version); return(httpMessage); }