예제 #1
0
        public void addAppHour(AppointmentHours add)
        {
            var hours = Context.AppointmentHours.Where(a => a.DayId == add.DayId);

            foreach (var d in hours)
            {
                if (Equals(d.Time, add.Time))
                {
                    return;
                }
            }


            add.Status = true;
            Context.AppointmentHours.Add(add);
            Context.SaveChanges();
        }
예제 #2
0
        public void addOTOAppHour(AppointmentHours add)
        {
            var hours = Context.AppointmentHours.Where(a => a.DayId == add.DayId);

            foreach (var d in hours)
            {
                if (Equals(d.Time, add.Time))
                {
                    return;
                }
            }

            string[] date =
            {
                "11.11.2018 09:00:00",
                "11.11.2018 09:30:00",
                "11.11.2018 10:00:00",
                "11.11.2018 10:30:00",
                "11.11.2018 11:00:00",
                "11.11.2018 11:30:00",
                "11.11.2018 13:00:00",
                "11.11.2018 13:30:00",
                "11.11.2018 14:00:00",
                "11.11.2018 14:30:00",
                "11.11.2018 15:00:00",
                "11.11.2018 15:30:00",
                "11.11.2018 16:00:00",
                "11.11.2018 16:30:00",
                "11.11.2018 17:00:00"
            };

            for (int i = 0; i < date.Length; i++)
            {
                add.Time   = Convert.ToDateTime(date[i]);
                add.Status = true;
                add.Id     = 0;
                Context.AppointmentHours.Add(add);

                System.Threading.Thread.Sleep(75);
                Context.SaveChanges();
            }
        }
예제 #3
0
 public IActionResult UpdateAppHour([FromBody] AppointmentHours update)
 {
     _AppSystem.updateAppHour(update);
     return(Ok(update));
 }
예제 #4
0
 public IActionResult AdotoAppHour([FromBody] AppointmentHours add)
 {
     _AppSystem.addOTOAppHour(add);
     return(Ok(add));
 }
예제 #5
0
 public void updateAppHour(AppointmentHours update)
 {
     Context.AppointmentHours.Update(update);
     Context.SaveChanges();
 }