public JsonResult update(int id, BaseWebSocketChannelBlackListUser 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 Users saved successfully." })); }
public JsonResult create(BaseWebSocketChannelBlackListUser model) { db.BaseWebSocketChannelBlackListUsers.Add(model); db.SaveChanges(); return(Json(new { id = model.Id, MessageSucess = "That Web Socket Channel Black List Users saved successfully." })); }
public JsonResult get(int id) { BaseWebSocketChannelBlackListUser model = db.BaseWebSocketChannelBlackListUsers.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 == "BaseWebSocketChannelBlackListUsers").ToList(); ViewBag.from = from; if (id == 0) { return(PartialView(new BaseWebSocketChannelBlackListUser())); } else { BaseWebSocketChannelBlackListUser model = db.BaseWebSocketChannelBlackListUsers.Find(id); return(PartialView(model)); } }
public JsonResult Delete(int id = 0) { try { BaseWebSocketChannelBlackListUser model = db.BaseWebSocketChannelBlackListUsers.Find(id); if (model != null) { db.BaseWebSocketChannelBlackListUsers.Remove(model); db.SaveChanges(); return(Json(new { id = model.Id, MessageSucess = "That Web Socket Channel Black List Users 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 Users") }, JsonRequestBehavior.AllowGet)); } }
public JsonResult Save(BaseWebSocketChannelBlackListUser model, FormCollection form) { try { if (model.Id != 0) { db.Entry(model).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } else { db.BaseWebSocketChannelBlackListUsers.Add(model); db.SaveChanges(); } return(Json(new { id = model.Id, MessageSucess = "That Web Socket Channel Black List Users saved successfully." })); } catch (Exception ex) { return(Json(new { Message = Helper.ModeralException(ex).Replace("@table", "Web Socket Channel Black List Users") })); } }