Exemplo n.º 1
0
        public IActionResult SaveCalendarData([FromBody] AppointmentViewModel data)
        {
            CommonResponse <int> commonResponse = new CommonResponse <int>();

            try
            {
                commonResponse.status = _service.AddOrUpdateAppointment(data).Result;
                if (commonResponse.status == 1)
                {
                    commonResponse.message = Helpers.Helper.appointmentUpdated;
                }
                if (commonResponse.status == 2)
                {
                    commonResponse.message = Helpers.Helper.appointmentAdded;
                }
            }
            catch (Exception e)
            {
                commonResponse.message = e.Message;
                commonResponse.status  = Helpers.Helper.failure_code;
            }
            return(Ok(commonResponse));
        }