private void LoadLoginControl()
        {
            AuthControl control = new AuthControl();
            var         type    = App.CurrentSocialType;

            control.SetData(type, Constants.GetClient(type));
            control.action += (p) =>
            {
                if (App.IsLoginGoBack)
                {
                    Deployment.Current.Dispatcher.BeginInvoke(delegate
                    {
                        if (NavigationService.CanGoBack)
                        {
                            NavigationService.GoBack();
                        }
                    });
                }
                else
                {
                    _isClearBackStack = true;
                    Deployment.Current.Dispatcher.BeginInvoke(delegate
                    {
                        NavigationService.Navigate(new Uri("/SocialSendPage.xaml", UriKind.Relative));
                    });
                }
            };
            this.LayoutRoot.Children.Add(control);
        }
        protected void Page_Init(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var multiView = (MultiView)AuthControl.FindControl("AuthMultiView");
                if (Request.Params["sp"] != null &&
                    (Session["UserSession"] == null || (Session["UserSession"] != null && string.Equals(Request.Params["sp"], (string)Session["UserSession"], StringComparison.OrdinalIgnoreCase))) &&
                    multiView != null)
                {
                    ShowAuth = true;
                    multiView.ActiveViewIndex = 3;
                }

                if (Request.Params["reg"] != null &&
                    string.Equals(Request.Params["reg"], "true", StringComparison.OrdinalIgnoreCase) &&
                    Session["UserSession"] == null &&
                    multiView != null)
                {
                    multiView.ActiveViewIndex = 0;
                    ShowAuth = true;
                }
            }

            if (PublicCustomerInfos != null)
            {
                PublicCustomerCredits = _customerCreditRepository.GetById(PublicCustomerInfos.CustomerId);
            }
        }
Esempio n. 3
0
        private List <BaseControl> listLayer = new List <BaseControl>();          //创建图层集合
        public void AddContent()
        {
            this.MapGrid.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            this.MapGrid.VerticalAlignment   = System.Windows.VerticalAlignment.Top;
            this.MapGrid.Children.Add(mBackground);
            listLayer.Add(mBackground);                                          //保存到图层中,便于管理

            this.MapGrid.Children.Add(mRainpipe);                                //添加雨水管道图层
            listLayer.Add(mRainpipe);


            this.MapGrid.Children.Add(mWastepipe);                              //添加污水管道图层
            listLayer.Add(mWastepipe);


            this.MapGrid.Children.Add(mRainjunc);                               //添加雨水检查井图层
            listLayer.Add(mRainjunc);


            this.MapGrid.Children.Add(mWastejunc);
            listLayer.Add(mWastejunc);

            //check authority
            EnableButton(AuthControl.getInstance().getAuth() == AuthControl.AUTH_ROOT);
        }
Esempio n. 4
0
 private void textLoaded(object sender, RoutedEventArgs e)
 {
     TextState.Text = "丽水城南水阁区块排水管网健康查询系统      当前用户:" + AuthControl.getInstance().UserName
                      + "         " + AuthControl.getInstance().getLoginTime();
     TextState.TextAlignment = TextAlignment.Center;
     //AddContent();
 }
Esempio n. 5
0
        public JuncWindow(int id)
        {
            InitializeComponent();
            this.Junc_Name.Text = "\t" + id + " 检查井信息";
            mBasic = new BaseContent(id);
            this.Stackpanel1.Children.Add(mBasic);

            //check authority
            bool b = AuthControl.AUTH_ROOT == AuthControl.getInstance().getAuth();

            Button_Cancle.IsEnabled = b;
            Button_Save.IsEnabled   = b;

            AnimationUtil.ScaleEasingAnimation(this);
        }
Esempio n. 6
0
        private void LoadLoginControl()
        {
            AuthControl control = new AuthControl();
            var         type    = SocialUtils.CurrentSocialType;

            control.SetData(type, SocialUtils.GetClient(type));
            control.action += (p) =>
            {
                Deployment.Current.Dispatcher.BeginInvoke(delegate
                {
                    if (NavigationService.CanGoBack)
                    {
                        NavigationService.GoBack();
                    }
                });
            };
            this.LayoutRoot.Children.Add(control);
        }
