public AmenitiesModel GetAmenityInfo(int AmenityID = 0)
        {
            ShomaRMEntities db    = new ShomaRMEntities();
            AmenitiesModel  model = new AmenitiesModel();

            model.ID             = 0;
            model.Amenity        = "";
            model.AmenityDetails = "";

            var AmenityInfo = db.tbl_Amenities.Where(p => p.ID == AmenityID).FirstOrDefault();

            if (AmenityInfo != null)
            {
                model.ID             = AmenityInfo.ID;
                model.Amenity        = AmenityInfo.Amenity;
                model.AmenityDetails = AmenityInfo.AmenityDetails;
            }
            return(model);
        }
        public long SaveUpdateAmenity(AmenitiesModel model)
        {
            ShomaRMEntities db            = new ShomaRMEntities();
            var             amenityExists = db.tbl_Amenities.Where(p => p.ID != model.ID && p.Amenity == model.Amenity).FirstOrDefault();

            if (amenityExists == null)
            {
                if (model.ID == 0)
                {
                    var data = new tbl_Amenities()
                    {
                        Amenity        = model.Amenity,
                        AmenityDetails = model.AmenityDetails,
                    };
                    db.tbl_Amenities.Add(data);
                    db.SaveChanges();
                    model.ID = data.ID;
                }
                else
                {
                    var AmenityInfo = db.tbl_Amenities.Where(p => p.ID == model.ID).FirstOrDefault();
                    if (AmenityInfo != null)
                    {
                        AmenityInfo.Amenity        = model.Amenity;
                        AmenityInfo.AmenityDetails = model.AmenityDetails;
                        db.SaveChanges();
                    }
                    else
                    {
                        throw new Exception(model.Amenity + " not exists in the system.");
                    }
                }
                return(model.ID);
            }
            else
            {
                throw new Exception(model.Amenity + " already exists in the system.");
            }
        }