Esempio n. 1
0
        public ActionResult ModifyRoomAmenities(etblPropertyRoomTypeRoomAmentiesMap obj)
        {
            object result = null;

            try
            {
                if (ModelState.IsValid)
                {
                    try
                    {
                        obj.dtActionDate = DateTime.Now;
                        //get all basic rooms amenities comma seperated
                        if (obj.SelectedBasicRoomAmenities != null)
                        {
                            obj.sBasicRoomAmenities = obj.SelectedBasicRoomAmenities.Select(i => i.ToString(CultureInfo.InvariantCulture)).Aggregate((s1, s2) => s1 + "," + s2);
                        }
                        //get all Additional amenities comma seperated
                        if (obj.SelectedAdditionalAmenities != null)
                        {
                            obj.sAdditionalRoomAmenities = obj.SelectedAdditionalAmenities.Select(i => i.ToString(CultureInfo.InvariantCulture)).Aggregate((s1, s2) => s1 + "," + s2);
                        }
                        //get all bathroom amenities comma seperated
                        if (obj.SelectedBathroomAmenities != null)
                        {
                            obj.sBathRoomAmenities = obj.SelectedBathroomAmenities.Select(i => i.ToString(CultureInfo.InvariantCulture)).Aggregate((s1, s2) => s1 + "," + s2);
                        }
                        //get all Bedding and Linens comma seperated
                        if (obj.SelectedBeddingandLinens != null)
                        {
                            obj.sBeddingRoomAmenities = obj.SelectedBeddingandLinens.Select(i => i.ToString(CultureInfo.InvariantCulture)).Aggregate((s1, s2) => s1 + "," + s2);
                        }

                        int j = BL_tblPropertyRoomTypeRoomAmentiesMap.UpdateRecord(obj);
                        if (j == 1)
                        {
                            result = new { st = 1, msg = "Room Amenities Modified Successfully." };
                        }
                        else
                        {
                            result = new { st = 0, msg = "Kindly try after some time." };
                        }
                    }
                    catch (Exception)
                    {
                        throw;
                    }
                }
            }
            catch (Exception)
            {
                result = new { st = 0, msg = "Kindly try after some time." };
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public ActionResult RoomAmenties(string id, string name)
        {
            try
            {
                objRoomType = BL_tblPropertyRoomTypeRoomAmentiesMap.GetSingleRecordById(Convert.ToInt32(id));

                //get master commaon Amenities Data
                objnew = BL_tblPropertyRoomAmentiesMap.GetSingleRecordById(Convert.ToInt32(Session["PropId"]));

                //--Get Ids that would be disabled---------------------
                if (objnew.sBasicRoomAmenities != null)
                {
                    objRoomType.DisabledBasicRoomAmenities = objnew.sBasicRoomAmenities.Trim().Split(',');
                }
                if (objnew.sAdditionalRoomAmenities != null)
                {
                    objRoomType.DisabledAdditionalAmenities = objnew.sAdditionalRoomAmenities.Trim().Split(',');
                }
                if (objnew.sBathRoomAmenities != null)
                {
                    objRoomType.DisabledBathroomAmenities = objnew.sBathRoomAmenities.Trim().Split(',');
                }
                if (objnew.sBeddingRoomAmenities != null)
                {
                    objRoomType.DisabledBeddingandLinens = objnew.sBeddingRoomAmenities.Trim().Split(',');
                }
                //-----------------------------------------------

                objRoomType.RoomAnenitiesRadio        = BL_tblHotelRoomAmenityM.GetHotelRoomAmenityRadio();
                objRoomType.iPropId                   = Convert.ToInt32(Session["PropId"]);
                objRoomType.iRoomId                   = Convert.ToInt32(id);
                objRoomType.BasicRoomAmenitiesItems   = BL_tblHotelRoomAmenityM.GetHotelRoomAmenityCheckBox(objRoomType.sBasicRoomAmenities, objnew.sBasicRoomAmenities);
                objRoomType.AdditionalAmenitiesItems  = BL_tblHotelRoomAmenityAdditionalM.GetHotelRoomAmenityAdditional(objRoomType.sAdditionalRoomAmenities, objnew.sAdditionalRoomAmenities);
                objRoomType.BathroomAmenitiesItems    = BL_tblHotelRoomAmenityBathRoomM.GetHotelRoomAmenityBathRoom(objRoomType.sBathRoomAmenities, objnew.sBathRoomAmenities);
                objRoomType.BeddingandLinensItems     = BL_tblHotelRoomAmenityBeddingM.GetHotelRoomAmenityBedding(objRoomType.sBeddingRoomAmenities, objnew.sBeddingRoomAmenities);
                objRoomType.iCommonBasicAmenitieRadio = objnew.iBasicAmentiesRadio;
                objRoomType.sRoomName                 = name;
            }
            catch (Exception)
            {
            }
            return(View("Amenities", objRoomType));
        }