Esempio n. 7
0
        private void CheckShowAuth()
        {
            var multiView = (MultiView)AuthControl.FindControl("AuthMultiView");

            if (Request.Params["sp"] != null &&
                (Session["UserSession"] == null || (Session["UserSession"] != null && string.Equals(Request.Params["sp"], (string)Session["UserSession"], StringComparison.OrdinalIgnoreCase))) &&
                multiView != null)
            {
                ShowAuth = true;
                multiView.ActiveViewIndex = 3;
            }
            if (Request.Params["reg"] != null &&
                string.Equals(Request.Params["reg"], "true", StringComparison.OrdinalIgnoreCase) &&
                Session["UserSession"] == null && multiView != null)
            {
                multiView.ActiveViewIndex = 0;
                ShowAuth = true;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            var multiView = (MultiView)AuthControl.FindControl("AuthMultiView");

            if (Request.Params["sp"] != null &&
                (Session["UserSession"] == null || (Session["UserSession"] != null && string.Equals(Request.Params["sp"], (string)Session["UserSession"], StringComparison.OrdinalIgnoreCase))) &&
                multiView != null)
            {
                ShowAuth = true;
                multiView.ActiveViewIndex = 3;
            }

            if (Request.Params["reg"] != null &&
                string.Equals(Request.Params["reg"], "true", StringComparison.OrdinalIgnoreCase) &&
                Session["UserSession"] == null && multiView != null)
            {
                multiView.ActiveViewIndex = 0;
                ShowAuth = true;
            }
        }
        protected void Page_Init(object sender, EventArgs e)
        {
            if (Page.RouteData.Values["SubscriptionId"] != null)
            {
                int id;
                int.TryParse((string)Page.RouteData.Values["SubscriptionId"], out id);
                PublicSubscription = _subscriptionRepository.GetById(id);
            }

            //goBack.HRef = AppConfiguration.LandingPageSubscription;

            if (!IsPostBack)
            {
                hotelname.Text    = PublicSubscription.Name;
                Neighborhood.Text = PublicSubscription.ProductHighlight;

                var multiView = (MultiView)AuthControl.FindControl("AuthMultiView");
                if (Request.Params["sp"] != null &&
                    (Session["UserSession"] == null || (Session["UserSession"] != null && string.Equals(Request.Params["sp"], (string)Session["UserSession"], StringComparison.OrdinalIgnoreCase))) &&
                    multiView != null)
                {
                    ShowAuth = true;
                    multiView.ActiveViewIndex = 3;
                }

                if (Request.Params["reg"] != null &&
                    string.Equals(Request.Params["reg"], "true", StringComparison.OrdinalIgnoreCase) &&
                    Session["UserSession"] == null &&
                    multiView != null)
                {
                    multiView.ActiveViewIndex = 0;
                    ShowAuth = true;
                }
            }

            if (PublicCustomerInfos != null)
            {
                PublicCustomerCredits = _customerCreditRepository.GetById(PublicCustomerInfos.CustomerId);
            }
        }
        protected void Page_Init(object sender, EventArgs e)
        {
            if (Master == null)
            {
                throw new HttpException(404, ErrorMessage.MasterNotFound);
            }
            HtmlGenericControl body = (HtmlGenericControl)Master.FindControl("body");

            body.Attributes["class"] += " product-page";

            // Search Production with same reason
            var markets = _productRepository.MarketList.FirstOrDefault(m => m.Permalink == (string)Page.RouteData.Values["market"] && m.IsActive) ??
                          _productRepository.MarketList.First(m => m.IsDefault);
            int totalGuest = 2;

            if (Session["Guest"] != null)
            {
                int.TryParse(Session["Guest"].ToString(), out totalGuest);
            }

            DateTime selectedDate = DateTime.UtcNow.ToLosAngerlesTimeWithTimeZone(PublicHotel != null ? PublicHotel.TimeZoneId : string.Empty);

            if (Session["CheckInDateSearch"] != null)
            {
                DateTime.TryParseExact((string)Session["CheckInDateSearch"], "MM/dd/yyyy", null,
                                       DateTimeStyles.None, out selectedDate);
            }

            _searchParams = new SearchParams
            {
                CustomerId    = PublicCustomerInfos != null ? PublicCustomerInfos.CustomerId : 0,
                SearchMarkets = markets,
                ProductType   = new List <Enums.ProductType> {
                    Enums.ProductType.DayPass
                },
                AvailableTickets = totalGuest,
                StartDate        = selectedDate
            };

            if (Page.RouteData.Values["hotelName"] != null)
            {
                if (Page.RouteData.Values["id"] != null)
                {
                    if (int.TryParse(Page.RouteData.Values["id"].ToString(), out _productId))
                    {
                        PublicProduct = _productRepository.GetById(_productId, _searchParams);
                    }
                }

                if (PublicProduct == null)
                {
                    PublicProduct = _productRepository.GetProductsByName((string)Page.RouteData.Values["hotelName"],
                                                                         (string)Page.RouteData.Values["productName"],
                                                                         (string)Session["UserSession"]);

                    if (IsPostBack && PublicProduct != null && PublicProduct.Similarproduct == null)
                    {
                        PublicProduct = _productRepository.GetById(PublicProduct.ProductId, _searchParams);
                        HotelRatingPanel.Update();
                    }
                }

                if (!IsPostBack)
                {
                    // Maintain old Url of Survey
                    if (PublicProduct == null && Page.RouteData.Values["id"] != null && _productId <= 0)
                    {
                        var reviews = _surveyRepository.GetSurveysByCode(Page.RouteData.Values["id"].ToString());
                        if (reviews != null)
                        {
                            var bookings = _surveyRepository.BookingList
                                           .FirstOrDefault(b => b.BookingId == reviews.BookingId);
                            if (bookings != null)
                            {
                                PublicProduct = _productRepository.GetById(bookings.ProductId);
                                var newProductUrl = string.Format("/{0}/{1}/{2}/{3}/{4}",
                                                                  Page.RouteData.Values["market"],
                                                                  PublicProduct.Hotels.CityUrl,
                                                                  PublicProduct.Hotels.HotelNameUrl,
                                                                  PublicProduct.ProductNameUrl,
                                                                  reviews.Code);
                                Response.Redirect(Helper.ResolveRelativeToAbsoluteUrl(Request.Url, newProductUrl), true);
                            }
                        }
                    }

                    // Maintain old Url of Product
                    if (PublicProduct == null && Page.RouteData.Values["id"] == null)
                    {
                        PublicProduct = _productRepository.GetProductByHotelName((string)Page.RouteData.Values["hotelName"]);
                        var newProductUrl = string.Format("/{0}/{1}/{2}/{3}/{4}",
                                                          Page.RouteData.Values["market"],
                                                          PublicProduct.Hotels.CityUrl,
                                                          PublicProduct.Hotels.HotelNameUrl,
                                                          PublicProduct.ProductNameUrl,
                                                          PublicProduct.ProductId);
                        Response.Redirect(Helper.ResolveRelativeToAbsoluteUrl(Request.Url, newProductUrl), true);
                    }

                    PublicHotel = _productRepository.HotelList.First(h => h.HotelId == PublicProduct.HotelId);

                    // Do not have permission to view this page
                    if (PublicHotel != null &&
                        !PublicHotel.IsPublished &&
                        (PublicCustomerInfos == null || !PublicCustomerInfos.IsAdmin))
                    {
                        Response.Redirect(Constant.SearchPageDefault);
                    }

                    if (Session["CheckInDateSearch"] == null && PublicProduct != null && PublicProduct.ProductType == (int)Enums.ProductType.AddOns)
                    {
                        var productHaveBooking = (from p in _productRepository.ProductList
                                                  join ap in _productRepository.ProductAddOnList on p.ProductId equals ap.AddOnId
                                                  where ap.AddOnId == PublicProduct.ProductId
                                                  select ap.ProductId).FirstOrDefault();
                        var bookings =
                            _productRepository.BookingList.FirstOrDefault(
                                b => b.ProductId == productHaveBooking && b.CheckinDate.HasValue &&
                                b.CheckinDate.Value.ToLosAngerlesTimeWithTimeZone(PublicHotel.TimeZoneId).Date >= DateTime.UtcNow.ToLosAngerlesTimeWithTimeZone(PublicHotel.TimeZoneId).Date);

                        if (bookings != null && bookings.CheckinDate.HasValue)
                        {
                            Session["CheckInDateSearch"] = bookings.CheckinDate.Value.ToLosAngerlesTimeWithTimeZone(PublicHotel.TimeZoneId).Date
                                                           .ToString("MM/dd/yyyy");
                        }
                    }

                    var sessionCheckInDate = Session["CheckInDateSearch"];
                    if (sessionCheckInDate != null || PublicProduct.IsOnBlackOutDay)
                    {
                        // On Blackout Day
                        if (sessionCheckInDate != null && !string.IsNullOrEmpty(sessionCheckInDate.ToString()))
                        {
                            DateTime.TryParseExact(sessionCheckInDate.ToString(), "MM/dd/yyyy", null, DateTimeStyles.None, out _selectedCheckInDate);
                        }
                        if (!IsPostBack && PublicProduct.IsOnBlackOutDay)
                        {
                            _selectedCheckInDate = PublicProduct.NextAvailableDate;
                        }
                    }
                    else if (PublicCustomerInfos != null && PublicProduct.ProductType == (int)Enums.ProductType.AddOns)
                    {
                        _selectedCheckInDate = _productRepository.GetMostRecentDate(PublicCustomerInfos.CustomerId);
                    }
                    else
                    {
                        _selectedCheckInDate = DateTime.UtcNow.ToLosAngerlesTime();
                    }

                    if (Session["TotalTickets"] != null)
                    {
                        TotalTicketsText.Text = Session["TotalTickets"].ToString();
                    }
                    else
                    {
                        TotalTicketsText.Text = PublicProduct.ProductType == (int)Enums.ProductType.DayPass ? "2" : "1";
                    }

                    TotalTickets = int.Parse(TotalTicketsText.Text);

                    CheckInDateTextMobile.Text   = _selectedCheckInDate.ToString(Constant.DiscountDateFormat);
                    CheckInDateTextDesktop.Text  = _selectedCheckInDate.ToString(Constant.DiscountDateFormat);
                    HidSelectedDateBefore.Value  = _selectedCheckInDate.ToString(Constant.DiscountDateFormat);
                    Session["CheckInDateSearch"] = _selectedCheckInDate.ToString(Constant.DiscountDateFormat);
                    _searchParams.StartDate      = _selectedCheckInDate;
                    CheckHaveBookingOnSelectedDate(_selectedCheckInDate);
                    var price = _productRepository.GetById(PublicProduct.ProductId, _searchParams).ActualPriceWithDate;
                    BindPrice(price);

                    HidSelectedDate.Value = "1";
                    BindSurvey();

                    var multiView = (MultiView)AuthControl.FindControl("AuthMultiView");

                    if (Request.Params["sp"] != null &&
                        (Session["UserSession"] == null || (Session["UserSession"] != null && string.Equals(Request.Params["sp"], (string)Session["UserSession"], StringComparison.OrdinalIgnoreCase))) &&
                        multiView != null)
                    {
                        ShowAuth = true;
                        multiView.ActiveViewIndex = 3;
                    }

                    if (Request.Params["reg"] != null &&
                        string.Equals(Request.Params["reg"], "true", StringComparison.OrdinalIgnoreCase) &&
                        Session["UserSession"] == null &&
                        multiView != null)
                    {
                        multiView.ActiveViewIndex = 0;
                        ShowAuth = true;
                    }

                    if (Request.Browser["IsMobileDevice"] == "true")
                    {
                        CheckInDateTextMobile.Visible = false;
                    }

                    // Reviews
                    if (Page.RouteData.Values["id"] == null && _productId == 0)
                    {
                        Survey.Visible = false;
                    }

                    if (PublicCustomerInfos != null)
                    {
                        EmailAddressText.Text = PublicCustomerInfos.EmailAddress;
                    }

                    CheckInDateRequestText.Text = _productRepository.GetFirstSoldOutDate(PublicProduct.ProductId)
                                                  .ToString("MMMM dd, yyyy");
                }
            }

            if (PublicProduct == null)
            {
                if (PublicCustomerInfos != null && !string.IsNullOrEmpty(PublicCustomerInfos.BrowsePassUrl))
                {
                    Response.Redirect(PublicCustomerInfos.BrowsePassUrl);
                }
                Response.Redirect(!string.IsNullOrEmpty((string)Session["SearchPage"])
                    ? Session["SearchPage"].ToString()
                    : Constant.SearchPageDefault);
            }

            PublicHotel = _productRepository.HotelList.First(h => h.HotelId == PublicProduct.HotelId);

            PublicMarkets = _productRepository.GetMarketsByHotelId(PublicProduct.HotelId);

            goBack.HRef = GetUrlSearchPage();

            BindProductInfo();

            SetMetaHeaderInfo();

            BindAmenties();

            var    tickets = _productRepository.GetTicketsFuture(PublicProduct.ProductId);
            string json    = JsonConvert.SerializeObject(tickets, CustomSettings.SerializerSettings());

            PublicTickets = json;
        }