private void BindList() { HelpQuery helpQuery = this.GetHelpQuery(); DbQueryResult dbQueryResult = new DbQueryResult(); dbQueryResult = CommentBrowser.GetHelpList(helpQuery); this.rptHelps.DataSource = dbQueryResult.Data; this.rptHelps.DataBind(); this.pager.TotalRecords = dbQueryResult.TotalRecords; }
private void InitDataByTheme() { switch (SettingsManager.GetMasterSettings(true).VTheme.ToLower()) { case "underwear": //内衣 this.ShopName = (Literal)this.FindControl("ShopName"); if (Globals.GetCurrentDistributorId() != 0) { this.ShopName.Text = DistributorsBrower.GetDistributorInfo(Globals.GetCurrentDistributorId()).StoreName; } if (this.imglogo.ImageUrl.Equals("/Utility/pics/headLogo.jpg")) { this.imglogo.ImageUrl = "/Templates/vshop/underwear/images/LOGO.jpg"; } this.rptCategories1 = (VshopTemplatedRepeater)this.FindControl("rptCategories1"); this.rptCategories1.DataSource = CategoryBrowser.GetCategoriesByPruductType(4, 2); //根据ProductType查询分类 this.rptCategories1.DataBind(); this.rptCategories2 = (VshopTemplatedRepeater)this.FindControl("rptCategories2"); this.rptCategories3 = (VshopTemplatedRepeater)this.FindControl("rptCategories3"); this.rptCategories3.DataSource = CategoryBrowser.GetCategoriesByPruductType(12, 1); //根据ProductType查询分类 this.rptCategories3.DataBind(); this.rptCategories4 = (VshopTemplatedRepeater)this.FindControl("rptCategories4"); this.rptCategories4.DataSource = CategoryBrowser.GetCategoriesByPruductType(11, 4); //根据ProductType查询分类 this.rptCategories4.DataBind(); this.rptProductqqg = (VshopTemplatedRepeater)this.FindControl("rptProductqqg"); ProductQuery query = new ProductQuery { PageSize = 6, PageIndex = 1, SortBy = "ShowSaleCounts", SortOrder = SortAction.Desc, TypeId = 2 }; this.rptProductqqg.DataSource = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), query).Data; this.rptProductqqg.DataBind(); DataTable dt = ProductBrowser.GetHomeProductTop(0, ProductInfo.ProductTop.New); this.ProductCount = (Literal)this.FindControl("ProductCount"); ProductCount.Text = dt.Rows[0][0] + ""; this.Gonggao = (Literal)this.FindControl("Gonggao"); IList <ArticleInfo> artlist = CommentBrowser.GetArticleList(4, 1); if (artlist.Count > 0) { this.Gonggao.Text = artlist[0].Content; } this.Erweima = (Literal)this.FindControl("Erweima"); if (Globals.GetCurrentDistributorId() == 0) { this.Erweima.Text = "<li><a href='QRcode.aspx?ReferralId='><i><img src='/Templates/vshop/underwear/images/iconfont-erweima.png' /></i><p>二维码</p></a></li>"; } else { this.Erweima.Text = "<li><a href='QRcode.aspx?ReferralId=" + Globals.GetCurrentDistributorId() + "'><i><img src='/Templates/vshop/underwear/images/iconfont-erweima.png' /></i><p>二维码</p></a></li>"; } break; } ; }
protected override void AttachChildControls() { this.rptAffiches = (ThemedTemplatedRepeater)this.FindControl("rptAffiches"); if (!this.Page.IsPostBack) { this.rptAffiches.DataSource = CommentBrowser.GetAfficheList(); this.rptAffiches.DataBind(); } }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["AfficheId"], out this.affichesId)) { base.GotoResourceNotFound(); } this.litAffichesAddedDate = (FormatedTimeLabel)this.FindControl("litAffichesAddedDate"); this.litContent = (Literal)this.FindControl("litContent"); this.litTilte = (Literal)this.FindControl("litTilte"); this.lblFront = (Label)this.FindControl("lblFront"); this.lblNext = (Label)this.FindControl("lblNext"); this.aFront = (HtmlAnchor)this.FindControl("front"); this.aNext = (HtmlAnchor)this.FindControl("next"); this.lblFrontTitle = (Label)this.FindControl("lblFrontTitle"); this.lblNextTitle = (Label)this.FindControl("lblNextTitle"); if (!this.Page.IsPostBack) { AfficheInfo affiche = CommentBrowser.GetAffiche(this.affichesId); if (affiche != null) { PageTitle.AddSiteNameTitle(affiche.Title, HiContext.Current.Context); this.litTilte.Text = affiche.Title; string str = HiContext.Current.HostPath + Globals.GetSiteUrls().UrlData.FormatUrl("AffichesDetails", new object[] { this.affichesId }); this.litContent.Text = affiche.Content.Replace("href=\"#\"", "href=\"" + str + "\""); this.litAffichesAddedDate.Time = affiche.AddedDate; AfficheInfo frontOrNextAffiche = CommentBrowser.GetFrontOrNextAffiche(this.affichesId, "Front"); AfficheInfo info3 = CommentBrowser.GetFrontOrNextAffiche(this.affichesId, "Next"); if ((frontOrNextAffiche != null) && (frontOrNextAffiche.AfficheId > 0)) { if (this.lblFront != null) { this.lblFront.Visible = true; this.aFront.HRef = "AffichesDetails.aspx?afficheId=" + frontOrNextAffiche.AfficheId; this.lblFrontTitle.Text = frontOrNextAffiche.Title; } } else if (this.lblFront != null) { this.lblFront.Visible = false; } if ((info3 != null) && (info3.AfficheId > 0)) { if (this.lblNext != null) { this.lblNext.Visible = true; this.aNext.HRef = "AffichesDetails.aspx?afficheId=" + info3.AfficheId; this.lblNextTitle.Text = info3.Title; } } else if (this.lblNext != null) { this.lblNext.Visible = false; } } } }
private void CmessagesList_ItemCommand(object sender, RepeaterCommandEventArgs e) { if (e.CommandName == "Delete") { IList <long> list = new List <long>(); list.Add(Convert.ToInt64(e.CommandArgument)); CommentBrowser.DeleteMemberMessages(list); this.BindData(); } }
protected override void AttachChildControls() { this.helpCategories = (WapTemplatedRepeater)this.FindControl("helpCategories"); this.helpCategories.DataSource = CommentBrowser.GetHelpCategories(); this.helpCategories.DataBind(); PageTitle.AddSiteNameTitle("帮助中心"); WAPHeadName.AddHeadName("帮助中心"); }
protected override void Render(HtmlTextWriter writer) { XmlNode node = CommentBrowser.GetArticleSubjectDocument().SelectSingleNode("root/Subject[SubjectId='" + this.SubjectId + "']"); if (node != null) { base.Text = node.SelectSingleNode("SubjectName").InnerText; } base.Render(writer); }
private void CmessagesList_ItemCommand(object sender, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { System.Collections.Generic.IList <long> list = new System.Collections.Generic.List <long>(); if (e.CommandName == "Delete") { list.Add(System.Convert.ToInt64(e.CommandArgument)); CommentBrowser.DeleteMemberMessages(list); this.BindData(); } }
protected override void AttachChildControls() { int num; int num2; int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId); this.txtCategoryName = (HtmlInputHidden)this.FindControl("txtCategoryName"); this.txtCategoryId = (HtmlInputHidden)this.FindControl("txtCategoryId"); this.keyWord = this.Page.Request.QueryString["keyWord"]; if (!string.IsNullOrWhiteSpace(this.keyWord)) { this.keyWord = this.keyWord.Trim(); } this.rptArticles = (VshopTemplatedRepeater)this.FindControl("rptArticles"); this.txtTotalPages = (HtmlInputHidden)this.FindControl("txtTotal"); if (!int.TryParse(this.Page.Request.QueryString["page"], out num)) { num = 1; } if (!int.TryParse(this.Page.Request.QueryString["size"], out num2)) { num2 = 20; } ArticleQuery articleQuery = new ArticleQuery(); if (!string.IsNullOrEmpty(this.Page.Request.QueryString["CategoryId"])) { int result = 0; if (int.TryParse(this.Page.Request.QueryString["CategoryId"], out result)) { ArticleCategoryInfo articleCategory = CommentBrowser.GetArticleCategory(result); if (articleCategory != null) { PageTitle.AddSiteNameTitle(articleCategory.Name); articleQuery.CategoryId = new int?(result); this.txtCategoryId.Value = result.ToString(); this.txtCategoryName.Value = articleCategory.Name; } else { PageTitle.AddSiteNameTitle("文章分类搜索页"); } } } articleQuery.Keywords = this.keyWord; articleQuery.PageIndex = num; articleQuery.PageSize = num2; articleQuery.SortBy = "AddedDate"; articleQuery.SortOrder = SortAction.Desc; DbQueryResult articleList = CommentBrowser.GetArticleList(articleQuery); this.rptArticles.DataSource = articleList.Data; this.rptArticles.DataBind(); this.txtTotalPages.SetWhenIsNotNull(articleList.TotalRecords.ToString()); }
protected override void OnLoad(EventArgs e) { this.voteds = CommentBrowser.GetVoteByIsShow(); if (this.voteds != null && this.voteds.Tables.Count >= 2 && this.voteds.Tables[0] != null && this.voteds.Tables[1] != null && this.voteds.Tables[0].Rows.Count > 0) { this.voteds.Tables[0].Columns.Add("Vote", typeof(DataView)); this.voteds.Tables[0].Rows[0]["Vote"] = this.voteds.Tables[1].DefaultView; } base.DataSource = this.voteds; base.DataBind(); }
private void BindList() { DbQueryResult leaveComments = CommentBrowser.GetLeaveComments(new LeaveCommentQuery { PageSize = 3, PageIndex = this.pager.PageIndex }); this.rptLeaveComments.DataSource = leaveComments.Data; this.rptLeaveComments.DataBind(); this.pager.TotalRecords = (int)((double)leaveComments.TotalRecords * (System.Convert.ToDouble(this.pager.PageSize) / 3.0)); }
protected override void OnLoad(EventArgs e) { int.TryParse(this.Page.Request.QueryString["CategoryId"], out this.categoryId); CategoryInfo category = CategoryBrowser.GetCategory(this.categoryId); if (category != null) { this.topCategoryId = category.TopCategoryId; } base.DataSource = CommentBrowser.GetHotKeywords(this.topCategoryId, this.MaxNum); base.DataBind(); }
public IHttpActionResult Help(int id, string accessToken, int channel, int platform, string ver) { Logger.WriterLogger("Common.Help, Params: " + string.Format("accessToken={0}&channel={1}&platform={2}&ver={3}&id={4}", accessToken, channel, platform, ver, id), LoggerType.Info); // 保存访问信息 base.SaveVisitInfo("", channel, platform, ver); // 验证令牌 int accessTookenCode = VerifyAccessToken(accessToken); if (accessTookenCode > 0) { return(base.JsonFaultResult(new CommonException(accessTookenCode).GetMessage(), "Common.Help")); } HelpListItem item = new HelpListItem(); HelpInfo help = CommentBrowser.GetHelp(id); if (help != null) { item.CategoryId = help.CategoryId; item.Id = help.HelpId; item.Title = help.Title; item.Description = help.Description; var regex = new Regex(@"""/Storage/master"); item.Content = regex.Replace(help.Content, "\"" + base.STORAGE_HOST + @"/Storage/master"); item.Content = StringExtension.CovertToHtml(item.Content); item.AddedDate = help.AddedDate.ToString("yyyy-MM-dd HH:mm:ss"); return(base.JsonActionResult(new StandardResult <HelpListItem>() { code = 0, msg = "", data = item })); } else { StandardResult <string> result = new StandardResult <string>() { code = 1, msg = "找不到该帮助内容", data = "" }; return(base.JsonActionResult(result)); } }
private void BindList() { LeaveCommentQuery query = new LeaveCommentQuery(); query.PageSize = 3; query.PageIndex = this.pager.PageIndex; DbQueryResult leaveComments = CommentBrowser.GetLeaveComments(query); this.rptLeaveComments.DataSource = leaveComments.Data; this.rptLeaveComments.DataBind(); this.pager.TotalRecords = (int)(leaveComments.TotalRecords * (Convert.ToDouble(this.pager.PageSize) / 3.0)); }
private void BindData() { DbQueryResult memberSendedMessages = CommentBrowser.GetMemberSendedMessages(new MessageBoxQuery { PageIndex = this.pager.PageIndex, PageSize = this.pager.PageSize, Sernder = HiContext.Current.User.Username }); this.CmessagesList.DataSource = memberSendedMessages.Data; this.CmessagesList.DataBind(); this.pager.TotalRecords = memberSendedMessages.TotalRecords; }
private IList <AfficheInfo> GetDataSource() { IList <AfficheInfo> afficheList = CommentBrowser.GetAfficheList(true); if (this.MaxNum > 0 && this.MaxNum < afficheList.Count) { for (int num = afficheList.Count - 1; num >= this.MaxNum; num--) { afficheList.RemoveAt(num); } } return(afficheList); }
IList <ArticleCategoryInfo> GetDataSource() { IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories(); if ((this.MaxNum > 0) && (this.MaxNum < articleMainCategories.Count)) { for (int i = articleMainCategories.Count - 1; i >= this.MaxNum; i--) { articleMainCategories.RemoveAt(i); } } return(articleMainCategories); }
private IList <AfficheInfo> GetDataSource() { IList <AfficheInfo> afficheList = CommentBrowser.GetAfficheList(); if (this.MaxNum > 0 && this.MaxNum < afficheList.Count) { for (int i = afficheList.Count - 1; i >= this.MaxNum; i--) { afficheList.RemoveAt(i); } } return(afficheList); }
private IList <ArticleCategoryInfo> GetDataSource() { IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories(); if (this.MaxNum > 0 && this.MaxNum < articleMainCategories.Count) { for (int num = articleMainCategories.Count - 1; num >= this.MaxNum; num--) { articleMainCategories.RemoveAt(num); } } return(articleMainCategories); }
private void BindData() { MessageBoxQuery messageBoxQuery = new MessageBoxQuery(); messageBoxQuery.PageIndex = this.pager.PageIndex; messageBoxQuery.PageSize = this.pager.PageSize; messageBoxQuery.Sernder = HiContext.Current.User.UserName; DbQueryResult memberSendedMessages = CommentBrowser.GetMemberSendedMessages(messageBoxQuery); this.CmessagesList.DataSource = memberSendedMessages.Data; this.CmessagesList.DataBind(); this.pager.TotalRecords = memberSendedMessages.TotalRecords; }
private IList <HelpCategoryInfo> GetDataSource() { IList <HelpCategoryInfo> list = new List <HelpCategoryInfo>(); list = CommentBrowser.GetHelpCategorys(); if (this.MaxNum > 0 && this.MaxNum < list.Count) { for (int i = list.Count - 1; i >= this.MaxNum; i--) { list.RemoveAt(i); } } return(list); }
protected void Category_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { int num = (int)DataBinder.Eval(e.Item.DataItem, "cateGoryId"); Repeater repeater = (Repeater)e.Item.FindControl("rep_article"); IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(num, 1000); if (articleList != null && articleList.Count > 0 && repeater != null) { repeater.DataSource = articleList; repeater.DataBind(); } } }
IList <HelpCategoryInfo> GetDataSource() { IList <HelpCategoryInfo> helpCategorys = new List <HelpCategoryInfo>(); helpCategorys = CommentBrowser.GetHelpCategorys(); if ((this.MaxNum > 0) && (this.MaxNum < helpCategorys.Count)) { for (int i = helpCategorys.Count - 1; i >= this.MaxNum; i--) { helpCategorys.RemoveAt(i); } } return(helpCategorys); }
protected void Category_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { int categoryId = (int)DataBinder.Eval(e.Item.DataItem, "cateGoryId"); Repeater repeater = (Repeater)e.Item.FindControl("rep_article"); IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(categoryId, 0x3e8); if (((articleList != null) && (articleList.Count > 0)) && (repeater != null)) { repeater.DataSource = articleList; repeater.DataBind(); } } }
protected override void AttachChildControls() { PageTitle.AddSiteNameTitle("帮助与反馈"); Member member = HiContext.Current.User as Member; if (member == null) { this.Page.Response.Redirect("/Vshop/Login.aspx"); } this.helpCategories = (VTemplatedRepeater)this.FindControl("helpCategories"); this.helpCategories.DataSource = CommentBrowser.GetHelpCategories(); this.helpCategories.DataBind(); }
public IHttpActionResult HelpCategory(string accessToken, int channel, int platform, string ver) { Logger.WriterLogger("Common.HelpCategory, Params: " + string.Format("accessToken={0}&channel={1}&platform={2}&ver={3}", accessToken, channel, platform, ver), LoggerType.Info); // 保存访问信息 base.SaveVisitInfo("", channel, platform, ver); // 验证令牌 int accessTookenCode = VerifyAccessToken(accessToken); if (accessTookenCode > 0) { return(base.JsonFaultResult(new CommonException(accessTookenCode).GetMessage(), "Common.HelpCategory")); } List <HelpCategoryListItem> items = new List <HelpCategoryListItem>(); IList <HelpCategoryInfo> categories = CommentBrowser.GetHelpCategorys(); if (categories != null) { HelpCategoryListItem item = null; foreach (var current in categories) { item = new HelpCategoryListItem(); item.Id = current.CategoryId ?? 0; item.Name = current.Name; item.Description = current.Description; item.IconUrl = Util.AppendImageHost(current.IconUrl); item.DisplaySequence = current.DisplaySequence; items.Add(item); } } return(base.JsonActionResult(new StandardResult <ListResult <HelpCategoryListItem> >() { code = 0, msg = "", data = new ListResult <HelpCategoryListItem>() { TotalNumOfRecords = items.Count, Results = items } })); }
public void GetHelpContent(System.Web.HttpContext context) { string text = context.Request["helpid"].ToLower(); if (!string.IsNullOrEmpty(text)) { int helpid = 0; int.TryParse(text, out helpid); HelpInfo helpInfo = CommentBrowser.GetHelp(helpid); if (helpInfo != null) { HelpCategoryInfo helpCategory = CommentBrowser.GetHelpCategory(helpInfo.CategoryId); this.message = helpInfo.Content; } } }
public void btnRefer_Click(object sender, System.EventArgs e) { if (!HiContext.Current.CheckVerifyCode(this.txtLeaveCode.Value)) { this.ShowMessage("验证码不正确", false); return; } if (!this.ValidateConvert()) { return; } if (HiContext.Current.User.UserRole != UserRole.Member && !this.userRegion(this.txtLeaveUserName.Value, this.txtLeavePsw.Value)) { return; } LeaveCommentInfo leaveCommentInfo = new LeaveCommentInfo(); leaveCommentInfo.UserName = Globals.HtmlEncode(this.txtUserName.Text); leaveCommentInfo.UserId = new int?(HiContext.Current.User.UserId); leaveCommentInfo.Title = Globals.HtmlEncode(this.txtTitle.Text); leaveCommentInfo.PublishContent = Globals.HtmlEncode(this.txtContent.Text); ValidationResults validationResults = Validation.Validate <LeaveCommentInfo>(leaveCommentInfo, new string[] { "Refer" }); string text = string.Empty; if (!validationResults.IsValid) { foreach (ValidationResult current in (System.Collections.Generic.IEnumerable <ValidationResult>)validationResults) { text += Formatter.FormatErrorMessage(current.Message); } this.ShowMessage(text, false); return; } if (CommentBrowser.InsertLeaveComment(leaveCommentInfo)) { this.Page.ClientScript.RegisterClientScriptBlock(base.GetType(), "success", string.Format("<script>alert(\"{0}\");window.location.href=\"{1}\"</script>", "留言成功,管理员回复后即可显示", Globals.GetSiteUrls().UrlData.FormatUrl("LeaveComments"))); } else { this.ShowMessage("留言失败", false); } this.txtTitle.Text = string.Empty; this.txtContent.Text = string.Empty; }
protected override void AttachChildControls() { this.MessageContent = (System.Web.UI.WebControls.Literal) this.FindControl("MessageContent"); if (!long.TryParse(this.Page.Request.QueryString["MessageId"], out this.MessageId)) { base.GotoResourceNotFound(""); } else { this.MessageContent.Text = CommentBrowser.GetMemberMessage(MessageId).Content; PageTitle.AddSiteNameTitle("消息详情"); WAPHeadName.AddHeadName("消息详情"); } }
private void BindData() { MessageBoxQuery messageBoxQuery = new MessageBoxQuery(); messageBoxQuery.PageIndex = this.pager.PageIndex; messageBoxQuery.PageSize = this.pager.PageSize; messageBoxQuery.Accepter = HiContext.Current.User.Username; DbQueryResult memberReceivedMessages = CommentBrowser.GetMemberReceivedMessages(messageBoxQuery); if (((DataTable)memberReceivedMessages.Data).Rows.Count <= 0) { memberReceivedMessages = CommentBrowser.GetMemberReceivedMessages(messageBoxQuery); } this.CmessagesList.DataSource = memberReceivedMessages.Data; this.CmessagesList.DataBind(); this.pager.TotalRecords = memberReceivedMessages.TotalRecords; }