public void DeleteTimeSlot(int id)
    {
        ClassTimeSlot timeSlot = ctx.ClassTimeSlots.SingleOrDefault(ts => ts.ID == id);

        ctx.ClassTimeSlots.DeleteOnSubmit(timeSlot);
        ctx.SubmitChanges();
    }
        public void DeleteTimeSlot(int id)
        {
            ClassTimeSlot timeSlot = context.ClassTimeSlots.SingleOrDefault(ts => ts.ID == id);

            context.Delete(timeSlot);
            context.SaveChanges();
        }
 public void DeleteTimeSlot(int[] id)
 {
     foreach (int timeSlotID in id)
     {
         ClassTimeSlot timeSlot = ctx.ClassTimeSlots.SingleOrDefault(ts => ts.ID == timeSlotID);
         ctx.ClassTimeSlots.DeleteOnSubmit(timeSlot);
     }
     ctx.SubmitChanges();
 }
 public void DeleteTimeSlot(int[] id)
 {
     foreach (int timeSlotID in id)
     {
         ClassTimeSlot timeSlot = context.ClassTimeSlots.SingleOrDefault(ts => ts.ID == timeSlotID);
         context.Delete(timeSlot);
     }
     context.SaveChanges();
 }
    public void AddTimeSlot(int branchID, int dayOfWeek, string time)
    {
        ClassTimeSlot timeSlot = new ClassTimeSlot();

        timeSlot.BranchID  = branchID;
        timeSlot.DayOfWeek = dayOfWeek;
        timeSlot.StartTime = time;
        ctx.ClassTimeSlots.InsertOnSubmit(timeSlot);
        ctx.SubmitChanges();
    }
        public void AddTimeSlot(int branchID, int dayOfWeek, string time)
        {
            ClassTimeSlot timeSlot = new ClassTimeSlot();

            timeSlot.BranchID  = branchID;
            timeSlot.DayOfWeek = dayOfWeek;
            timeSlot.StartTime = time;
            context.Add(timeSlot);
            context.SaveChanges();
        }
    public void UpdateTimeSlot(int id, int branchID, int dayOfWeek, string time)
    {
        ClassTimeSlot timeSlot = ctx.ClassTimeSlots.SingleOrDefault(ts => ts.ID == id);

        if (timeSlot != null)
        {
            timeSlot.BranchID  = branchID;
            timeSlot.DayOfWeek = dayOfWeek;
            timeSlot.StartTime = time;
            ctx.ClassTimeSlots.InsertOnSubmit(timeSlot);
            ctx.SubmitChanges();
        }
    }
        public void UpdateTimeSlot(int id, int branchID, int dayOfWeek, string time)
        {
            ClassTimeSlot timeSlot = context.ClassTimeSlots.SingleOrDefault(ts => ts.ID == id);

            if (timeSlot != null)
            {
                timeSlot.BranchID  = branchID;
                timeSlot.DayOfWeek = dayOfWeek;
                timeSlot.StartTime = time;
                context.Add(timeSlot);
                context.SaveChanges();
            }
        }