📄 productmanage.aspx.cs
字号:
}
if (flag)
{
SiteCache.Remove("CK_Page_Category_" + BasePage.RequestInt32("NodeID"));
AdminPage.WriteSuccessMsg("<li>操作成功!</li>", "ProductManage.aspx");
}
else
{
AdminPage.WriteErrMsg(errorMessage, "ProductManage.aspx");
}
}
}
protected void GdvProductList_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "DeleteProduct")
{
GridViewRow namingContainer = ((LinkButton) e.CommandSource).NamingContainer as GridViewRow;
int generalId = DataConverter.CLng(this.GdvProductList.DataKeys[namingContainer.RowIndex].Values["GeneralId"]);
int productId = DataConverter.CLng(this.GdvProductList.DataKeys[namingContainer.RowIndex].Values["ProductId"]);
string tableName = this.GdvProductList.DataKeys[namingContainer.RowIndex].Values["TableName"].ToString().Trim();
string str2 = this.GdvProductList.DataKeys[namingContainer.RowIndex].Values["ProductName"].ToString();
if (OrderItem.ExistsProduct(tableName, productId))
{
AdminPage.WriteErrMsg("<li>商品“" + str2 + "”已有订单,不能删除!</li>");
}
else if (ContentManage.UpdateStatus(generalId, -3))
{
SiteCache.Remove("CK_Page_Category_" + BasePage.RequestInt32("NodeID"));
AdminPage.WriteSuccessMsg("<li>删除成功!</li>", "ProductManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
}
else
{
AdminPage.WriteErrMsg("<li>删除失败!</li>");
}
}
}
protected void GdvProductList_RowDataBound(object sender, GridViewRowEventArgs e)
{
LinkImage image;
string str3;
string str6;
if (e.Row.RowType != DataControlRowType.DataRow)
{
return;
}
ProductDetailInfo dataItem = (ProductDetailInfo) e.Row.DataItem;
Label label = e.Row.FindControl("LblProductType") as Label;
Label label2 = e.Row.FindControl("LblProductAttribute") as Label;
Label label3 = e.Row.FindControl("LblProductName") as Label;
Label label4 = e.Row.FindControl("LblProductPrice") as Label;
string s = ("市场参考价:" + dataItem.PriceMarket.ToString("0.00")) + " 当前零售价:" + dataItem.PriceInfo.Price.ToString("0.00");
string str5 = dataItem.PriceInfo.PriceMember.ToString("0.00");
if (str5 != null)
{
if (!(str5 == "-1.00"))
{
if (str5 == "0.00")
{
s = s + " 会员价:使用会员组中设定的折扣比率";
goto Label_0145;
}
}
else
{
s = s + " 会员价:详细设置每个会员组的价格";
goto Label_0145;
}
}
s = s + " 统一会员价格:" + dataItem.PriceInfo.PriceMember.ToString("0.00");
Label_0145:
if ((str6 = dataItem.PriceInfo.PriceAgent.ToString("0.00")) != null)
{
if (!(str6 == "-1.00"))
{
if (str6 == "0.00")
{
s = s + " 代理价:使用代理商组中设定的折扣比率";
goto Label_01C8;
}
}
else
{
s = s + " 代理价:详细设置每个代理商组的价格";
goto Label_01C8;
}
}
s = s + " 统一代理商价格:" + dataItem.PriceInfo.PriceAgent.ToString("0.00");
Label_01C8:
image = e.Row.FindControl("LinkImageModel") as LinkImage;
string itemIcon = ModelManager.GetCacheModelById(dataItem.ModelId).ItemIcon;
if (string.IsNullOrEmpty(itemIcon))
{
itemIcon = "Product.gif";
}
image.Icon = itemIcon;
if (dataItem.LinkType != 0)
{
image.IsShowLink = true;
}
label4.ToolTip = base.Server.HtmlDecode(s);
label4.Text = dataItem.PriceInfo.Price.ToString("0.00");
switch (dataItem.ProductType)
{
case ProductType.Normal:
label.Text = "正常";
break;
case ProductType.Special:
label.Text = "特价";
goto Label_027A;
}
Label_027A:
str3 = "";
if (dataItem.IsBest)
{
str3 = str3 + "<font color=blue>精</font> ";
}
else
{
str3 = str3 + " ";
}
if (dataItem.IsHot)
{
str3 = str3 + "<font color=red>热</font> ";
}
else
{
str3 = str3 + " ";
}
if (dataItem.IsNew)
{
str3 = str3 + "<font color=green>新</font> ";
}
else
{
str3 = str3 + " ";
}
if (!string.IsNullOrEmpty(dataItem.ProductThumb))
{
str3 = str3 + "<font color=blue>图</font>";
}
else
{
str3 = str3 + " ";
}
int length = 0;
label2.Text = str3;
label3.Text = string.Concat(new object[] { "[<a href='ProductManage.aspx?NodeID=", dataItem.NodeId, "&NodeName=", dataItem.NodeName, "'>", dataItem.NodeName, "</a>] " });
length = 40 - (StringHelper.SubStringLength(DataSecurity.HtmlDecode(dataItem.NodeName)) + 2);
object text = label3.Text;
label3.Text = string.Concat(new object[] { text, "<a href='ProductView.aspx?GeneralID=", dataItem.GeneralId, "' title='", dataItem.ProductName, "'>", DataSecurity.HtmlEncode(StringHelper.SubString(DataSecurity.HtmlDecode(dataItem.ProductName), length, "...")), "</a>" });
if (!PEContext.Current.Admin.IsSuperAdmin)
{
HyperLink link = e.Row.FindControl("LbtnModify") as HyperLink;
LinkButton button = e.Row.FindControl("LbtnDelete") as LinkButton;
if (BasePage.RequestInt32("NodeID") > 0)
{
button.Enabled = this.IsManage;
link.Enabled = this.IsManage;
if (!this.IsView)
{
label3.Enabled = this.IsView;
label3.Text = StringHelper.SubString("[" + dataItem.NodeName + "]" + dataItem.ProductName, 40, "...");
}
}
else
{
string str4 = dataItem.NodeId.ToString();
NodeInfo cacheNodeById = Nodes.GetCacheNodeById(dataItem.NodeId);
if (cacheNodeById.ParentId > 0)
{
str4 = str4 + "," + cacheNodeById.ParentPath;
}
if (!RolePermissions.CheckNodePurview(str4, this.m_arrNodeIdShow))
{
label3.Enabled = false;
label3.Text = StringHelper.SubString("[" + dataItem.NodeName + "]" + dataItem.ProductName, 40, "...");
}
if (!RolePermissions.CheckNodePurview(str4, this.m_arrNodeIdManage))
{
button.Enabled = false;
link.Enabled = false;
}
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
int nodeId = BasePage.RequestInt32("NodeID");
if (!base.IsPostBack)
{
this.CheckPermissions(nodeId);
this.DropRescentQuery.SelectedValue = BasePage.RequestStringToLower("ListType");
this.HdnListType.Value = BasePage.RequestStringToLower("ListType");
this.HdnStatus.Value = BasePage.RequestStringToLower("status", "100");
this.DropSearch.SelectedValue = "20";
this.HdnSearch.Value = "SpeedSearch";
this.HdnKeyword.Value = "20";
}
string str = "";
if (nodeId > 0)
{
str = Nodes.ShowNodeNavigation(nodeId, "ProductManage.aspx");
}
if (this.DropSearch.SelectedIndex != 0)
{
str = str + " >> " + this.DropSearch.Items[this.DropSearch.SelectedIndex].Text;
}
if (this.DropSearchField.SelectedIndex != 0)
{
str = str + " >> " + this.DropSearchField.Items[this.DropSearchField.SelectedIndex].Text + "中含有 <span style='color:#f00'>" + this.TxtKeyword.Text + "</span> 的商品";
}
this.SmpNavigator.AdditionalNode = str;
}
protected bool IsManage
{
get
{
if (this.ViewState["IsManage"] == null)
{
this.ViewState["IsManage"] = false;
}
return (bool) this.ViewState["IsManage"];
}
set
{
this.ViewState["IsManage"] = value;
}
}
protected bool IsView
{
get
{
if (this.ViewState["IsView"] == null)
{
this.ViewState["IsView"] = false;
}
return (bool) this.ViewState["IsView"];
}
set
{
this.ViewState["IsView"] = value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -