public void ConnectedRegionsRangeTest() { var region = new Region { LatitudePrefix = 40.73, LongitudePrefix = -73.93, Precision = 0 }; { var range = RegionHelper.GetConnectedRegionsRange(region, 1, 2); Assert.AreEqual(39.75, range.Min.Latitude); Assert.AreEqual(-74.25, range.Min.Longitude); Assert.AreEqual(41.0, range.Max.Latitude); Assert.AreEqual(-73.0, range.Max.Longitude); } { var range = RegionHelper.GetConnectedRegionsRange(region, 1, 0); Assert.AreEqual(39.0, range.Min.Latitude); Assert.AreEqual(-75.0, range.Min.Longitude); Assert.AreEqual(41.0, range.Max.Latitude); Assert.AreEqual(-73.0, range.Max.Longitude); } //Invalid Test. TODO: Fix /* { * var range = RegionHelper.GetConnectedRegionsRange(region, 1, -1); * Assert.AreEqual(39.75, range.Min.Latitude); * Assert.AreEqual(-74.25, range.Min.Longitude); * Assert.AreEqual(41.0, range.Max.Latitude); * Assert.AreEqual(-73.0, range.Max.Longitude); * }*/ }
protected void btnEditUser_Click(object sender, EventArgs e) { Member member = MemberHelper.GetMember(currentUserId); member.IsApproved = ddlApproved.SelectedValue.Value; member.Wangwang = Globals.HtmlEncode(txtWangwang.Text.Trim()); member.GradeId = drpMemberRankList.SelectedValue.Value; member.RealName = txtRealName.Text.Trim(); if (rsddlRegion.GetSelectedRegionId().HasValue) { member.RegionId = rsddlRegion.GetSelectedRegionId().Value; member.TopRegionId = RegionHelper.GetTopRegionId(member.RegionId); } member.Address = Globals.HtmlEncode(txtAddress.Text); member.QQ = txtQQ.Text; member.MSN = txtMSN.Text; member.TelPhone = txtTel.Text; member.CellPhone = txtCellPhone.Text; if (calBirthday.SelectedDate.HasValue) { member.BirthDate = new DateTime?(calBirthday.SelectedDate.Value); } member.Email = txtprivateEmail.Text; member.Gender = gender.SelectedValue; if (ValidationMember(member)) { if (MemberHelper.Update(member)) { ShowMsg("成功修改了当前会员的个人资料", true); } else { ShowMsg("当前会员的个人信息修改失败", false); } } }
/// <inheritdoc/> public async Task <IEnumerable <MessageContainerMetadata> > GetLatestInfoAsync(Region region, long lastTimestamp, CancellationToken cancellationToken = default) { if (region == null) { throw new ArgumentNullException(nameof(region)); } else { // Validate region RequestValidationResult validationResult = region.Validate(); // Validate timestamp validationResult.Combine(Validator.ValidateFromRange( lastTimestamp, 0, DateTimeOffset.UtcNow.AddDays(1).ToUnixTimeMilliseconds(), Entities.Validation.Resources.ValidationMessages.InvalidTimestamp)); lastTimestamp = Math.Max(lastTimestamp, DateTimeOffset.UtcNow.AddDays(-MAX_MESSAGE_AGE_DAYS).ToUnixTimeMilliseconds()); if (validationResult.Passed) { // Get message information from database return(await this._reportRepo.GetLatestAsync(RegionHelper.AdjustToPrecision(region), lastTimestamp, cancellationToken)); } else { throw new RequestValidationFailedException(validationResult); } } }
/// <summary> /// Measures the cell. /// </summary> /// <param name="collectionWithSeparator">A collection that can draw separators around the cell.</param> /// <param name="referenceContainer">The cell view in <paramref name="collectionWithSeparator"/> that contains this cell.</param> /// <param name="separatorLength">The length of the separator in <paramref name="collectionWithSeparator"/>.</param> public virtual void Measure(ILayoutCellViewCollection collectionWithSeparator, ILayoutCellView referenceContainer, Measure separatorLength) { CollectionWithSeparator = collectionWithSeparator; ReferenceContainer = referenceContainer; SeparatorLength = separatorLength; Debug.Assert(StateView != null); Debug.Assert(StateView.ControllerView != null); ILayoutMeasureContext MeasureContext = StateView.ControllerView.MeasureContext; Debug.Assert(MeasureContext != null); Size MeasuredSize; if (Frame is ILayoutMeasurableFrame AsMeasurableFrame) { AsMeasurableFrame.Measure(MeasureContext, this, collectionWithSeparator, referenceContainer, separatorLength, out Size Size, out Padding Padding); MeasuredSize = Size; CellPadding = Padding; } else { Debug.Assert(ChildStateView != null); ChildStateView.MeasureCells(collectionWithSeparator, referenceContainer, separatorLength); MeasuredSize = ChildStateView.CellSize; } CellSize = MeasuredSize; ActualCellSize = RegionHelper.InvalidSize; Debug.Assert(RegionHelper.IsValid(CellSize)); }
/// <inheritdoc/> public async Task PublishAreaAsync(NarrowcastMessage message, CancellationToken cancellationToken = default) { // Validate inputs if (message == null) { throw new ArgumentNullException(nameof(message)); } RequestValidationResult validationResult = message.Validate(); if (validationResult.Passed) { // Build a MessageContainer for the submitted NarrowcastMessage MessageContainer container = new MessageContainer(); container.Narrowcasts.Add(message); // Define regions for the published message IEnumerable <Region> messageRegions = RegionHelper.GetRegionsCoverage(message.Area, this.PrecisionMin, this.PrecisionMax); // Publish await this._reportRepo.InsertAsync(container, messageRegions, cancellationToken); } else { throw new RequestValidationFailedException(validationResult); } }
/// <summary> /// Draws all visible cells in the view using <see cref="DrawContext"/>. /// <param name="stateView">The view to draw.</param> /// </summary> public virtual void Draw(ILayoutNodeStateView stateView) { UpdateLayout(); if (IsCaretShown) { DrawContext.HideCaret(); } Debug.Assert(RegionHelper.IsValid(stateView.ActualCellSize)); stateView.DrawCells(); if (ShowLineNumber) { DisplayLineNumber(DrawCellViewLineNumber); } if (IsCaretShown) { if (IsCaretOnText(out ILayoutStringContentFocus TextFocus)) { DrawTextCaret(TextFocus); } else if (IsCaretOnComment(out ILayoutCommentFocus CommentFocus)) { DrawCommentCaret(CommentFocus); } } }
private void GetRegionsOfProvinceCounty(HttpContext context) { context.Response.ContentType = "application/json"; IList <Hidistro.Entities.Store.RegionInfo> allProvinceLists = RegionHelper.GetAllProvinceLists(false); string s = JsonConvert.SerializeObject(new { province = from p in allProvinceLists select new { id = p.RegionId, name = p.RegionName, city = from c in RegionHelper.GetRegionChildList(p.RegionId, false) select new { id = c.RegionId, name = c.RegionName, county = from d in RegionHelper.GetRegionChildList(c.RegionId, false) select new { id = d.RegionId, name = d.RegionName } } } }); context.Response.Write(s); }
protected override void AttachChildControls() { this.hdLink = (HiddenField)this.FindControl("hdLink"); this.txtEmail = (TextBox)this.FindControl("txtEmail"); this.txtPhone = (TextBox)this.FindControl("txtPhone"); this.txtShopName = (TextBox)this.FindControl("txtShopName"); this.hidUploadImages = (HtmlInputHidden)this.FindControl("hidOldImages"); PageTitle.AddSiteNameTitle("分销员店铺信息设置"); if (!this.Page.IsPostBack) { MemberInfo user = Users.GetUser(); if (!user.IsReferral()) { if (user.Referral != null && user.Referral.ReferralStatus != 2.GetHashCode()) { this.Page.Response.Redirect($"/{HiContext.Current.GetClientPath}/ReferralRegisterresults"); } else { this.Page.Response.Redirect($"/{HiContext.Current.GetClientPath}/ReferralRegisterAgreement"); } } this.hdLink.Value = Globals.FullPath($"/{HiContext.Current.GetClientPath}/Referral"); string fullRegion = RegionHelper.GetFullRegion(user.RegionId, " ", true, 0); this.txtEmail.Text = (string.IsNullOrEmpty(user.Referral.Email) ? user.Email : user.Referral.Email); this.txtPhone.Text = (string.IsNullOrEmpty(user.Referral.CellPhone) ? user.CellPhone : user.Referral.CellPhone); this.txtShopName.Text = user.Referral.ShopName; this.hidUploadImages.Value = user.Referral.BannerUrl; } }
/// <summary> /// Prints the cell. /// </summary> /// <param name="origin">The origin from where to start printing.</param> public virtual void Print(Point origin) { Debug.Assert(RegionHelper.IsValid(ActualCellSize)); Debug.Assert(ChildStateView != null); ChildStateView.PrintCells(origin); }
protected void btnEditUser_Click(object sender, System.EventArgs e) { MemberInfo member = MemberHelper.GetMember(this.currentUserId); int gradeId = member.GradeId; member.GradeId = this.drpMemberRankList.SelectedValue.Value; member.RealName = this.txtRealName.Text.Trim(); if (this.rsddlRegion.GetSelectedRegionId().HasValue) { member.RegionId = this.rsddlRegion.GetSelectedRegionId().Value; member.TopRegionId = RegionHelper.GetTopRegionId(member.RegionId); } member.Address = Globals.HtmlEncode(this.txtAddress.Text); member.QQ = this.txtQQ.Text; member.Email = member.QQ + "@qq.com"; member.CellPhone = this.txtCellPhone.Text; member.Email = this.txtprivateEmail.Text; member.CardID = this.txtCardID.Text; if (!this.ValidationMember(member)) { return; } if (gradeId != this.drpMemberRankList.SelectedValue.Value) { Messenger.SendWeiXinMsg_MemberGradeChange(member); } if (MemberHelper.Update(member)) { this.ShowMsgAndReUrl("成功修改了当前会员的个人资料", true, "/Admin/member/managemembers.aspx"); return; } this.ShowMsg("当前会员的个人信息修改失败", false); }
private void btnSave_Click(object sender, EventArgs e) { if (ValidationInput()) { Distributor distributor = SubsiteStoreHelper.GetDistributor(); distributor.RealName = txtRealName.Text.Trim(); distributor.CompanyName = txtCompanyName.Text.Trim(); if (rsddlRegion.GetSelectedRegionId().HasValue) { distributor.RegionId = rsddlRegion.GetSelectedRegionId().Value; distributor.TopRegionId = RegionHelper.GetTopRegionId(distributor.RegionId); } distributor.Email = txtprivateEmail.Text.Trim(); distributor.Address = txtAddress.Text.Trim(); distributor.Zipcode = txtZipcode.Text.Trim(); distributor.QQ = txtQQ.Text.Trim(); distributor.Wangwang = txtWangwang.Text.Trim(); distributor.MSN = txtMSN.Text.Trim(); distributor.TelPhone = txtTel.Text.Trim(); distributor.CellPhone = txtCellPhone.Text.Trim(); distributor.IsCreate = false; if (ValidationDistributorRequest(distributor)) { if (SubsiteStoreHelper.UpdateDistributor(distributor)) { ShowMsg("成功的修改了信息", true); } else { ShowMsg("修改失败", false); } } } }
/// <summary> /// Draws the cell. /// </summary> public virtual void Draw() { Debug.Assert(RegionHelper.IsValid(ActualCellSize)); Debug.Assert(ChildStateView != null); ChildStateView.DrawCells(); }
private void LoadMemberInfo() { MemberInfo member = MemberHelper.GetMember(this.currentUserId); if (member == null) { base.GotoResourceNotFound(); return; } System.Uri arg_25_0 = System.Web.HttpContext.Current.Request.Url; this.litUserName.Text = member.UserName; MemberGradeInfo memberGrade = MemberHelper.GetMemberGrade(member.GradeId); if (memberGrade != null) { this.litGrade.Text = memberGrade.Name; } this.litCreateDate.Text = member.CreateDate.ToString(); this.litRealName.Text = member.RealName; this.litAddress.Text = RegionHelper.GetFullRegion(member.RegionId, "") + member.Address; this.litQQ.Text = member.QQ; this.litCellPhone.Text = member.CellPhone; this.litEmail.Text = member.Email; this.litOpenId.Text = member.OpenId; this.litAlipayOpenid.Text = member.AlipayOpenid; this.txtCardID.Text = member.CardID; this.litUserBindName.Text = member.UserBindName; }
/// <summary> /// Prints cells in this block state view. /// </summary> /// <param name="origin">The origin from where to start printing.</param> public virtual void PrintCells(Point origin) { Debug.Assert(RegionHelper.IsValid(ActualCellSize)); Debug.Assert(RootCellView != null); RootCellView.Print(origin); }
/// <inheritdoc/> public async Task <string> PublishAsync(MessageContainer report, Region region, CancellationToken cancellationToken = default) { // Validate inputs if (report == null) { throw new ArgumentNullException(nameof(report)); } if (region == null) { throw new ArgumentNullException(nameof(region)); } RequestValidationResult validationResult = report.Validate(); validationResult.Combine(region.Validate()); if (validationResult.Passed) { // Push to upstream data repository return(await this._reportRepo.InsertAsync(report, RegionHelper.AdjustToPrecision(region), cancellationToken)); } else { throw new RequestValidationFailedException(validationResult); } }
/// <summary> /// Inserts a #region tag for the specified region preceding the specified start point. /// </summary> /// <param name="region">The region to start.</param> /// <param name="startPoint">The starting point.</param> /// <returns>The updated cursor.</returns> public EditPoint InsertRegionTag(CodeItemRegion region, EditPoint startPoint) { var cursor = startPoint.CreateEditPoint(); // If the cursor is not preceeded only by whitespace, insert a new line. var firstNonWhitespaceIndex = cursor.GetLine().TakeWhile(char.IsWhiteSpace).Count(); if (cursor.DisplayColumn > firstNonWhitespaceIndex + 1) { cursor.Insert(Environment.NewLine); } cursor.Insert($"{RegionHelper.GetRegionTagText(cursor, region.Name)}{Environment.NewLine}"); startPoint.SmartFormat(cursor); region.StartPoint = cursor.CreateEditPoint(); region.StartPoint.LineUp(); region.StartPoint.StartOfLine(); var regionWrapper = new[] { region }; _insertBlankLinePaddingLogic.InsertPaddingBeforeRegionTags(regionWrapper); _insertBlankLinePaddingLogic.InsertPaddingAfterRegionTags(regionWrapper); return(cursor); }
/// <summary> /// Draws the background of a selected rectangle. /// </summary> /// <param name="rect">The rectangle to draw.</param> /// <param name="selectionStyle">The style to use when drawing.</param> public virtual void DrawSelectionRectangle(Rect rect, SelectionStyles selectionStyle) { Debug.Assert(WpfDrawingContext != null); Debug.Assert(RegionHelper.IsFixed(rect)); Pen RectanglePen; switch (selectionStyle) { default: RectanglePen = GetPen(PenSettings.Default); break; case SelectionStyles.Node: RectanglePen = GetPen(PenSettings.SelectionNode); break; case SelectionStyles.NodeList: RectanglePen = GetPen(PenSettings.SelectionNodeList); break; case SelectionStyles.BlockList: RectanglePen = GetPen(PenSettings.SelectionBlockList); break; } WpfDrawingContext.DrawRectangle(GetBrush(BrushSettings.Selection), RectanglePen, new System.Windows.Rect(PagePadding.Left.Draw + rect.X, PagePadding.Top.Draw + rect.Y, rect.Width, rect.Height)); }
private void EditRegion(HttpContext context) { context.Response.ContentType = "application/json"; int regionId = 0; string text = context.Request["RegionName"]; if (!int.TryParse(context.Request["RegionId"], out regionId) || string.IsNullOrEmpty(text)) { context.Response.Write("{\"Status\":\"0\"}"); } else { Hidistro.Entities.Store.RegionInfo regionByRegionId = RegionHelper.GetRegionByRegionId(regionId); if (regionByRegionId == null) { context.Response.Write("{\"Status\":\"-1\"}"); } else if (RegionHelper.IsSameName(text, regionByRegionId.ParentRegionId, regionByRegionId.RegionId)) { context.Response.Write("{\"Status\":\"same\"}"); } else { bool flag = RegionHelper.UpdateRegionName(regionId, text); context.Response.Write("{\"Status\":\"" + flag.ToString() + "\"}"); } } }
/// <summary> /// Prints the selection. /// </summary> public virtual void Print() { ILayoutNodeState State = StateView.State; ILayoutBlockListInner ParentInner = State.PropertyToInner(PropertyName) as ILayoutBlockListInner; Debug.Assert(ParentInner != null); Debug.Assert(BlockIndex >= 0 && BlockIndex < ParentInner.BlockStateList.Count); ILayoutBlockState BlockState = ParentInner.BlockStateList[BlockIndex]; ILayoutControllerView ControllerView = StateView.ControllerView; Debug.Assert(ControllerView.PrintContext != null); ControllerView.UpdateLayout(); Debug.Assert(StartIndex <= EndIndex); ILayoutNodeStateView FirstStateView = ControllerView.StateViewTable[BlockState.StateList[StartIndex]]; Point Origin = FirstStateView.CellOrigin.Opposite; for (int i = StartIndex; i < EndIndex; i++) { ILayoutNodeStateView StateView = ControllerView.StateViewTable[BlockState.StateList[i]]; Debug.Assert(RegionHelper.IsValid(StateView.ActualCellSize)); StateView.PrintCells(Origin); } }
/// <summary> /// Measures a cell created with this frame. /// </summary> /// <param name="measureContext">The context used to measure the cell.</param> /// <param name="cellView">The cell to measure.</param> /// <param name="collectionWithSeparator">A collection that can draw separators around the cell.</param> /// <param name="referenceContainer">The cell view in <paramref name="collectionWithSeparator"/> that contains this cell.</param> /// <param name="separatorLength">The length of the separator in <paramref name="collectionWithSeparator"/>.</param> /// <param name="size">The cell size upon return, padding included.</param> /// <param name="padding">The cell padding.</param> public virtual void Measure(ILayoutMeasureContext measureContext, ILayoutCellView cellView, ILayoutCellViewCollection collectionWithSeparator, ILayoutCellView referenceContainer, Measure separatorLength, out Size size, out Padding padding) { size = measureContext.MeasureSymbolSize(Symbols.InsertSign); measureContext.UpdatePadding(LeftMargin, RightMargin, ref size, out padding); Debug.Assert(RegionHelper.IsValid(size)); }
public void RegionCoverageTest_Precision1() { var area = new NarrowcastArea { BeginTimestamp = 0, EndTimestamp = 1, RadiusMeters = 1000, }; int precision = 1; { area.Location = new Coordinates { Latitude = 0.0001, Longitude = 0.0001 }; var regions = RegionHelper.GetRegionsCoverage(area, precision).ToList(); Assert.AreEqual(1, regions.Count); } { area.Location = new Coordinates { Latitude = 89.99999, Longitude = 0.0001 }; var regions = RegionHelper.GetRegionsCoverage(area, precision).ToList(); Assert.AreEqual(2, regions.Count); } { area.Location = new Coordinates { Latitude = -0.0001, Longitude = 179.99999 }; var regions = RegionHelper.GetRegionsCoverage(area, precision).ToList(); Assert.AreEqual(2, regions.Count); } { area.Location = new Coordinates { Latitude = -89.9999, Longitude = 0.0001 }; var regions = RegionHelper.GetRegionsCoverage(area, precision).ToList(); Assert.AreEqual(2, regions.Count); } { area.Location = new Coordinates { Latitude = -0.0001, Longitude = -179.99999 }; var regions = RegionHelper.GetRegionsCoverage(area, precision).ToList(); Assert.AreEqual(2, regions.Count); } { area.Location = new Coordinates { Latitude = 89.99999, Longitude = -179.99999 }; var regions = RegionHelper.GetRegionsCoverage(area, precision).ToList(); Assert.AreEqual(3, regions.Count); } }
private int GetCountry(Region region) { while (region.RegionLevel > 2) { region = RegionHelper.Get(region.IDParent.Value); } return(region.IDRegion); }
/// <summary> /// Draws cells in the state view. /// </summary> public virtual void DrawCells() { Debug.Assert(RegionHelper.IsValid(ActualCellSize)); Debug.Assert(RootCellView != null); DrawSelection(); RootCellView.Draw(); }
/// <summary> /// Updates the actual size of cells in this state view. /// </summary> public virtual void UpdateActualCellsSize() { Debug.Assert(RootCellView != null); RootCellView.UpdateActualSize(); Debug.Assert(RegionHelper.IsValid(RootCellView.ActualCellSize)); ActualCellSize = RootCellView.ActualCellSize; }
public TestRecentCaseRecords() { InitializeComponent(); this.Loaded += delegate { RegionHelper.RequestNavigate("CsMainRegion", SingularityForensic.Contracts.Casing.Constants.RecentCaseRecordsView); //RegionHelper.RegisterViewWithRegion("CsMainRegion",typeof(SingularityForensic.Casing.Views.RecentCaseRecords)); }; }
void TestRegion(int lat, int lon, int precision, Region expected) { var region = RegionHelper.AdjustToPrecision(new Region(lat, lon, precision)); Assert.AreEqual(expected.LatitudePrefix, region.LatitudePrefix); Assert.AreEqual(expected.LongitudePrefix, region.LongitudePrefix); Assert.AreEqual(expected.Precision, region.Precision); }
void TestRegionBackwardCompatible(double lat, double lon, Region expected) { var region = RegionHelper.CreateRegion(lat, lon); Assert.AreEqual(expected.LatitudePrefix, region.LatitudePrefix); Assert.AreEqual(expected.LongitudePrefix, region.LongitudePrefix); Assert.AreEqual(expected.Precision, region.Precision); }
protected void AddrBtn_Click(object sender, EventArgs e) { if (this.txtLogID.Value == "") { this.ShowMsg("LogID为空,请检查!", false); } else { string str = this.txtPrizeReceiver.Text.Trim(); string str2 = this.txtPrizeTel.Text.Trim(); string str3 = this.txtPrizeAddress.Text.Trim(); string s = this.HideRegion.Value.Trim(); if (str.Length < 2) { this.ShowMsg("收货人不能为空", false); } else if (str2.Length < 8) { this.ShowMsg("联系电话不正确", false); } else if (str3.Length < 6) { this.ShowMsg("地址不够详细", false); } else { int result = 0; if (!int.TryParse(s, out result)) { this.ShowMsg("省市区未选择", false); } else { s = RegionHelper.GetFullPath(result); PrizesDeliveQuery query = new PrizesDeliveQuery { Status = 1, ReggionPath = s, Address = str3, Tel = str2, Receiver = str, LogId = this.txtLogID.Value }; int num2 = 0; int.TryParse(this.txtDeliverID.Value.Trim(), out num2); query.Id = num2; if (GameHelper.UpdatePrizesDelivery(query)) { this.ShowMsg("保存收货人信息成功!", true); this.BindData(); } else { this.ShowMsg("保存信息失败", false); } } } } }
protected override void AttachChildControls() { int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId); this.keyWord = this.Page.Request.QueryString["keyWord"]; this.imgUrl = (HiImage)this.FindControl("imgUrl"); this.litContent = (Literal)this.FindControl("litContent"); this.rptProducts = (AppshopTemplatedRepeater)this.FindControl("rptCountDownProducts"); this.txtTotal = (HtmlInputHidden)this.FindControl("txtTotal"); string text = this.Page.Request["lat"].ToNullString(); string text2 = this.Page.Request["lng"].ToNullString(); string cityName = this.Page.Request["city"].ToNullString(); string address = this.Page.Request["address"].ToNullString(); if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2)) { RegionInfo regionByCityAddress = RegionHelper.GetRegionByCityAddress(cityName, address); if (regionByCityAddress != null) { int num = regionByCityAddress.RegionId; if (regionByCityAddress.FullRegionPath.Split(',').Length >= 2) { num = regionByCityAddress.FullRegionPath.Split(',')[1].ToInt(0); } WebHelper.SetCookie("UserCoordinateCookie", "CityRegionId", num.ToNullString(), null); WebHelper.SetCookie("UserCoordinateCookie", "RegionId", regionByCityAddress.RegionId.ToNullString(), null); WebHelper.SetCookie("UserCoordinateCookie", "FullRegionPath", regionByCityAddress.FullRegionPath, null); } WebHelper.SetCookie("UserCoordinateCookie", "NewCoordinate", $"{text},{text2}", null); } this.rptCategories = (AppshopTemplatedRepeater)this.FindControl("rptCategories"); if (this.rptCategories != null) { IEnumerable <CategoryInfo> subCategories = CatalogHelper.GetSubCategories(this.categoryId); this.rptCategories.DataSource = subCategories; this.rptCategories.DataBind(); } int page = default(int); if (!int.TryParse(this.Page.Request.QueryString["page"], out page)) { page = 1; } int size = default(int); if (!int.TryParse(this.Page.Request.QueryString["size"], out size)) { size = 10; } int storeId = this.Page.Request.QueryString["StoreId"].ToInt(0); int num2 = default(int); DataTable countDownProductList = PromoteHelper.GetCountDownProductList(this.categoryId, this.keyWord, page, size, storeId, out num2, false); this.rptProducts.ItemDataBound += this.rptProduct_ItemDataBound; this.rptProducts.DataSource = countDownProductList; this.rptProducts.DataBind(); this.txtTotal.SetWhenIsNotNull(num2.ToString()); PageTitle.AddSiteNameTitle("限时抢购"); }
protected override void CreateChildControls() { this.Controls.Clear(); if (!this.dataLoaded) { if (!string.IsNullOrEmpty(this.Context.Request.Form["regionSelectorValue"])) { this.currentRegionId = new int?(int.Parse(this.Context.Request.Form["regionSelectorValue"])); } this.dataLoaded = true; } if (this.currentRegionId.HasValue) { XmlNode region = RegionHelper.GetRegion(this.currentRegionId.Value); if (region != null) { if (region.Name == "county") { this.countyId = new int?(this.currentRegionId.Value); this.cityId = new int?(int.Parse(region.ParentNode.Attributes["id"].Value)); this.provinceId = new int?(int.Parse(region.ParentNode.ParentNode.Attributes["id"].Value)); } else if (region.Name == "city") { this.cityId = new int?(this.currentRegionId.Value); this.provinceId = new int?(int.Parse(region.ParentNode.Attributes["id"].Value)); } else if (region.Name == "province") { this.provinceId = new int?(this.currentRegionId.Value); } } } this.Controls.Add(CreateTitleControl(this.ProvinceTitle)); this.ddlProvinces = this.CreateDropDownList("ddlRegions1"); FillDropDownList(this.ddlProvinces, RegionHelper.GetAllProvinces(), this.provinceId); this.Controls.Add(CreateTag("<span>")); this.Controls.Add(this.ddlProvinces); this.Controls.Add(CreateTag("</span>")); this.Controls.Add(CreateTitleControl(this.CityTitle)); this.ddlCitys = this.CreateDropDownList("ddlRegions2"); if (this.provinceId.HasValue) { FillDropDownList(this.ddlCitys, RegionHelper.GetCitys(this.provinceId.Value), this.cityId); } this.Controls.Add(CreateTag("<span>")); this.Controls.Add(this.ddlCitys); this.Controls.Add(CreateTag("</span>")); this.Controls.Add(CreateTitleControl(this.CountyTitle)); this.ddlCountys = this.CreateDropDownList("ddlRegions3"); if (this.cityId.HasValue) { FillDropDownList(this.ddlCountys, RegionHelper.GetCountys(this.cityId.Value), this.countyId); } this.Controls.Add(CreateTag("<span>")); this.Controls.Add(this.ddlCountys); this.Controls.Add(CreateTag("</span>")); }
public bool Setup( IPluginSetupInfo info ) { _regionHelper = new RegionHelper(); foreach( var s in Screen.AllScreens ) _regionHelper.Add( s.Bounds ); _lastPoint = Point.Empty; _timer = new Timer(); _timer.Interval = 10; _timer.Tick += _timer_Tick; _timer.Start(); return true; }
public override bool Setup( IPluginSetupInfo info ) { _timer = new DispatcherTimer(); _timer.Tick += OnInternalBeat; _regionHelper = new RegionHelper(); foreach( var s in Screen.AllScreens ) _regionHelper.Add( s.Bounds ); return base.Setup( info ); }