Пример #1
0
        public void changeClass_LogStatus(int userId, int scheduleId, string attendance)
        {
            Class_Log cl = myDb.Class_Log.Where(x => x.U_Id == userId && x.Schedule_Id == scheduleId).SingleOrDefault();

            cl.Log_Status = attendance;
            myDb.SaveChanges();
        }
Пример #2
0
        public void CreateClass_Log(int sId, int userId)
        {
            Class_Log newClassLog = new Class_Log();

            newClassLog.Schedule_Id = sId;
            newClassLog.U_Id        = userId;
            newClassLog.Log_Status  = "MISSED";

            myDb.Class_Log.Add(newClassLog);
            myDb.SaveChanges();
        }
Пример #3
0
        public void RestoreScheduleRemoveUsers(int id)
        {
            Schedule         schedule = myDb.Schedules.Where(x => x.Schedule_Id == id).Single();
            List <Yoga_User> list     = getScheduleSignUpList(id);

            foreach (Yoga_User u in list)
            {
                Class_Log cl = GetClass_LogsByUidAndSid(u.U_Id, id);
                myDb.Class_Log.Remove(cl);
            }
            myDb.SaveChanges();
        }
Пример #4
0
        public void CancelledScheduleRefund(int id)
        {
            Schedule         schedule = myDb.Schedules.Where(x => x.Schedule_Id == id).Single();
            List <Yoga_User> list     = getScheduleSignUpList(id);

            foreach (Yoga_User u in list)
            {
                u.U_Tokens++;
                Class_Log cl = GetClass_LogsByUidAndSid(u.U_Id, id);
                cl.Log_Status = "CANCELLED";
            }

            myDb.SaveChanges();
        }
Пример #5
0
        public Class_Log GetClass_LogsByUidAndSid(int uid, int sid)
        {
            Class_Log cl = myDb.Class_Log.Where(x => x.U_Id == uid && x.Schedule_Id == sid).FirstOrDefault();

            return(cl);
        }