예제 #1
0
        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);
     }
 }
예제 #3
0
        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);
            }
        }
예제 #5
0
 public bool UpdateSheduleInfo(GroupShedules shedule)
 => Db.UpdateSheduleInfo(shedule);
예제 #6
0
 public GroupShedules AddShedule(GroupShedules shedule)
 => Db.AddShedule(shedule);