public JsonResult Action(AccommodationPackageModel model)
        {
            var            result         = false;
            JsonResult     json           = new JsonResult();
            SharedServices sharedServices = new SharedServices();


            List <int> pictureIDs = !string.IsNullOrEmpty(model.PictureIDs)? model.PictureIDs.Split(',').Select(x => int.Parse(x)).ToList():new List <int>();
            var        pictures   = sharedServices.GetPictureByID(pictureIDs);

            if (model.ID > 0)//for Edit
            {
                var accommodationPackage = AccommodationPackagesServices.Instance.GetAccommodationPackageByID(model.ID);
                accommodationPackage.AccommodationTypeID = model.AccommodationTypeID;
                accommodationPackage.Name        = model.Name;
                accommodationPackage.FeePerNight = model.FeePerNight;
                accommodationPackage.NoOfRoom    = model.NoOfRoom;

                accommodationPackage.AccommodationPackagePictures.Clear();
                accommodationPackage.AccommodationPackagePictures.AddRange(pictures.Select(x => new AccommodationPackagePicture()
                {
                    AccommodationPackageID = model.ID, PictureID = x.ID
                }));

                result = AccommodationPackagesServices.Instance.UpdateAccommodationPackage(accommodationPackage);
            }
            else//for create
            {
                AccommodationPackage accommodationPackage = new AccommodationPackage();

                accommodationPackage.AccommodationTypeID = model.AccommodationTypeID;
                accommodationPackage.Name        = model.Name;
                accommodationPackage.FeePerNight = model.FeePerNight;
                accommodationPackage.NoOfRoom    = model.NoOfRoom;
                accommodationPackage.AccommodationPackagePictures = new List <AccommodationPackagePicture>();
                accommodationPackage.AccommodationPackagePictures.AddRange(pictures.Select(x => new AccommodationPackagePicture()
                {
                    PictureID = x.ID
                }));

                result = AccommodationPackagesServices.Instance.SaveAccommodationPackage(accommodationPackage);
            }

            if (result)
            {
                json.Data = new { Success = true };
            }
            else
            {
                json.Data = new { success = false, Message = "Unable to add Accommodationtype" };
            }
            return(json);
        }