Exemple #1
0
 public IActionResult UpdateAppoinmentStatus([FromBody] AppoinmentStatusRequest request)
 {
     try
     {
         _customerScheduleService.UpdateAppoinmentStatus(request, UserId);
         return(Ok(HttpStatusCode.Created));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex));
     }
 }
        public void UpdateAppoinmentStatus(AppoinmentStatusRequest request, int userId)
        {
            var schedule = _customerScheduleRepository.FirstOrDefault(x => x.Csid == request.CsId);

            if (schedule != null)
            {
                schedule.Status       = request.Status;
                schedule.ModifiedDate = DateTime.Now;
                schedule.ModifiedBy   = userId;
            }

            _customerScheduleRepository.SaveChanges();
        }