📄 productuser.aspx.cs
字号:
}
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, 1);
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
{
foreach (string str in this.m_ProductInfo.Properties.Split(new char[] { '\n' }))
{
string[] strArray2 = str.Split(new string[] { "$$$" }, StringSplitOptions.RemoveEmptyEntries);
if ((strArray2.Length == 2) && (strArray2[0] == control.FieldAlias))
{
control.Value = strArray2[1];
return;
}
}
}
}
}
}
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;
}
this.AddTemplateField("TxtUserPrice", "TextBox", "会员价格", visible);
foreach (UserGroupsInfo info in UserGroups.GetGroupTable(GroupType.Register))
{
this.AddTemplateField("TxtGroupPrice" + info.GroupId, "TextBox", info.GroupName, flag2);
}
bool flag3 = false;
bool flag4 = false;
switch (productInfo.PriceInfo.PriceAgent.ToString("0.00"))
{
case "0.00":
break;
case "-1.00":
flag4 = true;
break;
default:
flag3 = true;
break;
}
this.AddTemplateField("TxtAgentPrice", "TextBox", "代理商价格", flag3);
foreach (UserGroupsInfo info2 in UserGroups.GetGroupTable(GroupType.Agent))
{
this.AddTemplateField("TxtAgentGroupPrice" + info2.GroupId, "TextBox", info2.GroupName, flag4);
}
this.AddTemplateField("TxtNumber_Wholesale1", "TextBox", "批发数量一", productInfo.EnableWholesale);
this.AddTemplateField("TxtPrice_Wholesale1", "TextBox", "批发价格一", productInfo.EnableWholesale);
this.AddTemplateField("TxtNumber_Wholesale2", "TextBox", "批发数量二", productInfo.EnableWholesale);
this.AddTemplateField("TxtPrice_Wholesale2", "TextBox", "批发价格二", productInfo.EnableWholesale);
this.AddTemplateField("TxtNumber_Wholesale3", "TextBox", "批发数量三", productInfo.EnableWholesale);
this.AddTemplateField("TxtPrice_Wholesale3", "TextBox", "批发价格三", productInfo.EnableWholesale);
this.EgdvChildProductsDataBind();
}
private void SetGroupPrice(IList<ProductPriceInfo> priceInfoList)
{
if (priceInfoList != null)
{
for (int i = 0; i < this.RptGroupPrice.Items.Count; i++)
{
int num2 = DataConverter.CLng(((HiddenField) this.RptGroupPrice.Items[i].FindControl("HdnGroupID")).Value);
foreach (ProductPriceInfo info in priceInfoList)
{
if (info.GroupId == num2)
{
((TextBox) this.RptGroupPrice.Items[i].FindControl("TxtGroupPrice")).Text = info.Price.ToString("0.00");
break;
}
}
}
}
}
private void SetPresent(ProductInfo productInfo)
{
switch (productInfo.SalePromotionType)
{
case 0:
this.RadSalePromotionType1.Checked = true;
break;
case 1:
this.RadSalePromotionType2.Checked = true;
this.TxtMinNumber1.Text = productInfo.MinNumber.ToString();
this.TxtPresentNumber1.Text = productInfo.PresentNumber.ToString();
break;
case 2:
this.RadSalePromotionType3.Checked = true;
this.TxtMinNumber2.Text = productInfo.MinNumber.ToString();
this.TxtPresentNumber2.Text = productInfo.PresentNumber.ToString();
this.TxtPresentName.Text = Present.GetPresentById(DataConverter.CLng(productInfo.PresentId)).PresentName;
this.HdnPresentID.Value = productInfo.PresentId.ToString();
break;
case 3:
this.RadSalePromotionType4.Checked = true;
this.TxtPresentNumber3.Text = productInfo.PresentNumber.ToString();
break;
case 4:
this.RadSalePromotionType5.Checked = true;
this.TxtPresentNumber4.Text = productInfo.PresentNumber.ToString();
this.TxtPresentName2.Text = Present.GetPresentById(DataConverter.CLng(productInfo.PresentId)).PresentName;
this.HdnPresentID2.Value = productInfo.PresentId.ToString();
break;
default:
this.RadSalePromotionType1.Checked = true;
break;
}
this.TxtPresentExp.Text = productInfo.PresentExp.ToString();
this.TxtPresentMoney.Text = productInfo.PresentMoney.ToString("0.00");
this.TxtPresentPoint.Text = productInfo.PresentPoint.ToString();
}
private void SetProductPrice(Product product, ProductInfo
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -