예제 #1
0
        public ResponseItem Put(yy_Video value)
        {
            var _Entity = DB.yy_Video.Find(value.ID);
            if (_Entity != null)
            {
                _Entity.IsShow = value.IsShow;
                _Entity.ShowIndex = value.ShowIndex;
                _Entity.Title = value.Title;
                _Entity.KeyWords = value.KeyWords;
                _Entity.Summary = value.Summary;
                _Entity.TypeIDs = value.TypeIDs;
                _Entity.TargetPlatforms = value.TargetPlatforms;
                _Entity.CanReply = value.CanReply;
                _Entity.CreateDate = value.CreateDate;
                DB.SaveChanges();

                return new ResponseItem(0, "");
            }

            return new ResponseItem(2, "不存在的视频。");
        }
예제 #2
0
        public ResponseItem ShowHide(yy_Video value)
        {
            var _News = DB.yy_Video.Find(value.ID);
            if (_News != null)
            {
                _News.IsShow = value.IsShow;
                DB.SaveChanges();

                return new ResponseItem(0, "");
            }

            return new ResponseItem(2, "不存在的视频。");
        }
예제 #3
0
 public ResponseItem Post(yy_Video value)
 {
     try
     {
         DB.yy_Video.Add(value);
         DB.SaveChanges();
         return new ResponseItem(0, "添加视频成功。");
     }
     catch (Exception ex)
     {
         return new ResponseItem(2, ex.Message);
     }
 }