public JsonResult UpdateSheduleInfo([FromBody] GroupShedules data) { var answer = new ApiAnswer <bool>(); answer.Data = University.UpdateSheduleInfo(data); return(new JsonResult(answer)); }
public GroupShedules AddShedule(GroupShedules shedule) { using (var db = CreateDbContext()) { db.GroupShedules.Add(shedule); db.SaveChanges(); return(shedule); } }
public bool UpdateSheduleInfo(GroupShedules shedule) { if (!Db.GroupControllCheck(User.Id, shedule.GroupId, shedule.LessonId)) { return(false); } return(Db.UpdateSheduleInfo(shedule)); }
public bool UpdateSheduleInfo(GroupShedules shedule) { using (var db = CreateDbContext()) { var copy = db.GroupShedules.FirstOrDefault(x => x.Id == shedule.Id); if (copy == null) { return(false); } copy.Canceled = shedule.Canceled; copy.Textbook = shedule.Textbook; copy.TextbookLink = shedule.TextbookLink; copy.Topic = shedule.Topic; copy.Homework = shedule.Homework; db.SaveChanges(); return(true); } }
public bool UpdateSheduleInfo(GroupShedules shedule) => Db.UpdateSheduleInfo(shedule);
public GroupShedules AddShedule(GroupShedules shedule) => Db.AddShedule(shedule);