private void BindSurvey()
 {
     _surveys = _surveyRepository.GetByHotelId(PublicProduct.HotelId).ToList();
     if (_surveys.Any())
     {
         ReviewPanel.Visible = true;
         HotelRatingPanel.Update();
     }
     MarketRepeater.DataSource = _surveys.Take(5);
     MarketRepeater.DataBind();
 }
Beispiel #2
0
        protected void Page_Init(object sender, EventArgs e)
        {
            ProductReview = _productRepository.GetProductsByName((string)Page.RouteData.Values["hotelName"],
                                                                 (string)Page.RouteData.Values["productName"],
                                                                 (string)Session["UserSession"]);
            if (!IsPostBack && ProductReview != null)
            {
                var surveys = _surveyRepository.GetByHotelId(ProductReview.HotelId).ToList();
                MarketRepeater.DataSource = surveys;
                MarketRepeater.DataBind();
            }

            ReviewTitleLit.Text = GetReviewTitleText();
            LocationLit.Text    = string.Format("{0}, {1}", ProductReview.Hotels.Neighborhood, ProductReview.Hotels.City);
            RatingLit.Text      = ProductReview.Hotels.Rating;

            //goBack.HRef = string.Format("/{0}/{1}/{2}/{3}/{4}",
            //    Page.RouteData.Values["market"],
            //    Page.RouteData.Values["city"],
            //    Page.RouteData.Values["hotelName"],
            //    Page.RouteData.Values["productName"],
            //    ProductReview.ProductId);
        }
Beispiel #3
0
        protected void Page_Init(object sender, EventArgs e)
        {
            Account account = new Account(
                "vietluyen",
                "385557456569739",
                "Si2Q2D3dxjqgya-Rl7-lZ0cy99Q");

            Cloudinary = new Cloudinary(account);

            Session["Active"] = "Markets";
            if (!IsPostBack)
            {
                Session["UserHotel"]   = null;
                Session["CurrentPage"] = 1;

                if (Request.Params["id"] == null)
                {
                    MarketMultiView.ActiveViewIndex = 0;
                    MarketRepeater.DataSource       = _marketRepositoty.GetAll();
                    MarketRepeater.DataBind();
                }
                else
                {
                    MarketMultiView.ActiveViewIndex = 1;
                    int id = int.Parse(Request.Params["id"]);
                    if (id == 0) // Add new
                    {
                        DdlHotels.Visible            = false;
                        AddHotelMarketButton.Visible = false;
                        Deactivebutton.Visible       = false;
                        ActiveButton.Visible         = false;
                        MarketImage.Visible          = false;
                        UploadImage.Visible          = false;
                    }
                    else
                    {
                        _markets = _marketRepositoty.GetById(id);
                        if (_markets != null)
                        {
                            LocationNameText.Text  = _markets.LocationName;
                            MarketText.Text        = _markets.MarketCode;
                            PermalinkText.Text     = _markets.Permalink;
                            DdlState.SelectedValue = _markets.State;
                            LatitudeText.Text      = _markets.Latitude;
                            LongtitudeText.Text    = _markets.Longitude;
                            IsCollectTax.Checked   = _markets.IsCalculateTax;

                            if (_markets.IsActive)
                            {
                                Deactivebutton.Visible = true;
                                ActiveButton.Visible   = false;
                            }
                            else
                            {
                                Deactivebutton.Visible = false;
                                ActiveButton.Visible   = true;
                            }

                            if (!string.IsNullOrEmpty(_markets.PublicId) && !string.IsNullOrEmpty(_markets.Format))
                            {
                                var url = Cloudinary.Api.UrlImgUp.Secure()
                                          .Transform(new Transformation().Width(500).Height(500).Crop("fill"))
                                          .BuildUrl(string.Format("{0}.{1}", _markets.PublicId, _markets.Format));
                                MarketImageControl.ImageUrl = url;
                            }
                        }
                        RebindHotelsByMarket();
                    }
                }
            }
        }