📄 productshow.cs
字号:
namespace PowerEasy.WebSite.Admin.Shop
{
using PowerEasy.CommonModel;
using PowerEasy.Components;
using PowerEasy.Controls;
using PowerEasy.Model.Shop;
using PowerEasy.Shop;
using PowerEasy.Web.UI;
using System;
using System.Collections.Generic;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class ProductShow : AdminPage
{
protected Button Button1;
protected DropDownList DropSearchField;
protected HtmlForm form1;
protected ExtendedGridView GdvProductList;
protected HiddenField HdnKeyword;
protected HiddenField HdnSearch;
private string m_UpdateDir;
protected ObjectDataSource OdsProductList;
protected TextBox TxtKeyword;
protected void BtnSearch_Click(object sender, EventArgs e)
{
this.HdnSearch.Value = this.DropSearchField.SelectedValue;
this.HdnKeyword.Value = this.TxtKeyword.Text;
this.GdvProductList.PageIndex = 0;
}
protected void GdvProductList_RowDataBound(object sender, GridViewRowEventArgs e)
{
Image image;
string str5;
if (e.Row.RowType != DataControlRowType.DataRow)
{
return;
}
ProductDetailInfo dataItem = (ProductDetailInfo) e.Row.DataItem;
Label label = e.Row.FindControl("LblProductName") as Label;
Label label2 = e.Row.FindControl("LblProductPrice") as Label;
string s = ("市场参考价:" + dataItem.PriceMarket.ToString("0.00")) + " 当前零售价:" + dataItem.PriceInfo.Price.ToString("0.00");
string str4 = dataItem.PriceInfo.PriceMember.ToString("0.00");
if (str4 != null)
{
if (!(str4 == "-1.00"))
{
if (str4 == "0.00")
{
s = s + " 会员价:使用会员组中设定的折扣比率";
goto Label_010F;
}
}
else
{
s = s + " 会员价:详细设置每个会员组的价格";
goto Label_010F;
}
}
s = s + " 统一会员价格:" + dataItem.PriceInfo.PriceMember.ToString("0.00");
Label_010F:
if ((str5 = dataItem.PriceInfo.PriceAgent.ToString("0.00")) != null)
{
if (!(str5 == "-1.00"))
{
if (str5 == "0.00")
{
s = s + " 代理价:使用代理商组中设定的折扣比率";
goto Label_018C;
}
}
else
{
s = s + " 代理价:详细设置每个代理商组的价格";
goto Label_018C;
}
}
s = s + " 统一代理商价格:" + dataItem.PriceInfo.PriceAgent.ToString("0.00");
Label_018C:
image = e.Row.FindControl("ImgItemIcon") as Image;
string itemIcon = ModelManager.GetCacheModelById(dataItem.ModelId).ItemIcon;
if (string.IsNullOrEmpty(itemIcon))
{
itemIcon = "Product.gif";
}
image.ImageUrl = "~/Images/ModelIcon/" + itemIcon;
label2.ToolTip = base.Server.HtmlDecode(s);
label2.Text = dataItem.PriceInfo.Price.ToString("0.00");
label.Text = string.Concat(new object[] {
"[<a href='ProductShow.aspx?NodeID=", dataItem.NodeId, "&NodeName=", dataItem.NodeName, "'>", dataItem.NodeName, "</a>] <span style='cursor:pointer;' onclick='ReturnValue(\"", dataItem.ProductId.ToString(), "\",\"", dataItem.ProductName, "\",\"", this.getRowIndex(e.Row.RowIndex), "\")' onmouseover=\"ShowADPreview('<img src=\\'", this.GetProductPic(dataItem.ProductThumb), "\\' width=\\'150\\' border=\\'0\\' />')\"onmouseout=\"hideTooltip('dHTMLADPreview')\">", dataItem.ProductName,
"</span>"
});
if (!string.IsNullOrEmpty(dataItem.Properties))
{
IList<string> productPropertiesList = Product.GetProductPropertiesList(dataItem.Properties);
DropDownList child = new DropDownList();
child.ID = "DropProperty";
foreach (string str3 in productPropertiesList)
{
child.Items.Add(str3);
}
e.Row.Cells[1].Controls.Add(child);
}
else
{
e.Row.Cells[1].Text = "无";
}
}
private string GetProductPic(string productPic)
{
if (string.IsNullOrEmpty(productPic))
{
return (base.BasePath + "Images/nopic.gif");
}
return (base.BasePath + this.m_UpdateDir + "/" + productPic);
}
private string getRowIndex(int index)
{
index += 2;
string clientID = this.GdvProductList.ClientID;
if (index < 10)
{
return (clientID + "_ctl0" + index.ToString());
}
return (clientID + "_ctl" + index.ToString());
}
protected void Page_Load(object sender, EventArgs e)
{
this.m_UpdateDir = SiteConfig.SiteOption.UploadDir;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -