public ResponseItem Put(yy_Keywords value) { var _Entity = DB.yy_Keywords.Find(value.ID); if (_Entity != null) { _Entity.Title = value.Title; _Entity.ShowIndex = value.ShowIndex; _Entity.ApplyType = value.ApplyType; _Entity.CreateDate = value.CreateDate; _Entity.IsShow = value.IsShow; _Entity.ReplaceContent = value.ReplaceContent; _Entity.ReplaceCount = value.ReplaceCount; _Entity.TypeIDs = value.TypeIDs; DB.SaveChanges(); return new ResponseItem(0, ""); } return new ResponseItem(2, "不存在的关键字。"); }
public ResponseItem ShowHide(yy_Keywords value) { var _News = DB.yy_Keywords.Find(value.ID); if (_News != null) { _News.IsShow = value.IsShow; DB.SaveChanges(); return new ResponseItem(0, ""); } return new ResponseItem(2, "不存在的关键字。"); }
public ResponseItem Post(yy_Keywords value) { try { DB.yy_Keywords.Add(value); DB.SaveChanges(); return new ResponseItem(0, "添加关键字成功。"); } catch (Exception ex) { return new ResponseItem(2, ex.Message); } }