public JsonResult update(int id, BaseWebSocketChannelBlackListProfile model) { db.Entry(model).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(Json(new { id = model.Id, MessageSucess = "That Web Socket Channel Black List Profiles saved successfully." })); }
public JsonResult create(BaseWebSocketChannelBlackListProfile model) { db.BaseWebSocketChannelBlackListProfiles.Add(model); db.SaveChanges(); return(Json(new { id = model.Id, MessageSucess = "That Web Socket Channel Black List Profiles saved successfully." })); }
public JsonResult get(int id) { BaseWebSocketChannelBlackListProfile model = db.BaseWebSocketChannelBlackListProfiles.Find(id); if (model != null) { return(Json(model, JsonRequestBehavior.AllowGet)); } else { return(Json(new { Message = "This record no longer exists" }, JsonRequestBehavior.AllowGet)); } }
public ActionResult Form(int id = 0, string from = "") { ViewBag.relations = db.VWISRElations.Where(d => d.PK_Table == "BaseWebSocketChannelBlackListProfiles").ToList(); ViewBag.from = from; if (id == 0) { return(PartialView(new BaseWebSocketChannelBlackListProfile())); } else { BaseWebSocketChannelBlackListProfile model = db.BaseWebSocketChannelBlackListProfiles.Find(id); return(PartialView(model)); } }
public JsonResult Delete(int id = 0) { try { BaseWebSocketChannelBlackListProfile model = db.BaseWebSocketChannelBlackListProfiles.Find(id); if (model != null) { db.BaseWebSocketChannelBlackListProfiles.Remove(model); db.SaveChanges(); return(Json(new { id = model.Id, MessageSucess = "That Web Socket Channel Black List Profiles deleted successfully." }, JsonRequestBehavior.AllowGet)); } return(Json(new { Message = "This record no longer exists" }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { Message = Helper.ModeralException(ex).Replace("@table", "Web Socket Channel Black List Profiles") }, JsonRequestBehavior.AllowGet)); } }
public JsonResult Save(BaseWebSocketChannelBlackListProfile model, FormCollection form) { try { if (model.Id != 0) { db.Entry(model).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } else { db.BaseWebSocketChannelBlackListProfiles.Add(model); db.SaveChanges(); } return(Json(new { id = model.Id, MessageSucess = "That Web Socket Channel Black List Profiles saved successfully." })); } catch (Exception ex) { return(Json(new { Message = Helper.ModeralException(ex).Replace("@table", "Web Socket Channel Black List Profiles") })); } }