📄 productui.cs
字号:
}
if (this.RadAgentPrice.Checked)
{
productInfo.PriceInfo.PriceAgent = DataConverter.CDecimal(this.TxtPrice_Agent.Text);
}
if (this.RadAgentGroupPrice.Checked)
{
productInfo.PriceInfo.PriceAgent = -1M;
}
if (this.ChkEnableWholesale.Checked && (DataConverter.CLng(this.TxtLimitNum.Text) == 0))
{
productInfo.EnableWholesale = true;
productInfo.PriceInfo.NumberWholesale1 = DataConverter.CLng(this.TxtNumber_Wholesale1.Text);
productInfo.PriceInfo.NumberWholesale2 = DataConverter.CLng(this.TxtNumber_Wholesale2.Text);
productInfo.PriceInfo.NumberWholesale3 = DataConverter.CLng(this.TxtNumber_Wholesale3.Text);
productInfo.PriceInfo.PriceWholesale1 = DataConverter.CDecimal(this.TxtPrice_Wholesale1.Text);
productInfo.PriceInfo.PriceWholesale2 = DataConverter.CDecimal(this.TxtPrice_Wholesale2.Text);
productInfo.PriceInfo.PriceWholesale3 = DataConverter.CDecimal(this.TxtPrice_Wholesale3.Text);
}
else
{
productInfo.EnableWholesale = false;
}
if (this.RadDisabledSingleSell.Checked)
{
productInfo.EnableSingleSell = false;
productInfo.DependentProducts = this.DependentProduct.DependentProducts;
}
else
{
productInfo.EnableSingleSell = true;
}
}
private IList<UserGroupsInfo> GetUserGroupInfoList(GroupType groupType)
{
IList<UserGroupsInfo> groupTable = null;
string str = "UserGroupInfoList";
if (groupType == GroupType.Agent)
{
str = "AgentGroupInfoList";
}
if (this.ViewState[str] != null)
{
return (this.ViewState[str] as List<UserGroupsInfo>);
}
groupTable = UserGroups.GetGroupTable(groupType);
this.ViewState[str] = groupTable;
return groupTable;
}
private void GetWholesale(int i, ProductDataInfo productDataInfo)
{
decimal num = DataConverter.CDecimal(((TextBox) this.EgvChildProducts.Rows[i].FindControl("TxtPrice_Wholesale1")).Text, -1M);
if (num >= 0M)
{
productDataInfo.PriceInfo.PriceWholesale1 = num;
}
else
{
productDataInfo.PriceInfo.PriceWholesale1 = DataConverter.CDecimal(this.TxtPrice_Wholesale1.Text);
}
decimal num2 = DataConverter.CDecimal(((TextBox) this.EgvChildProducts.Rows[i].FindControl("TxtPrice_Wholesale2")).Text, -1M);
if (num2 >= 0M)
{
productDataInfo.PriceInfo.PriceWholesale2 = num2;
}
else
{
productDataInfo.PriceInfo.PriceWholesale2 = DataConverter.CDecimal(this.TxtPrice_Wholesale2.Text);
}
decimal num3 = DataConverter.CDecimal(((TextBox) this.EgvChildProducts.Rows[i].FindControl("TxtPrice_Wholesale3")).Text, -1M);
if (num3 >= 0M)
{
productDataInfo.PriceInfo.PriceWholesale3 = num3;
}
else
{
productDataInfo.PriceInfo.PriceWholesale3 = DataConverter.CDecimal(this.TxtPrice_Wholesale3.Text);
}
int num4 = DataConverter.CLng(((TextBox) this.EgvChildProducts.Rows[i].FindControl("TxtNumber_Wholesale1")).Text, -1);
if (num4 >= 0)
{
productDataInfo.PriceInfo.NumberWholesale1 = num4;
}
else
{
productDataInfo.PriceInfo.NumberWholesale1 = DataConverter.CLng(this.TxtNumber_Wholesale1.Text);
}
int num5 = DataConverter.CLng(((TextBox) this.EgvChildProducts.Rows[i].FindControl("TxtNumber_Wholesale2")).Text, -1);
if (num5 >= 0)
{
productDataInfo.PriceInfo.NumberWholesale2 = num5;
}
else
{
productDataInfo.PriceInfo.NumberWholesale2 = DataConverter.CLng(this.TxtNumber_Wholesale2.Text);
}
int num6 = DataConverter.CLng(((TextBox) this.EgvChildProducts.Rows[i].FindControl("TxtNumber_Wholesale3")).Text, -1);
if (num6 >= 0)
{
productDataInfo.PriceInfo.NumberWholesale3 = num6;
}
else
{
productDataInfo.PriceInfo.NumberWholesale3 = DataConverter.CLng(this.TxtNumber_Wholesale3.Text);
}
}
private void InitializeChildProducts()
{
this.AddTemplateField("ChkIsValid", "CheckBox", "有效", true);
this.AddTemplateField("LblProperty", "Label", "商品属性", true);
this.AddTemplateField("TxtChildStocks", "TextBox", "库存数量", true);
this.AddTemplateField("TxtChildAlarmNum", "TextBox", "库存报警下限", true);
this.AddTemplateField("TxtPrice", "TextBox", "零售价格", true);
this.AddTemplateField("TxtUserPrice", "TextBox", "会员价格", false);
foreach (UserGroupsInfo info in UserGroups.GetGroupTable(GroupType.Register))
{
this.AddTemplateField("TxtGroupPrice" + info.GroupId, "TextBox", info.GroupName, false);
}
this.AddTemplateField("TxtAgentPrice", "TextBox", "代理商价格", false);
foreach (UserGroupsInfo info2 in UserGroups.GetGroupTable(GroupType.Agent))
{
this.AddTemplateField("TxtAgentGroupPrice" + info2.GroupId, "TextBox", info2.GroupName, false);
}
this.AddTemplateField("TxtNumber_Wholesale1", "TextBox", "批发数量一", false);
this.AddTemplateField("TxtPrice_Wholesale1", "TextBox", "批发价格一", false);
this.AddTemplateField("TxtNumber_Wholesale2", "TextBox", "批发数量二", false);
this.AddTemplateField("TxtPrice_Wholesale2", "TextBox", "批发价格二", false);
this.AddTemplateField("TxtNumber_Wholesale3", "TextBox", "批发数量三", false);
this.AddTemplateField("TxtPrice_Wholesale3", "TextBox", "批发价格三", false);
this.EgdvChildProductsDataBind();
}
protected string IsShow(string condition)
{
string str2;
string str = "";
if (!this.m_VirtualInfo && ((str2 = condition) != null))
{
if (!(str2 == "DependentProducts"))
{
if ((str2 == "DisplayDownloadUrl") && !this.m_DownloadDisplay)
{
str = "display:none";
}
return str;
}
if (!this.m_DependentProductsDisplay)
{
str = "display:none";
}
}
return str;
}
private void ModifyInitialize()
{
Product product = new Product(this.m_GeneralId);
this.m_ProductInfo = product.GetProductInfo(true);
this.m_ProductDataInfoList = product.ProductDataInfoList;
this.contentDataTable = this.m_ProductInfo.Fields;
this.RepModel.DataSource = Field.GetFieldList(DataConverter.CLng(this.contentDataTable.Rows[0]["ModelID"].ToString()), false);
this.RepModel.DataBind();
this.RepModel.Visible = true;
this.SetProductPrice(product, this.m_ProductInfo);
this.SetPresent(this.m_ProductInfo);
this.SetCommonModelInfo(product.CommonModelInfo);
this.TxtProductName.Text = this.m_ProductInfo.ProductName;
this.ProductNumber1.ProductNum = this.m_ProductInfo.ProductNum;
this.TxtServiceTerm.Text = this.m_ProductInfo.ServiceTerm.ToString();
this.DropServiceTermUnit.SelectedValue = ((int) this.m_ProductInfo.ServiceTermUnit).ToString();
this.TxtWeight.Text = this.m_ProductInfo.Weight.ToString();
this.ProductUnitPick.ProductUnit = this.m_ProductInfo.Unit;
this.TxtDownloadUrl.Text = this.m_ProductInfo.DownloadUrl;
this.TxtDownloadUrlRemark.Text = this.m_ProductInfo.Remark;
this.TxtTaxRate.Text = this.m_ProductInfo.TaxRate.ToString();
this.TaxRateTypeSetting.TaxRate = this.m_ProductInfo.IncludeTax;
this.ChkEnableSale.Checked = this.m_ProductInfo.EnableSale;
this.ChkEnableBuyWhenOutofstock.Checked = this.m_ProductInfo.EnableBuyWhenOutofstock;
this.RadlStocksProject.SelectedValue = ((int) this.m_ProductInfo.StocksProject).ToString();
this.RadlProductType.SelectedValue = ((int) this.m_ProductInfo.ProductType).ToString();
this.TxtLimitNum.Text = this.m_ProductInfo.LimitNum.ToString();
this.TxtStocks.Text = this.m_ProductInfo.Stocks.ToString();
this.TxtStocks.Enabled = false;
this.TxtStocks.ToolTip = "修改库存请到“库存管理”进行操作!";
this.ProductPic1.SetProductPic(this.m_ProductInfo);
this.KeywordType.FieldValue = this.m_ProductInfo.Keyword;
this.Producer.FieldValue = this.m_ProductInfo.ProducerName;
this.ProductExplain.Value = this.m_ProductInfo.ProductExplain;
this.TxtProductIntro.Text = this.m_ProductInfo.ProductIntro;
this.TxtBarCode.Text = this.m_ProductInfo.BarCode;
this.Trademark.FieldValue = this.m_ProductInfo.TrademarkName;
this.ChkIsBest.Checked = this.m_ProductInfo.IsBest;
this.ChkIsHot.Checked = this.m_ProductInfo.IsHot;
this.ChkIsNew.Checked = this.m_ProductInfo.IsNew;
this.DropStars.SelectedValue = this.m_ProductInfo.Stars.ToString();
this.TxtAlarmNum.Text = this.m_ProductInfo.AlarmNum.ToString();
if (!string.IsNullOrEmpty(this.m_ProductInfo.Properties))
{
this.SetChildProductVisible(this.m_ProductInfo);
this.TxtAlarmNum.Enabled = false;
}
}
protected override void OnPreRender(EventArgs e)
{
this.EgdvChildProductsDataBind();
base.OnPreRender(e);
}
protected void Page_Load(object sender, EventArgs e)
{
this.m_ModelId = BasePage.RequestInt32("ModelID");
this.m_NodeId = BasePage.RequestInt32("NodeID");
this.m_Action = BasePage.RequestStringToLower("Action");
this.m_GeneralId = BasePage.RequestInt32("GeneralID");
this.m_VirtualInfo = false;
if ((this.m_Action == "modify") && (BasePage.RequestInt32("LinkType") == 1))
{
this.m_VirtualInfo = true;
}
if (!this.Page.IsPostBack)
{
if ((this.m_NodeId > 0) && !PowerEasy.Contents.Nodes.GetCacheNodeById(this.m_NodeId).IsNull)
{
string str;
if (this.m_Action == "modify")
{
str = " >> 修改商品";
this.BtnSave.Enabled = CheckPermissions(this.m_NodeId, OperateCode.NodeContentManage);
}
else
{
if (!PowerEasy.Contents.Nodes.CheckNodePermission(this.m_NodeId))
{
AdminPage.WriteErrMsg("此栏目设置了有子节点时不允许向该栏目添加信息!", "ProductManage.aspx");
}
str = " >> 添加商品";
this.BtnSave.Enabled = CheckPermissions(this.m_NodeId, OperateCode.NodeContentInput);
}
this.SmpNavigator.CurrentNode = PowerEasy.Contents.Nodes.ShowNodeNavigation(this.m_NodeId, "ProductManage.aspx") + str;
}
if (this.m_ModelId == 0)
{
AdminPage.WriteErrMsg("<li>请指定模型ID</li>");
}
else
{
Collection<string> collection = new Collection<string>();
collection.Add("300");
collection.Add("200");
this.SpecialType1.Settings = collection;
Collection<string> collection2 = new Collection<string>();
collection2.Add("50");
this.KeywordType.Settings = collection2;
this.Producer.Settings = collection2;
this.Trademark.Settings = collection2;
this.ProductExplain.IsWatermark = SiteConfig.ShopConfig.IsWatermark.ToString();
this.DependentProduct.SetModelId(this.m_ModelId);
this.RadEnableSingleSell.Attributes.Add("onclick", "if (document.getElementById('" + this.RadDisabledSingleSell.ClientID + "').checked == true) {document.getElementById('trDependentProducts').style.display='';} else {document.getElementById('trDependentProducts').style.display='none';}");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -