📄 productui.cs
字号:
this.RadDisabledSingleSell.Attributes.Add("onclick", "if (document.getElementById('" + this.RadDisabledSingleSell.ClientID + "').checked == true) {document.getElementById('trDependentProducts').style.display='';} else {document.getElementById('trDependentProducts').style.display='none';}");
ProductCharacter none = ProductCharacter.None;
if (this.m_Action == "modify")
{
if (this.m_GeneralId == 0)
{
AdminPage.WriteErrMsg("<li>商品ID不正确!</li>");
}
else
{
this.ModifyInitialize();
none = this.m_ProductInfo.ProductCharacter;
}
}
else
{
this.TaxRateTypeSetting.TaxRate = (TaxRateType) SiteConfig.ShopConfig.TaxRateType;
this.TxtTaxRate.Text = SiteConfig.ShopConfig.TaxRate.ToString();
this.PickDate.Text = DateTime.Now.ToString();
this.RepModel.DataSource = Field.GetFieldList(this.m_ModelId, false);
this.RepModel.DataBind();
this.InitializeChildProducts();
none = ModelManager.GetModelInfoById(this.m_ModelId).Character;
}
this.HdnProductCharacter.Value = ((int) none).ToString();
if (Product.CharacterIsExists(none, ProductCharacter.Download))
{
this.m_DownloadDisplay = true;
}
}
}
}
protected void RadAgentDiscount_CheckChanged(object sender, EventArgs e)
{
this.RptAgentGroupPrice.Visible = false;
this.DisplayColumns("代理商价格", false);
foreach (UserGroupsInfo info in this.GetUserGroupInfoList(GroupType.Agent))
{
this.DisplayColumns(info.GroupName, false);
}
this.EgdvChildProductsDataBind();
}
protected void RadAgentGroupPrice_CheckedChanged(object sender, EventArgs e)
{
IList<UserGroupsInfo> userGroupInfoList = this.GetUserGroupInfoList(GroupType.Agent);
this.RptAgentGroupPrice.Visible = true;
this.RptAgentGroupPrice.DataSource = userGroupInfoList;
this.RptAgentGroupPrice.DataBind();
this.DisplayColumns("代理商价格", false);
foreach (UserGroupsInfo info in userGroupInfoList)
{
this.DisplayColumns(info.GroupName, true);
}
this.EgdvChildProductsDataBind();
}
protected void RadAgentPrice_CheckChanged(object sender, EventArgs e)
{
this.RptAgentGroupPrice.Visible = false;
this.DisplayColumns("代理商价格", true);
foreach (UserGroupsInfo info in this.GetUserGroupInfoList(GroupType.Agent))
{
this.DisplayColumns(info.GroupName, false);
}
this.EgdvChildProductsDataBind();
}
protected void RadGroupPrice_CheckedChanged(object sender, EventArgs e)
{
this.RptGroupPrice.Visible = true;
IList<UserGroupsInfo> userGroupInfoList = this.GetUserGroupInfoList(GroupType.Register);
this.RptGroupPrice.DataSource = userGroupInfoList;
this.RptGroupPrice.DataBind();
this.DisplayColumns("会员价格", false);
foreach (UserGroupsInfo info in userGroupInfoList)
{
this.DisplayColumns(info.GroupName, true);
}
this.EgdvChildProductsDataBind();
}
protected void RadMemberDiscount_CheckChanged(object sender, EventArgs e)
{
this.RptGroupPrice.Visible = false;
IList<UserGroupsInfo> userGroupInfoList = this.GetUserGroupInfoList(GroupType.Register);
this.DisplayColumns("会员价格", false);
foreach (UserGroupsInfo info in userGroupInfoList)
{
this.DisplayColumns(info.GroupName, false);
}
this.EgdvChildProductsDataBind();
}
protected void RadMemberPrice_CheckChanged(object sender, EventArgs e)
{
this.RptGroupPrice.Visible = false;
this.DisplayColumns("会员价格", true);
foreach (UserGroupsInfo info in this.GetUserGroupInfoList(GroupType.Register))
{
this.DisplayColumns(info.GroupName, false);
}
this.EgdvChildProductsDataBind();
}
protected void RepModel_OnItemDataBound(object sender, RepeaterItemEventArgs e)
{
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
{
FieldControl control = (FieldControl) e.Item.FindControl("Field");
FieldInfo dataItem = (FieldInfo) e.Item.DataItem;
FieldType controlType = control.ControlType;
switch (controlType)
{
case FieldType.LookType:
{
int modelId = DataConverter.CLng(dataItem.Settings[0]);
if (!Field.FieldExists(modelId, dataItem.Settings[1]))
{
Field.SetDisabled(dataItem.FieldName, modelId, true);
e.Item.Visible = false;
}
break;
}
case FieldType.NodeType:
control.Value = BasePage.RequestInt32("NodeId").ToString();
break;
}
if (this.m_Action == "modify")
{
switch (controlType)
{
case FieldType.FileType:
{
FileType type2 = (FileType) control.FindControl("PowerEasy2007");
type2.FileSize = ContentManage.ToFieldType(this.contentDataTable.Rows[0][dataItem.Settings[4]].ToString(), dataItem.FieldType, 1);
break;
}
case FieldType.MultiplePhotoType:
{
MultiplePhotoType type3 = (MultiplePhotoType) control.FindControl("PowerEasy2007");
if (DataConverter.CBool(dataItem.Settings[2]))
{
type3.ThumbFieldValue = ContentManage.ToFieldType(this.contentDataTable.Rows[0][dataItem.Settings[3]].ToString(), dataItem.FieldType, 1);
}
break;
}
case FieldType.ContentType:
{
ContentType type4 = (ContentType) control.FindControl("PowerEasy2007");
type4.Content = ContentManage.ToFieldType(this.contentDataTable.Rows[0][dataItem.FieldName].ToString(), dataItem.FieldType, 1);
type4.DefaultPicurl = ContentManage.ToFieldType(this.contentDataTable.Rows[0]["DefaultPicurl"].ToString(), FieldType.TextType, 0);
break;
}
}
if ((controlType == FieldType.PictureType) && (dataItem.FieldLevel == 0))
{
PictureType type5 = (PictureType) control.FindControl("PowerEasy2007");
type5.UploadFiles = ContentManage.ToFieldType(this.contentDataTable.Rows[0]["UploadFiles"].ToString(), FieldType.TextType, 0);
}
if (controlType != FieldType.Property)
{
control.Value = ContentManage.ToFieldType(this.contentDataTable.Rows[0][dataItem.FieldName].ToString(), dataItem.FieldType, 1);
}
else
{
string[] strArray = this.m_ProductInfo.Properties.Split(new char[] { '\n' });
bool flag = false;
foreach (string str in strArray)
{
string[] strArray2 = str.Split(new string[] { "$$$" }, StringSplitOptions.RemoveEmptyEntries);
if ((strArray2.Length == 2) && (strArray2[0] == control.FieldAlias))
{
if (!string.IsNullOrEmpty(strArray2[1]))
{
control.Value = strArray2[1];
flag = true;
}
break;
}
}
if (!flag)
{
control.Value = "";
}
}
}
}
}
private void SaveKeywordToTable(string txtKeyWord, int generalId)
{
foreach (string str in txtKeyWord.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries))
{
if (PowerEasy.Accessories.Keywords.Exists(str))
{
KeywordInfo keywordByKeywordName = PowerEasy.Accessories.Keywords.GetKeywordByKeywordName(str);
string str2 = ContentManage.RebuildArr(keywordByKeywordName.ArrayGeneralId + "," + generalId.ToString());
int length = str2.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).Length;
keywordByKeywordName.ArrayGeneralId = str2;
keywordByKeywordName.QuoteTimes = length;
PowerEasy.Accessories.Keywords.Update(keywordByKeywordName);
}
else
{
KeywordInfo keywordInfo = new KeywordInfo();
keywordInfo.KeywordText = str;
keywordInfo.KeywordType = 1;
keywordInfo.LastUseTime = DateTime.Now;
keywordInfo.Priority = 0;
keywordInfo.ArrayGeneralId = generalId.ToString();
keywordInfo.QuoteTimes = 1;
PowerEasy.Accessories.Keywords.Add(keywordInfo);
}
}
}
private void SetAgentGroupPrice(IList<ProductPriceInfo> priceInfoList)
{
if (priceInfoList != null)
{
for (int i = 0; i < this.RptAgentGroupPrice.Items.Count; i++)
{
int num2 = DataConverter.CLng(((HiddenField) this.RptAgentGroupPrice.Items[i].FindControl("HdnGroupID")).Value);
foreach (ProductPriceInfo info in priceInfoList)
{
if (info.GroupId == num2)
{
((TextBox) this.RptAgentGroupPrice.Items[i].FindControl("TxtAgentGroupPrice")).Text = info.Price.ToString("0.00");
break;
}
}
}
}
}
private void SetChildProductVisible(ProductInfo productInfo)
{
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);
bool visible = false;
bool flag2 = false;
switch (productInfo.PriceInfo.PriceMember.ToString("0.00"))
{
case "0.00":
break;
case "-1.00":
flag2 = true;
break;
default:
visible = true;
break;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -