Exemplo n.º 1
0
        public dynamic DeleteBookmark(JObject Id)
        {
            JsonModels.DelBookMarkObj DelObj = Id.ToObject<JsonModels.DelBookMarkObj>();
            MvcWithNGContext NgContext = new MvcWithNGContext();
            int Did = Convert.ToInt32(DelObj.Id);
            Bookmark DelBM = NgContext.Bookmarks.Where(t => t.Id == Did).Single();
            DelBM.Active = false;
            NgContext.SaveChanges();

            JsonModels.ObjWithMsg ObjWMsg = new JsonModels.ObjWithMsg()
            {
                DataObj = NgContext.vBookmarks.Where(t => t.Active == true).ToList(),
                Msg = "Success"
            };

            return ObjWMsg;
        }
Exemplo n.º 2
0
 public dynamic PutBookmark(JObject Json)
 {
     MvcWithNGContext NgContext = new MvcWithNGContext();
     JsonModels.BookMarkObj BookObj = Json.ToObject<JsonModels.BookMarkObj>();
     int BmId = Convert.ToInt32(BookObj.Id);
     Bookmark UpdBM = NgContext.Bookmarks.Where(u => u.Id == BmId).SingleOrDefault();
     UpdBM.Title = BookObj.Title;
     UpdBM.Tags = BookObj.Tags;
     UpdBM.Url = BookObj.Url;
     NgContext.SaveChanges();
     string StatusMsg = "Success";
     JsonModels.ObjWithMsg Obj = new JsonModels.ObjWithMsg()
     {
         DataObj = GetBookmarks(),
         Msg = StatusMsg
     };
     return Obj;
 }