public IActionResult SaveCalendarData(AppointmentVM appointmentVM)
        {
            CommonResponse <int> commonResponse = new CommonResponse <int>();

            try
            {
                commonResponse.Status = _aS.AddUpdate(appointmentVM).Result;
                if (commonResponse.Status == 1)
                {
                    commonResponse.Message = Helper.appointmentUpdated;
                }

                if (commonResponse.Status == 2)
                {
                    commonResponse.Message = Helper.appointmentAdded;
                }
            }
            catch (Exception e)
            {
                commonResponse.Message = e.Message;
                commonResponse.Status  = Helper.FailureCode;
            }

            return(Ok(commonResponse));
        }
Example #2
0
        public IActionResult SaveCalendarData(AppointmentsDto data)
        {
            CommonResponse <int> commonResponse = new CommonResponse <int>();

            try
            {
                commonResponse.status = _appointmentService.AddUpdate(data, loginUserId).Result;
                if (commonResponse.status < 0)
                {
                    commonResponse.message = Helper.appointmentExists;
                }
                if (commonResponse.status == 1)
                {
                    commonResponse.message = Helper.appointmentUpdated;
                }
                if (commonResponse.status == 2)
                {
                    commonResponse.message = Helper.appointmentAdded;
                }

                if (commonResponse.status > 0)
                {
                    commonResponse.status = 1;
                }
            }
            catch (Exception ex)
            {
                commonResponse.message = ex.Message;
                commonResponse.status  = Helper.failure_code;
            }

            return(Ok(commonResponse));
        }
Example #3
0
        public IActionResult SaveCalendarData(AppointmentViewModel data)
        {
            //return View();
            CommonResponse <int> commonResponse = new CommonResponse <int>();

            try
            {
                commonResponse.status = _appointmentService.AddUpdate(data).Result;
                if (commonResponse.status == 1)
                {
                    commonResponse.message = Helper.appointmentUpdated;
                }
                if (commonResponse.status == 2)
                {
                    commonResponse.message = Helper.appointmentAdded;
                }
            }
            catch (Exception e)
            {
                commonResponse.message = e.Message;
                commonResponse.status  = Helper.failure_code;
            }

            return(Ok(commonResponse));
        }
        public async Task <IActionResult> SaveCalendarData(AppointmentVM data)
        {
            CommonResponse <int> commonResponse = new CommonResponse <int>();

            try
            {
                commonResponse.status = await _appointmentService.AddUpdate(data);

                if (commonResponse.status == 1)
                {
                    commonResponse.message = Helper.appointmentUpdated;
                }
                if (commonResponse.status == 2)
                {
                    commonResponse.message = Helper.appointmentAdded;
                }
            }
            catch (Exception e)
            {
                commonResponse.message = e.Message;
                commonResponse.status  = Helper.failure_code;
            }
            return(Ok(commonResponse));
        }