private void SavePresentExp(DataTable dataTable, bool isAdd) { string userName = PEContext.Current.Admin.UserName; CommonModelInfo commonModelInfoById = null; if (!isAdd) { commonModelInfoById = ContentManage.GetCommonModelInfoById(BasePage.RequestInt32("GeneralID")); userName = commonModelInfoById.Inputer; } UserInfo usersByUserName = Users.GetUsersByUserName(userName); if (!usersByUserName.IsNull) { int statusFromDataTable = GetStatusFromDataTable(dataTable); UserPurviewInfo userPurview = usersByUserName.UserPurview; if (userPurview.IsNull) { userPurview.MaxPublicInfoOneDay = -1; userPurview.GetExp = 1; } if (userPurview.GetExp == 0) { userPurview.GetExp = 1; } int num3 = EasyOne.Contents.Nodes.GetCacheNodeById(this.m_NodeId).Settings.PresentExp *userPurview.GetExp; if (isAdd) { int generalId = GetGeneralId(dataTable); if (statusFromDataTable == 0x63) { usersByUserName.UserExp += num3; usersByUserName.PassedItems++; } usersByUserName.PostItems++; } else { if ((statusFromDataTable == 0x63) && (commonModelInfoById.Status < 0x63)) { usersByUserName.UserExp += num3; usersByUserName.PassedItems++; } if ((commonModelInfoById.Status == 0x63) && (statusFromDataTable < 0x63)) { usersByUserName.UserExp -= num3; usersByUserName.PassedItems--; } if (statusFromDataTable == -2) { usersByUserName.RejectItems++; } if (statusFromDataTable == -3) { usersByUserName.DelItems++; } } Users.Update(usersByUserName); } }
protected void AddToCart() { ShopConfig shopConfig = SiteConfig.ShopConfig; if ((shopConfig.OrderProductNumber != 0) && (shopConfig.OrderProductNumber <= ShoppingCart.GetInfoByCart(this.cartId, false).Count)) { DynamicPage.WriteErrMsg("<li>超出系统所设置的购物车商品种类数量:" + shopConfig.OrderProductNumber + "</li>", "ShoppingCart.aspx"); } ShoppingCartInfo shoppingcartinfo = new ShoppingCartInfo(); int productId = 0; string tableName = string.Empty; CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(BasePage.RequestInt32("ID")); if (commonModelInfoById.IsNull) { DynamicPage.WriteErrMsg("<li>找不到指定的商品</li>"); } else { productId = commonModelInfoById.ItemId; tableName = commonModelInfoById.TableName; } int num3 = Order.CountBuyNum(PEContext.Current.User.UserName, productId); ProductInfo productById = Product.GetProductById(productId); int minimum = DataConverter.CLng(this.Page.Request.QueryString["Num"]); if ((productById.Minimum > minimum) && (productById.Minimum > 0)) { minimum = productById.Minimum; } else if (minimum == 0) { minimum = 1; } if ((productById.LimitNum > 0) && ((num3 + minimum) > productById.LimitNum)) { DynamicPage.WriteErrMsg(string.Concat(new object[] { "您订购了", num3, productById.Unit, productById.ProductName, ",曾经购买了", num3, productById.Unit, ",而此商品每人限购数量为", productById.LimitNum, productById.Unit, ",请重新调整您的购物车!" }), "ShoppingCart.aspx"); } string property = DataSecurity.FilterBadChar(BasePage.RequestString("Property")); if (!this.ProductExist(this.cartId, productId, tableName, property)) { if (Product.IsEnableSale(productId, tableName, property, this.cartId)) { shoppingcartinfo.Quantity = minimum; shoppingcartinfo.ProductId = productId; shoppingcartinfo.TableName = tableName; shoppingcartinfo.Property = property; shoppingcartinfo.UserName = this.m_UserName; shoppingcartinfo.UpdateTime = DateTime.Now; shoppingcartinfo.IsPresent = false; shoppingcartinfo.CartId = this.cartId; ShoppingCart.Add(shoppingcartinfo); } else { DynamicPage.WriteErrMsg(Product.ErrMsgOfEnableSale); } } }
private void AdminEditCheck(int generalId) { string str = "CanNotEdit"; if (PEContext.Current.Admin.Identity.IsAuthenticated) { int nodeId = ContentManage.GetCommonModelInfoById(generalId).NodeId; bool flag = false; if (PEContext.Current.Admin.IsSuperAdmin) { flag = true; } else { bool flag2 = false; bool flag3 = false; bool flag4 = false; flag2 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentCheck, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentCheck, nodeId); flag3 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, nodeId); flag4 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, nodeId); if ((flag2 || flag4) || flag3) { flag = true; } } if (flag) { str = "OK"; } } this.XmlResponseWriter.WriteElementString("status", str); }
public void GetProductAllDataById(int generalId) { EasyOne.Model.Contents.CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(generalId); if (!commonModelInfoById.IsNull) { this.m_CommonModelInfo = commonModelInfoById; this.m_ProductInfoData = GetProductById(generalId, commonModelInfoById.ItemId, commonModelInfoById.TableName); } }
protected void Page_Load(object sender, EventArgs e) { int generalId = BasePage.RequestInt32("itemid"); if (PEContext.Current.Admin.Identity.IsAuthenticated) { CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(generalId); int nodeId = commonModelInfoById.NodeId; bool flag = false; if (PEContext.Current.Admin.IsSuperAdmin) { flag = true; } else { bool flag2 = false; bool flag3 = false; bool flag4 = false; flag2 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentCheck, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentCheck, nodeId); flag3 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, nodeId); flag4 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, nodeId); if ((flag2 || flag4) || flag3) { flag = true; } } if (flag) { string manageDir = SiteConfig.SiteOption.ManageDir; ModelInfo modelInfoById = ModelManager.GetModelInfoById(commonModelInfoById.ModelId); if (modelInfoById.IsEshop) { this.Session["IndexRightUrl"] = string.Concat(new object[] { base.BasePath, manageDir, "/shop/", modelInfoById.AddInfoFilePath, "?Action=Modify&NodeID=", commonModelInfoById.NodeId.ToString(), "&GeneralID=", generalId, "&ModelID=", commonModelInfoById.ModelId.ToString(), "&LinkType=", commonModelInfoById.LinkType }); } else { this.Session["IndexRightUrl"] = string.Concat(new object[] { base.BasePath, manageDir, "/Contents/", modelInfoById.AddInfoFilePath, "?Action=Modify&NodeID=", commonModelInfoById.NodeId.ToString(), "&GeneralID=", generalId, "&ModelID=", commonModelInfoById.ModelId.ToString(), "&LinkType=", commonModelInfoById.LinkType }); } BasePage.ResponseRedirect("~/" + manageDir + "/Index.aspx"); } else { BasePage.ResponseRedirect("~/Item/" + generalId + ".aspx"); } } else { BasePage.ResponseRedirect("~/Item/" + generalId + ".aspx"); } }
protected override void Render(HtmlTextWriter writer) { if (!this.Page.IsPostBack) { int generalId = BasePage.RequestInt32("id"); string str = BasePage.RequestStringToLower("HitsType"); this.modelInfo = ContentManage.GetCommonModelInfoById(generalId); if (string.IsNullOrEmpty(str)) { this.UpdateHits(generalId); } this.ShowHits(generalId, str); } }
private void UpdateHits(int id) { CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(id); if (!commonModelInfoById.IsNull) { DateTime time; if (!commonModelInfoById.LastHitTime.HasValue) { time = DateTime.Now; } else { time = commonModelInfoById.LastHitTime.Value; } this.hits = commonModelInfoById.Hits + 1; this.dayHits = commonModelInfoById.DayHits; this.weekHits = commonModelInfoById.WeekHits; this.monthHits = commonModelInfoById.MonthHits; DateTime now = DateTime.Now; if (string.Compare(time.ToShortDateString(), DateTime.Now.ToShortDateString(), StringComparison.OrdinalIgnoreCase) == 0) { this.dayHits++; } else { this.dayHits = 1; } DateTime time3 = now.AddDays((double)-this.GetDays(now.DayOfWeek)); DateTime time4 = time3.AddDays(7.0); if ((DateTime.Compare(time, time3) >= 0) && (DateTime.Compare(time, time4) <= 0)) { this.weekHits++; } else { this.weekHits = 1; } if ((string.Compare(time.Year.ToString(), now.Year.ToString(), StringComparison.Ordinal) == 0) && (string.Compare(time.Month.ToString(), now.Month.ToString(), StringComparison.Ordinal) == 0)) { this.monthHits++; } else { this.monthHits = 1; } time = DateTime.Now; ContentManage.UpdateHits(id, this.hits, this.dayHits, this.weekHits, this.monthHits, time); } }
protected void Page_PreRender(object sender, EventArgs e) { base.Response.Clear(); base.Response.Buffer = true; base.Response.Charset = "utf-8"; base.Response.AddHeader("contenttype", "text/vnd.wap.wml"); base.Response.ContentEncoding = Encoding.GetEncoding("utf-8"); base.Response.ContentType = "text/vnd.wap.wml"; this.m_GeneralId = BasePage.RequestInt32("id"); if (this.m_GeneralId <= 0) { base.Response.End(); } this.m_ItemInfo = ContentManage.GetCommonModelInfoById(this.m_GeneralId); if (this.m_ItemInfo.IsNull) { base.Response.End(); } else { this.m_ModelInfo = ModelManager.GetModelInfoById(this.m_ItemInfo.ModelId); if (!this.m_ModelInfo.IsEshop && (this.m_ItemInfo.Status != 0x63)) { base.Response.End(); } } TemplateInfo templateInfo = new TemplateInfo(); templateInfo.QueryList = base.Request.QueryString; templateInfo.PageName = DynamicPage.RebuildPageName(base.Request.Url.LocalPath, base.Request.QueryString); string path = "/其他模板/Wap内容页模板.html"; foreach (FrontTemplate template in SiteConfig.FrontTemplateList) { if (string.Compare(this.PageFileName, template.Key, true, CultureInfo.CurrentCulture) == 0) { path = template.Value; break; } } templateInfo.TemplateContent = Template.GetTemplateContent(path); templateInfo.RootPath = HttpContext.Current.Request.PhysicalApplicationPath; templateInfo.CurrentPage = DataConverter.CLng(base.Request.QueryString["page"], 1); templateInfo = TemplateTransform.GetHtml(templateInfo); base.Response.Write(templateInfo.TemplateContent); base.Response.End(); }
public static bool Update(int generalId, ProductInfo productInfo, IList <ProductDataInfo> dataInfoList, IList <ProductPriceInfo> priceInfoList) { EasyOne.Model.Contents.CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(generalId); if (commonModelInfoById.IsNull) { return(false); } productInfo.ProductId = commonModelInfoById.ItemId; string tableName = commonModelInfoById.TableName; if (commonModelInfoById.LinkType == 1) { return(dalContentManage.UpdateCommonModel(generalId, productInfo.Fields)); } int num = 0; int num2 = 0; foreach (ProductDataInfo info2 in dataInfoList) { num += info2.Stocks; num2 += info2.AlarmNum; } if (num > 0) { productInfo.Stocks = num; } if (num2 > 0) { productInfo.AlarmNum = num2; } if (num2 > num) { num2 = num; } if (!dalContentManage.UpdateCommonModel(generalId, productInfo.Fields) || !ProductCommon.Update(productInfo, tableName)) { return(false); } dal.Update(productInfo, tableName); if (!string.IsNullOrEmpty(productInfo.Properties) && !ProductData.Update(productInfo.ProductId, tableName, dataInfoList)) { return(false); } return((priceInfoList == null) || ProductPrice.Update(productInfo.ProductId, tableName, priceInfoList)); }
public override void OnInitTemplatePage(EventArgs e) { this.m_GeneralId = BasePage.RequestInt32("id"); if (this.m_GeneralId <= 0) { TemplatePage.WriteErrMsg("您访问的内容信息不存在", "Default.aspx"); } this.m_ItemInfo = ContentManage.GetCommonModelInfoById(this.m_GeneralId); if (this.m_ItemInfo == null) { TemplatePage.WriteErrMsg("您访问的内容信息不存在", "Default.aspx"); } this.m_NodeInfo = Nodes.GetCacheNodeById(this.m_ItemInfo.NodeId); this.m_ModelInfo = ModelManager.GetModelInfoById(this.m_ItemInfo.ModelId); if (this.m_ModelInfo.IsNull || string.IsNullOrEmpty(this.m_ModelInfo.PrintTemplate)) { TemplatePage.WriteErrMsg("没有指定模型打印页模板", "Default.aspx"); } this.CheckPermission(); }
protected void EBtnPass_Click(object sender, EventArgs e) { this.PermissionDetection(this.m_isCheck); StringBuilder selectList = this.EgvContent.SelectList; if (selectList.Length == 0) { AdminPage.WriteErrMsg("<li>对不起,您还没选择要审核的项目!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID")); } else { int nodeWorkFlowId = Nodes.GetNodeWorkFlowId(this.m_NodeId); RolePermissions.BusinessAccessCheck(OperateCode.NodeContentCheck, this.m_NodeId); if (this.m_Administrator) { UpdateStatus(selectList.ToString(), 0x63, SiteConfig.SmsConfig.IsAutoSendStateMessage, this.EgvContent, this.m_Administrator); } else if (Nodes.GetNodeById(BasePage.RequestInt32("NodeID")).Child == 0) { UpdateStatus(selectList.ToString(), UserPass(nodeWorkFlowId), SiteConfig.SmsConfig.IsAutoSendStateMessage, this.EgvContent, this.m_Administrator); } else { CommonModelInfo info2 = new CommonModelInfo(); if (selectList.ToString().IndexOf(",", StringComparison.Ordinal) > 0) { foreach (string str in selectList.ToString().Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)) { nodeWorkFlowId = Nodes.GetNodeWorkFlowId(Nodes.GetNodeById(ContentManage.GetCommonModelInfoById(DataConverter.CLng(str)).NodeId).WorkFlowId); ContentManage.UpdateStatus(str, UserPass(nodeWorkFlowId)); } AdminPage.WriteSuccessMsg("<li>审核通过!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID")); } else { nodeWorkFlowId = Nodes.GetNodeWorkFlowId(Nodes.GetNodeById(ContentManage.GetCommonModelInfoById(DataConverter.CLng(selectList.ToString())).NodeId).WorkFlowId); UpdateStatus(selectList.ToString(), UserPass(nodeWorkFlowId), SiteConfig.SmsConfig.IsAutoSendStateMessage, this.EgvContent, this.m_Administrator); } } } }
private void BatchAddToCart() { string str = BasePage.RequestString("IDList"); if (string.IsNullOrEmpty(str)) { DynamicPage.WriteErrMsg("对不起,传递的参数不正确,请从正确的路径访问!"); } foreach (string str2 in str.Split(new char[] { ',' })) { string[] strArray2 = str2.Split(new string[] { "$$$" }, StringSplitOptions.RemoveEmptyEntries); string property = string.Empty; if (strArray2.Length == 3) { property = strArray2[2]; } int generalId = DataConverter.CLng(strArray2[0]); int num2 = DataConverter.CLng(strArray2[1], 1); ShoppingCartInfo shoppingcartinfo = new ShoppingCartInfo(); int productId = 0; string tableName = string.Empty; CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(generalId); if (!commonModelInfoById.IsNull) { productId = commonModelInfoById.ItemId; tableName = commonModelInfoById.TableName; } if (!this.ProductExist(this.cartId, productId, tableName, property) && Product.IsEnableSale(productId, tableName, property, this.cartId)) { shoppingcartinfo.Quantity = num2; shoppingcartinfo.ProductId = productId; shoppingcartinfo.TableName = tableName; shoppingcartinfo.Property = property; shoppingcartinfo.UserName = this.m_UserName; shoppingcartinfo.UpdateTime = DateTime.Now; shoppingcartinfo.IsPresent = false; shoppingcartinfo.CartId = this.cartId; ShoppingCart.Add(shoppingcartinfo); } } }
public override void OnInitTemplatePage(EventArgs e) { this.m_GeneralId = BasePage.RequestInt32("id"); if (this.m_GeneralId <= 0) { TemplatePage.WriteErrMsg("您访问的内容信息不存在", base.BasePath + "Default.aspx"); } this.m_ItemInfo = ContentManage.GetCommonModelInfoById(this.m_GeneralId); if (this.m_ItemInfo.IsNull) { TemplatePage.WriteErrMsg("您访问的内容信息不存在", base.BasePath + "Default.aspx"); } else { this.m_ModelInfo = ModelManager.GetModelInfoById(this.m_ItemInfo.ModelId); if (!this.m_ModelInfo.IsEshop && (this.m_ItemInfo.Status != 0x63)) { TemplatePage.WriteErrMsg("您访问的内容信息需要经过审核才能浏览", base.BasePath + "Default.aspx"); } } this.m_NodeInfo = Nodes.GetCacheNodeById(this.m_ItemInfo.NodeId); }
public bool Delete(string generalIdList) { string[] strArray = generalIdList.Split(new char[] { ',' }); ContentManage manage = new ContentManage(); ProductCommon common = new ProductCommon(); ProductData data = new ProductData(); ProductPrice price = new ProductPrice(); for (int i = 0; i < strArray.Length; i++) { CommonModelInfo commonModelInfoById = manage.GetCommonModelInfoById(DataConverter.CLng(strArray[i])); if (!commonModelInfoById.IsNull && (DataConverter.CLng(commonModelInfoById.LinkType) == 0)) { manage.DeleteVirtualContent(DataConverter.CLng(strArray[i])); DBHelper.ExecuteSql("DELETE FROM " + DBHelper.FilterBadChar(commonModelInfoById.TableName) + " WHERE ID = " + commonModelInfoById.ItemId.ToString()); common.DeleteById(commonModelInfoById.ItemId, commonModelInfoById.TableName); data.DeleteByProduct(commonModelInfoById.ItemId, commonModelInfoById.TableName); price.Delete(commonModelInfoById.ItemId, commonModelInfoById.TableName); } } return(DBHelper.ExecuteSql("DELETE FROM PE_CommonModel WHERE GeneralId IN(" + DBHelper.ToValidId(generalIdList) + ")")); }
protected void EgvContent_RowCommand(object sender, CommandEventArgs e) { if (e.CommandName == "DeleteContent") { int generalId = DataConverter.CLng(e.CommandArgument.ToString()); CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(generalId); this.m_IsInput = this.CheckUserConentInputPurview(commonModelInfoById.NodeId); if (!this.m_IsInput) { DynamicPage.WriteUserErrMsg("<li>没有删除权限!</li>"); } if (ContentManage.UpdateStatusByUserName(e.CommandArgument.ToString(), -3)) { PermissionContent.Delete(generalId); ContentCharge.Delete(generalId); DynamicPage.WriteUserSuccessMsg("<li>删除成功!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID")); } else { DynamicPage.WriteUserErrMsg("<li>删除失败!</li>"); } } }
private void AddComment(XmlDocument xmlDoc) { CommentInfo commentInfo = new CommentInfo(); commentInfo.CommentTitle = GetNodeInnerText(xmlDoc, "//commenttitle"); if (!HttpContext.Current.User.Identity.IsAuthenticated) { commentInfo.UserName = "******"; } else { commentInfo.UserName = PEContext.Current.User.UserName; } commentInfo.Content = GetNodeInnerText(xmlDoc, "//content"); commentInfo.Email = GetNodeInnerText(xmlDoc, "//email"); commentInfo.Face = GetNodeInnerText(xmlDoc, "//face"); commentInfo.GeneralId = DataConverter.CLng(GetNodeInnerText(xmlDoc, "//gid")); commentInfo.NodeId = DataConverter.CLng(GetNodeInnerText(xmlDoc, "//nid")); commentInfo.TopicId = DataConverter.CLng(GetNodeInnerText(xmlDoc, "//tid")); commentInfo.IsPrivate = DataConverter.CBoolean(GetNodeInnerText(xmlDoc, "//private", "true")); commentInfo.Position = DataConverter.CLng(GetNodeInnerText(xmlDoc, "//position")); commentInfo.Score = DataConverter.CLng(GetNodeInnerText(xmlDoc, "//score", "3")); commentInfo.IP = this.GetClientIP(); commentInfo.UpdateDateTime = DateTime.Now.ToLocalTime(); commentInfo.ReplyUserName = GetNodeInnerText(xmlDoc, "//username", "游客"); int num = string.Compare(commentInfo.UserName, "游客", StringComparison.OrdinalIgnoreCase); string str = ""; NodeInfo cacheNodeById = Nodes.GetCacheNodeById(ContentManage.GetCommonModelInfoById(commentInfo.GeneralId).NodeId); commentInfo.Status = cacheNodeById.Settings.CommentNeedCheck; UserPurviewInfo userPurview = null; if (num != 0) { userPurview = PEContext.Current.User.UserInfo.UserPurview; if (userPurview.CommentNeedCheck) { commentInfo.Status = true; } else { commentInfo.Status = !cacheNodeById.Settings.CommentNeedCheck; } } else if (!cacheNodeById.Settings.EnableTouristsComment) { str = "noTourists"; } else { commentInfo.Status = !cacheNodeById.Settings.CommentNeedCheck; } bool enableComment = false; bool commentNeedCheck = false; if (userPurview != null) { enableComment = userPurview.EnableComment; commentNeedCheck = userPurview.CommentNeedCheck; } if (string.IsNullOrEmpty(str)) { if (cacheNodeById.Settings.EnableComment || enableComment) { if (Comment.Add(commentInfo)) { if (commentInfo.Status || commentNeedCheck) { str = "ok"; } else { str = "check"; } } else { str = "err"; } } else { str = "nopurview"; } } this.XmlResponseWriter.WriteElementString("status", str); }
private void ErrorUrlData(int type, int id) { if (type == 1) { DataTable contentDataById = ContentManage.GetContentDataById(id); if (contentDataById == null) { DynamicPage.WriteErrMsg("对不起,错误的参数!"); } if (contentDataById.Rows.Count > 0) { string str = contentDataById.Rows[0]["DownloadUrl"].ToString(); string str2 = contentDataById.Rows[0]["arrServerName"].ToString(); DataTable table2 = new DataTable(); table2.Columns.Add("urlId", typeof(int)); table2.Columns.Add("infoId", typeof(int)); table2.Columns.Add("urlname", typeof(string)); table2.Columns.Add("serverId", typeof(int)); if (string.IsNullOrEmpty(str)) { CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(id); DataRow row = table2.NewRow(); row["urlId"] = 0; row["infoId"] = id; row["urlname"] = commonModelInfoById.Title; row["serverId"] = 0; table2.Rows.Add(row); } else { int num = 0; if (string.IsNullOrEmpty(str2)) { foreach (string str3 in str.Split(new string[] { "$$$" }, StringSplitOptions.RemoveEmptyEntries)) { string[] strArray2 = str3.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries); DataRow row2 = table2.NewRow(); row2["urlId"] = num; row2["infoId"] = id; row2["urlname"] = strArray2[0]; row2["serverId"] = 0; table2.Rows.Add(row2); num++; } } else { string[] strArray3 = str.Split(new string[] { "$$$" }, StringSplitOptions.RemoveEmptyEntries); num = 0; string[] strArray10 = strArray3; for (int i = 0; i < strArray10.Length; i++) { string text1 = strArray10[i]; foreach (string str4 in str2.Split(new string[] { "$$$" }, StringSplitOptions.RemoveEmptyEntries)) { string[] strArray5 = str4.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries); DataRow row3 = table2.NewRow(); row3["urlId"] = num; row3["infoId"] = id; row3["urlname"] = strArray5[0]; row3["serverId"] = strArray5[1]; table2.Rows.Add(row3); } num++; } } } this.EgvDownloadError.DataSource = table2; this.EgvDownloadError.DataBind(); } else { DynamicPage.WriteErrMsg("对不起,错误的参数!"); } } else { CommonModelInfo info2 = ContentManage.GetCommonModelInfoById(id); if (info2.IsNull) { DynamicPage.WriteErrMsg("对不起,错误的参数!"); } DataTable table3 = new DataTable(); table3.Columns.Add("urlId", typeof(int)); table3.Columns.Add("infoId", typeof(int)); table3.Columns.Add("urlname", typeof(string)); table3.Columns.Add("serverId", typeof(int)); DataRow row4 = table3.NewRow(); row4["urlId"] = 0; row4["infoId"] = id; row4["urlname"] = info2.Title; row4["serverId"] = 0; table3.Rows.Add(row4); this.EgvDownloadError.DataSource = table3; this.EgvDownloadError.DataBind(); } }
protected void RptCommentManage_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { ExtendedLiteral literal = e.Item.FindControl("LblCommentHead") as ExtendedLiteral; Label label = e.Item.FindControl("LblStatus") as Label; Label label2 = e.Item.FindControl("LblManage") as Label; ExtendedLiteral literal2 = e.Item.FindControl("LblRestore") as ExtendedLiteral; Label label3 = e.Item.FindControl("LblRestoreBottom") as Label; ExtendedLiteral literal3 = e.Item.FindControl("LblContent") as ExtendedLiteral; ExtendedLiteral literal4 = e.Item.FindControl("LblContentTitle") as ExtendedLiteral; ExtendedLiteral literal5 = e.Item.FindControl("LblRestoreTitle") as ExtendedLiteral; CommentInfo dataItem = (CommentInfo)e.Item.DataItem; string nodeIds = dataItem.NodeId.ToString(); if (!this.m_Administrator) { NodeInfo cacheNodeById = Nodes.GetCacheNodeById(dataItem.NodeId); if (cacheNodeById.ParentId > 0) { nodeIds = cacheNodeById.ParentPath + "," + nodeIds; } } string title = ContentManage.GetCommonModelInfoById(dataItem.GeneralId).Title; string str3 = "CommentID=" + dataItem.CommentId.ToString() + "&GeneralID=" + dataItem.GeneralId.ToString() + "&NodeID=" + BasePage.RequestInt32("NodeID").ToString() + "&Title=" + base.Server.UrlEncode(title) + "&UserId=" + dataItem.UserId.ToString(); if ((this.m_PrevId != dataItem.GeneralId) && (this.m_PrevId != 0)) { label3.Visible = true; label3.Text = "</table></td></tr></table><br/>"; } if ((this.m_PrevId != dataItem.GeneralId) || (this.m_PrevId == 0)) { StringBuilder builder = new StringBuilder(); builder.Append("<table class='border' width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>"); builder.Append("<tr class='title'>"); builder.Append("<td width='80%' height='22'>"); builder.Append(" <a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentManage, "href='ContentView.aspx?GeneralID=" + dataItem.GeneralId.ToString() + "'") + " >"); StringBuilder builder2 = new StringBuilder(); builder2.Append("</a> 总评分:" + Comment.ScoreCount(dataItem.GeneralId).ToString() + "</td>"); builder2.Append("<td width='20%' align='right'>"); builder2.Append("<a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentManage, "href='CommentManage.aspx?Action=DelAll&" + str3 + "' onclick=\"return confirm('确定要删除此项目下的所有评论吗?');\"") + ">删除此项目下的所有评论</a> </td>"); builder2.Append("</tr><tr><td colspan='2'>"); builder2.Append("<table border='0' cellspacing='1' width='100%' cellpadding='0' style='word-break:break-all'>"); builder2.Append("</td>"); builder2.Append("</tr>"); literal.Visible = true; literal.BeginTag = builder.ToString(); literal.Text = title; literal.EndTag = builder2.ToString(); } this.m_PrevId = dataItem.GeneralId; StringBuilder builder3 = new StringBuilder(); string replyUserName = ""; if (dataItem.UserName == "游客") { builder3.Append("[游客] "); replyUserName = dataItem.ReplyUserName; } else { builder3.Append("[会员] "); replyUserName = dataItem.UserName; } StringBuilder builder4 = new StringBuilder(); builder4.Append(" 于 " + dataItem.UpdateDateTime.ToString("yyyy年MM月dd日 HH时mm分ss秒") + " 发表如下评论内容,同时评分:" + dataItem.Score.ToString() + "分"); builder4.Append("<br/>"); literal4.BeginTag = builder3.ToString(); literal4.Text = replyUserName; literal4.EndTag = builder4.ToString(); literal3.BeginTag = " <span >"; if (dataItem.Content.Length > 120) { literal3.Text = dataItem.Content.Substring(0, 120) + "..."; } else { literal3.Text = dataItem.Content; } literal3.EndTag = "</span>"; if (!dataItem.Status) { label.Text = "<span style='color:red'>\x00d7</span>"; } else { label.Text = "√"; } StringBuilder builder5 = new StringBuilder(); builder5.Append("<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr>"); builder5.Append("<td align='center' style='width:30px;'>"); if (string.IsNullOrEmpty(dataItem.Reply)) { builder5.Append("<a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentReply, "href='CommentRestore.aspx?" + str3 + "'") + ">回复</a>"); } builder5.Append("</td>"); builder5.Append("<td align='center' style='width:35px;'><a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentManage, "href='CommentModify.aspx?Action=Modify&" + str3 + "'") + " >修改</a></td>"); builder5.Append("<td align='center' style='width:35px;'><a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentManage, "href='CommentManage.aspx?Action=Del&" + str3 + "' onclick=\"return confirm('确定要删除此评论吗?');\"") + " >删除</a></td>"); builder5.Append("<td align='center' style='width:50px;'>"); if (!dataItem.Status) { builder5.Append("<a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentCheck, "href='CommentManage.aspx?Action=SetPassed&" + str3 + "'") + " onclick=\"if(!confirm('确定要通过此评论吗?')){return false;}\" >通过审核</a>"); } else { builder5.Append("<a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentCheck, "href='CommentManage.aspx?Action=CancelPassed&" + str3 + "'") + " onclick=\"if(!confirm('确定要取消此评论吗?')){return false;}\" >取消审核</a>"); } builder5.Append("</td>"); builder5.Append("</tr></table>"); label2.Text = builder5.ToString(); if (!string.IsNullOrEmpty(dataItem.Reply)) { string reply = dataItem.Reply; if (dataItem.Reply.Length > 20) { reply = reply.Substring(0, 20) + ".."; } StringBuilder builder6 = new StringBuilder(); builder6.Append("<tr class='tdbg' onmouseout=\"this.className='tdbg'\" onmouseover=\"this.className='tdbgmouseover'\">"); builder6.Append("<td align='center'> </td>"); builder6.Append(" <td colspan='2' align='left'>[管理员] "); literal5.BeginTag = builder6.ToString(); literal5.Text = dataItem.ReplyAdmin; literal5.EndTag = " 于 " + dataItem.ReplyDateTime.ToString("yyyy年MM月dd日 HH时mm分ss秒"); literal2.BeginTag = " 回复:<br/>"; literal2.Text = dataItem.Reply; StringBuilder builder7 = new StringBuilder(); builder7.Append("<td align='center'>"); builder7.Append("<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr><td align='center' style='width:30px;'></td>"); builder7.Append("<td align='center' style='width:35px;'><a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentManage, "href='CommentReplyModify.aspx?Action=Reply&" + str3 + "'") + " >修改</a></td>"); builder7.Append("<td align='center' style='width:35px;'><a " + this.CheckCommentPermissions(nodeIds, this.m_NodeCommentManage, "href='CommentManage.aspx?Action=DelReply&" + str3 + "' onclick=\"return confirm('确定要删除此评论的管理员回复吗?');\" ") + " >删除</a></td>"); builder7.Append("<td align='center' style='width:50px;'></td></tr></table></td>"); builder7.Append("</tr>"); literal2.EndTag = builder7.ToString(); literal2.Visible = true; literal5.Visible = true; } } }
protected void Page_Load(object sender, EventArgs e) { string str = BasePage.RequestString("Action"); int generalId = BasePage.RequestInt32("GeneralID"); this.m_GeneralId = generalId.ToString(); this.m_NodeId = BasePage.RequestInt32("NodeID").ToString(); this.m_ModelId = BasePage.RequestInt32("ModelID").ToString(); string str2 = BasePage.RequestString("ContentFieldName"); if (generalId <= 0) { AdminPage.WriteErrMsg("<li>参数不全,请返回!</li>"); } CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(generalId); this.m_NodeId = commonModelInfoById.NodeId.ToString(); NodeInfo cacheNodeById = EasyOne.Contents.Nodes.GetCacheNodeById(commonModelInfoById.NodeId); DataTable contentDataById = ContentManage.GetContentDataById(generalId); if ((contentDataById == null) || (contentDataById.Rows.Count == 0)) { AdminPage.WriteErrMsg("<li>指定项目不存在!</li>"); } if (cacheNodeById.IsNull || commonModelInfoById.IsNull) { AdminPage.WriteErrMsg("<li>请检查栏目或项目是否已被删除!</li>"); } string str3 = str; if (str3 != null) { if (!(str3 == "Add")) { if (str3 == "Modify") { this.LblType.Text = "修改项目成功"; } } else { this.LblType.Text = "添加项目成功"; } } this.LblNode.Text = cacheNodeById.NodeName; this.LblTitle.Text = commonModelInfoById.Title; this.Author.Style.Add("display", "none"); this.CopyFrom.Style.Add("display", "none"); this.Keylord.Style.Add("display", "none"); StringBuilder builder = new StringBuilder(); builder.Append("<a href=\""); string tableName = commonModelInfoById.TableName; if (tableName != null) { if (!(tableName == "PE_U_Article")) { if (tableName == "PE_U_Photo") { builder.Append("PhotoPreview.aspx"); goto Label_0383; } if (tableName == "PE_U_Soft") { builder.Append("SoftPreview.aspx"); goto Label_0383; } } else { this.Author.Style.Add("display", ""); this.CopyFrom.Style.Add("display", ""); this.Keylord.Style.Add("display", ""); foreach (FieldInfo info3 in ModelManager.GetFieldListByModelId(commonModelInfoById.ModelId)) { string fieldName = info3.FieldName; if (fieldName != null) { if (!(fieldName == "Author")) { if (fieldName == "CopyFrom") { goto Label_02BD; } if (fieldName == "Keyword") { goto Label_02E6; } } else { this.LblAuthor.Text = contentDataById.Rows[0]["Author"].ToString(); } } continue; Label_02BD: this.LblCopyFrom.Text = contentDataById.Rows[0]["CopyFrom"].ToString(); continue; Label_02E6: if (contentDataById.Rows[0]["Keyword"] != null) { this.LblKeylord.Text = StringHelper.ReplaceChar(contentDataById.Rows[0]["Keyword"].ToString(), '|', ' '); } } builder.Append("ArticlePreview.aspx"); goto Label_0383; } } builder.Append("ContentView.aspx"); Label_0383 :; builder.Append("?GeneralID=" + this.m_GeneralId + "&NodeID=" + this.m_NodeId + "&ModelID=" + this.m_ModelId); builder.Append("\">查看内容</a>"); this.ShowContentPreview.Text = builder.ToString(); switch (commonModelInfoById.Status) { case -3: this.LblStatus.Text = "删除"; break; case -2: this.LblStatus.Text = "退稿"; break; case -1: this.LblStatus.Text = "草稿"; break; case 0: this.LblStatus.Text = "待审核"; break; case 0x63: this.LblStatus.Text = "终审通过"; break; default: foreach (StatusInfo info4 in Status.GetStatusList()) { if (info4.StatusId == commonModelInfoById.Status) { this.LblStatus.Text = info4.StatusName; } break; } break; } if (!string.IsNullOrEmpty(str2)) { this.SavePemotePic(str2, commonModelInfoById, cacheNodeById, contentDataById); } }
protected void BtnSubmit_Click(object sender, EventArgs e) { int num = BasePage.RequestInt32("NodeId"); if (num < 1) { DynamicPage.WriteErrMsg("<li>请选择隶属栏目!</li>"); } CommentInfo commentInfo = new CommentInfo(); if (!HttpContext.Current.User.Identity.IsAuthenticated) { commentInfo.UserName = "******"; } else { commentInfo.UserName = PEContext.Current.User.UserName; } commentInfo.GeneralId = BasePage.RequestInt32("ID"); commentInfo.TopicId = 1; commentInfo.NodeId = num; commentInfo.CommentTitle = StringHelper.RemoveXss(this.TxtCommentTitle.Text); commentInfo.Content = StringHelper.RemoveXss(this.TxtCommentRestore.Text); commentInfo.UpdateDateTime = DateTime.Now; commentInfo.Score = DataConverter.CLng(this.RadlScore.SelectedValue); commentInfo.Position = DataConverter.CLng(this.RadlPosition.SelectedValue); commentInfo.IP = PEContext.Current.UserHostAddress; commentInfo.IsPrivate = this.ChkIsPrivate.Checked; int num2 = string.Compare(commentInfo.UserName, "游客", StringComparison.CurrentCultureIgnoreCase); CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(commentInfo.GeneralId); if (commonModelInfoById.IsNull) { DynamicPage.WriteErrMsg("<li>评论不存在,请检查评论是否被删除!</li>"); } NodeInfo cacheNodeById = Nodes.GetCacheNodeById(commonModelInfoById.NodeId); if (cacheNodeById.IsNull) { DynamicPage.WriteErrMsg("<li>栏目不存在,请检查栏目!</li>"); } commentInfo.Status = cacheNodeById.Settings.CommentNeedCheck; UserPurviewInfo userPurview = null; if (num2 != 0) { userPurview = PEContext.Current.User.UserInfo.UserPurview; if (userPurview.CommentNeedCheck) { commentInfo.Status = true; } else { commentInfo.Status = !cacheNodeById.Settings.CommentNeedCheck; } } else if (!cacheNodeById.Settings.EnableTouristsComment) { DynamicPage.WriteErrMsg("<li>此栏目已禁止游客发表评论!</li>"); } else { commentInfo.Status = !cacheNodeById.Settings.CommentNeedCheck; } bool enableComment = false; bool commentNeedCheck = false; if (userPurview != null) { enableComment = userPurview.EnableComment; commentNeedCheck = userPurview.CommentNeedCheck; } if (cacheNodeById.Settings.EnableComment || enableComment) { if (Comment.Add(commentInfo)) { string returnurl = "../Item/" + BasePage.RequestInt32("ID").ToString() + ".aspx"; if (commentInfo.Status || commentNeedCheck) { DynamicPage.WriteSuccessMsg("<li>添加评论成功!</li>", returnurl); } else { DynamicPage.WriteSuccessMsg("<li>发表评论成功,请等待管理员审核。</li>", returnurl); } } else { DynamicPage.WriteErrMsg("<li>添加评论失败,请返回!</li>"); } } else { DynamicPage.WriteErrMsg("<li>此栏目已禁止发表评论!</li>"); } }
public static bool Delete(int generalId) { CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(generalId); return(((!commonModelInfoById.IsNull && commonModelInfoById.IsEshop) && (commonModelInfoById.LinkType == 0)) && dal.Delete(commonModelInfoById.ItemId, commonModelInfoById.TableName)); }
protected void RptCommentManage_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { ExtendedLiteral literal = e.Item.FindControl("LblCommentHead") as ExtendedLiteral; Label label = e.Item.FindControl("LblStatus") as Label; Label label2 = e.Item.FindControl("LblManage") as Label; ExtendedLabel label3 = e.Item.FindControl("LblRestore") as ExtendedLabel; Label label4 = e.Item.FindControl("LblRestoreBottom") as Label; ExtendedLabel label5 = e.Item.FindControl("LblContent") as ExtendedLabel; Label label6 = e.Item.FindControl("LblUserRegTime") as Label; CommentInfo dataItem = (CommentInfo)e.Item.DataItem; string str = "CommentID=" + dataItem.CommentId.ToString() + "&GeneralID=" + dataItem.GeneralId.ToString() + "&NodeID=" + BasePage.RequestInt32("NodeID").ToString(); if ((this.m_PrevId != dataItem.GeneralId) && (this.m_PrevId != 0)) { label4.Visible = true; label4.Text = "</table></td></tr></table><br/>"; } if ((this.m_PrevId != dataItem.GeneralId) || (this.m_PrevId == 0)) { string title = ContentManage.GetCommonModelInfoById(dataItem.GeneralId).Title; StringBuilder builder = new StringBuilder(); builder.Append("<table class='border' width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>"); builder.Append("<tr class='title'>"); builder.Append("<td width='80%' height='22'>"); builder.Append(" "); if (!string.IsNullOrEmpty(title) && (title.Length > 20)) { title = title.Substring(0, 20) + ".."; } StringBuilder builder2 = new StringBuilder(); builder2.Append(" 总评分:" + Comment.ScoreCount(dataItem.GeneralId).ToString() + "</td>"); builder2.Append("<td width='20%' align='right'></td>"); builder2.Append("</tr><tr><td colspan='2'>"); builder2.Append("<table border='0' cellspacing='1' width='100%' cellpadding='0' style='word-break:break-all'>"); builder2.Append("<tr class='tdbg'>"); builder2.Append(" <td style='width:30px;' align='center'>ID</td>"); builder2.Append(" <td align='center'>评论内容</td>"); builder2.Append(" <td style='width:70px;' align='center'>评分</td>"); builder2.Append(" <td style='width:120px;' align='center'>发表日期</td>"); builder2.Append(" <td style='width:60px;' align='center'>审核状态</td>"); builder2.Append(" <td style='width:150px;' align='center'>评论操作</td>"); builder2.Append("</tr>"); builder2.Append("</td>"); builder2.Append("</tr>"); literal.Visible = true; literal.BeginTag = builder.ToString(); literal.Text = title; literal.EndTag = builder2.ToString(); } this.m_PrevId = dataItem.GeneralId; if (dataItem.Content.Length > 20) { label5.BeginTag = "<span title='" + dataItem.Content + "'>"; label5.Text = dataItem.Content.Substring(0, 20); label5.EndTag = "..</span>"; } else { label5.Text = dataItem.Content; } label6.Text = dataItem.UpdateDateTime.ToString("yyyy年MM月dd日 HH时mm分ss秒"); if (!dataItem.Status) { label.Text = "<span style='color:red'>\x00d7</span>"; } else { label.Text = "√"; } if (dataItem.Status) { label2.Text = ""; } else { StringBuilder builder3 = new StringBuilder(); builder3.Append("<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr>"); builder3.Append("<td align='center' style='width:30px;'>"); builder3.Append("</td>"); builder3.Append("<td align='center' style='width:35px;'><a href='CommentModify.aspx?Action=Modify&" + str + "'>修改</a></td>"); builder3.Append("<td align='center' style='width:35px;'><a href='CommentManage.aspx?Action=Del&" + str + "' onclick=\"return confirm('确定要删除此评论吗?');\">删除</a></td>"); builder3.Append("<td align='center' style='width:50px;'>"); builder3.Append("</td>"); builder3.Append("</tr></table>"); label2.Text = builder3.ToString(); } if (!string.IsNullOrEmpty(dataItem.Reply)) { string reply = dataItem.Reply; if (dataItem.Reply.Length > 20) { reply = reply.Substring(0, 20) + ".."; } StringBuilder builder4 = new StringBuilder(); builder4.Append("<tr class='tdbg' onmouseout=\"this.className='tdbg'\" onmouseover=\"this.className='tdbgmouseover'\">"); builder4.Append("<td align='center'> </td>"); builder4.Append("<td colspan='2'> 回复:"); StringBuilder builder5 = new StringBuilder(); builder5.Append("<BR> </td>"); builder5.Append("<td width='200px' align='center'>" + dataItem.ReplyDateTime.ToString("yyyy年MM月dd日 HH时mm分ss秒") + "</td>"); builder5.Append("<td width='30px' align='center'> </td>"); builder5.Append("<td align='center'>"); builder5.Append("<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr><td align='center' style='width:30px;'></td>"); builder5.Append("<td align='center' style='width:35px;'></td>"); builder5.Append("<td align='center' style='width:35px;'></td>"); builder5.Append("<td align='center' style='width:50px;'></td></tr></table></td>"); builder5.Append("</tr>"); label3.Visible = true; label3.BeginTag = builder4.ToString(); label3.Text = reply; label3.EndTag = builder5.ToString(); } } }