public HttpResponseMessage Post([FromBody] JObject appointment_service_details)
        {
            try
            {
                // Check if a session already exists or if it's expired
                //if (HttpContext.Current.Session["Token"] == null)
                //    return Request.CreateResponse(HttpStatusCode.Unauthorized, new { Success = false, Message = "Session expired! Unable to authenticate user." });

                int appointment_id = int.Parse(appointment_service_details["appointment_id"].ToString());
                int service_id     = int.Parse(appointment_service_details["service_id"].ToString());

                using (SalonDbEntities entities = new SalonDbEntities())
                {
                    // Validate appointment - check if the appointment service already exists
                    if (entities.tblservice_booked.Any(e => e.appointment_id == appointment_id && e.service_id == service_id))
                    {
                        return(Messages.GetInstance().HandleRequest("Appointment Service", ActionType.INSERT, true));
                    }
                    else
                    {
                        using (var transaction = entities.Database.BeginTransaction())
                        {
                            tblservice_booked obj = new tblservice_booked
                            {
                                appointment_id = appointment_id,
                                service_id     = service_id
                            };
                            entities.tblservice_booked.Add(obj);
                            entities.SaveChanges();

                            Utilities.getInstance().UpdateChanges(entities, transaction, obj.id.ToString(), typeof(tblservice_booked).Name, ActionType.INSERT);

                            return(Messages.GetInstance().HandleRequest("Appointment Service", ActionType.INSERT));
                        }
                    }
                }
            }
            catch (Exception)
            {
                return(Messages.GetInstance().HandleException("An error occured! Failed to create appointment service."));
            }
        }
        public HttpResponseMessage GetSelectedAppointmentService(int appointment_service_id)
        {
            try
            {
                // Check if a session already exists or if it's expired
                //if (HttpContext.Current.Session["Token"] == null)
                //    return Request.CreateResponse(HttpStatusCode.Unauthorized, new { Success = false, Message = "Session expired! Unable to authenticate user." });


                using (SalonDbEntities entities = new SalonDbEntities())
                {
                    tblservice_booked selectedAppointment = entities.tblservice_booked.FirstOrDefault(e => e.id == appointment_service_id);
                    if (selectedAppointment != null)
                    {
                        return(Request.CreateResponse(HttpStatusCode.OK, new
                        {
                            Success = true,
                            Message = "Appointment service details retrieved successfully!",
                            Appointment_service_details = new
                            {
                                selectedAppointment.id,
                                selectedAppointment.appointment_id,
                                selectedAppointment.service_id,
                                service_name = entities.tblservices.Where(x => x.service_id == selectedAppointment.service_id).Select(x => x.service_name).First()
                            }
                        }));
                    }

                    else
                    {
                        return(Messages.GetInstance().HandleException("Retrieve failed! Appointment service with id = ", appointment_service_id.ToString()));
                    }
                }
            }
            catch (Exception)
            {
                return(Messages.GetInstance().HandleException("An error occured! Failed to retrieve appointment service details."));
            }
        }