Ejemplo n.º 1
0
        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." }));
        }
Ejemplo n.º 2
0
        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." }));
        }
Ejemplo n.º 3
0
        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));
            }
        }
Ejemplo n.º 4
0
 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));
     }
 }
Ejemplo n.º 5
0
        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));
            }
        }
Ejemplo n.º 6
0
 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") }));
     }
 }