/// <summary> /// Thêm video /// </summary> /// <param name="tq">Video</param> /// <returns>long</returns> public long InsertVideo(StudyOnline.Entities.Models.Video tq) { using (StudyOnline.Entities.Models.StudyOnline _db = new StudyOnline.Entities.Models.StudyOnline()) { try { _db.Video.Add(tq); _db.SaveChanges(); return(tq.ID); } catch (Exception) { return(-1); } } }
/// <summary> /// Cập nhật video /// </summary> /// <param name="v">Video</param> /// <returns>bool</returns> public bool UpdateVideo(StudyOnline.Entities.Models.Video v) { using (StudyOnline.Entities.Models.StudyOnline _db = new StudyOnline.Entities.Models.StudyOnline()) { try { var c = _db.Video.Find(v.ID); c.Name = v.Name; c.Link = v.Link; c.Length = v.Length; c.CreateDate = v.CreateDate; c.Description = v.Description; c.Status = v.Status; c.LessonID = v.LessonID; _db.SaveChanges(); return(true); } catch (Exception) { return(false); } } }
public bool UpdateVideo(StudyOnline.Entities.Models.Video v) { return(videoRepository.UpdateVideo(v)); }
public long InsertVideo(StudyOnline.Entities.Models.Video tq) { return(videoRepository.InsertVideo(tq)); }