public override bool AddWeeklySchedule(DateTime dt, string sc, int weekSpan) { using (var db = new ScheduleContext()) { WeeklySchedule weeklySchedule = new WeeklySchedule(QQ, 0, dt, sc, weekSpan); db.WeeklySchedules.Add(weeklySchedule); db.SaveChanges(); return(true); } }
public override Boolean AddWeeklySchedule(DateTime dt, string sc, int weekSpan) { if (!IfPowerful()) { return(false); } using (var db = new ScheduleContext()) { WeeklySchedule weeklySchedule = new WeeklySchedule(GroupQQ, 1, dt, sc, weekSpan); db.WeeklySchedules.Add(weeklySchedule); db.SaveChanges(); return(true); } }