📄 productbatchmodify.aspx.cs
字号:
this.TxtKeyWord.Visible = true;
this.TxtKeyWord2.Visible = false;
this.LtrMsg.Visible = false;
return;
case "2":
case "3":
this.TxtKeyWord.Visible = true;
this.TxtKeyWord2.Visible = true;
this.LtrMsg.Visible = true;
return;
}
this.TxtKeyWord.Visible = false;
this.TxtKeyWord2.Visible = false;
this.LtrMsg.Visible = false;
}
private IDictionary<string, string> GetAddField()
{
IDictionary<string, string> dictionary = new Dictionary<string, string>();
foreach (string str in this.m_SystemFields)
{
string[] strArray = str.Split(new char[] { '|' });
dictionary.Add(strArray[0], strArray[1]);
}
foreach (FieldInfo info in Field.GetFieldList(DataConverter.CLng(this.DropProductModel.SelectedValue), false))
{
if (info.FieldType != FieldType.Property)
{
dictionary.Add(info.FieldName, info.FieldAlias);
}
}
return dictionary;
}
private DataTable GetDataTable(IList<FieldInfo> fieldInfoList, DataTable contentDataTable, IList<string> chooseSystemField)
{
IList<string> list = this.ViewState["ChooseCustomField"] as List<string>;
DataTable dataTable = new DataTable();
dataTable.Columns.Add("FieldName");
dataTable.Columns.Add("FieldValue");
dataTable.Columns.Add("FieldType");
dataTable.Columns.Add("FieldLevel");
foreach (FieldInfo info in fieldInfoList)
{
if (info.FieldType == FieldType.Property)
{
continue;
}
DataRow row = dataTable.NewRow();
row["FieldName"] = info.FieldName;
bool flag = false;
foreach (string str in list)
{
if (str == info.FieldName)
{
foreach (RepeaterItem item in this.RepModel.Items)
{
FieldControl control = (FieldControl) item.FindControl("Field");
if (control.FieldName == info.FieldName)
{
row["FieldValue"] = control.Value;
flag = true;
break;
}
}
}
}
if (!flag)
{
row["FieldValue"] = ContentManage.ToFieldType(contentDataTable.Rows[0][info.FieldName].ToString(), info.FieldType, 1);
}
row["FieldType"] = info.FieldType;
row["FieldLevel"] = info.FieldLevel;
dataTable.Rows.Add(row);
}
foreach (string str2 in chooseSystemField)
{
switch (str2)
{
case "EliteLevel":
{
this.AddNewRows(dataTable, "EliteLevel", this.TxtEliteLevel.Text, FieldType.NumberType, 0);
continue;
}
case "Priority":
{
this.AddNewRows(dataTable, "Priority", this.TxtPriority.Text, FieldType.NumberType, 0);
continue;
}
case "Hits":
{
this.AddNewRows(dataTable, "Hits", this.TxtHits.Text, FieldType.NumberType, 0);
continue;
}
case "DayHits":
{
this.AddNewRows(dataTable, "DayHits", this.TxtDayHits.Text, FieldType.NumberType, 0);
continue;
}
case "WeekHits":
{
this.AddNewRows(dataTable, "WeekHits", this.TxtWeekHits.Text, FieldType.NumberType, 0);
continue;
}
case "MonthHits":
{
this.AddNewRows(dataTable, "MonthHits", this.TxtMonthHits.Text, FieldType.NumberType, 0);
continue;
}
case "UpdateTime":
{
this.AddNewRows(dataTable, "UpdateTime", this.PickDate.Text, FieldType.DateTimeType, 0);
continue;
}
case "Template":
{
this.AddNewRows(dataTable, "TemplateFile", this.FscTemplate.Text, FieldType.TemplateType, 0);
continue;
}
}
}
return dataTable;
}
protected void Page_Load(object sender, EventArgs e)
{
if (!this.Page.IsPostBack)
{
this.DropProductModel.DataSource = ModelManager.GetShopModelList(ModelShowType.Enable);
this.DropProductModel.DataBind();
this.DropProductModel.Items.Insert(0, new ListItem("请选择...", "0"));
Collection<string> collection = new Collection<string>();
collection.Add("50");
this.trKeyword.Settings = collection;
this.trProducer.Settings = collection;
this.trTrademark.Settings = collection;
this.RadEnableSingleSell.Attributes.Add("onclick", "if (document.getElementById('" + this.RadDisabledSingleSell.ClientID + "').checked == true) {document.getElementById('" + this.trDependentProducts.ClientID + "').style.display='';} else {document.getElementById('" + this.trDependentProducts.ClientID + "').style.display='none';}");
this.RadDisabledSingleSell.Attributes.Add("onclick", "if (document.getElementById('" + this.RadDisabledSingleSell.ClientID + "').checked == true) {document.getElementById('" + this.trDependentProducts.ClientID + "').style.display='';} else {document.getElementById('" + this.trDependentProducts.ClientID + "').style.display='none';}");
}
}
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");
if (control.ControlType == FieldType.MultiplePhotoType)
{
MultiplePhotoType type2 = (MultiplePhotoType) control.FindControl("PowerEasy2007");
type2.ModelId = this.DropProductModel.SelectedValue;
}
}
}
private void SetAlarmNum(ProductInfo productInfo, IList<ProductDataInfo> productDataInfoList)
{
int num = DataConverter.CLng(this.TxtAlarmNum.Text);
if ((productDataInfoList != null) && (productDataInfoList.Count > 0))
{
foreach (ProductDataInfo info in productDataInfoList)
{
info.AlarmNum = num;
}
}
else
{
productInfo.AlarmNum = num;
}
}
private void SetProductInfo(ProductInfo productInfo, IList<ProductDataInfo> productDataInfoList, IList<string> chooseSystemField)
{
foreach (string str in chooseSystemField)
{
switch (str)
{
case "BarCode":
{
productInfo.BarCode = this.TxtBarCode.Text;
continue;
}
case "Unit":
{
productInfo.Unit = this.ProductUnitPick.ProductUnit;
continue;
}
case "Keyword":
{
productInfo.Keyword = this.trKeyword.FieldValue;
continue;
}
case "StocksProject":
{
productInfo.StocksProject = (StocksProject) DataConverter.CLng(this.RadlStocksProject.SelectedValue);
continue;
}
case "AlarmNum":
{
this.SetAlarmNum(productInfo, productDataInfoList);
continue;
}
case "IncludeTax":
{
productInfo.IncludeTax = this.TaxRateTypeSetting.TaxRate;
continue;
}
case "TaxRate":
{
productInfo.TaxRate = DataConverter.CDouble(this.TxtTaxRate.Text);
continue;
}
case "Weight":
{
productInfo.Weight = DataConverter.CDouble(this.TxtWeight.Text);
continue;
}
case "ProductType":
{
productInfo.ProductType = (ProductType) DataConverter.CLng(this.RadlProductType.SelectedValue);
continue;
}
case "IsNew":
{
productInfo.IsNew = this.ChkIsNew.Checked;
continue;
}
case "IsHot":
{
productInfo.IsHot = this.ChkIsHot.Checked;
continue;
}
case "IsBest":
{
productInfo.IsBest = this.ChkIsBest.Checked;
continue;
}
case "ServiceTerm":
{
productInfo.ServiceTerm = DataConverter.CLng(this.TxtServiceTerm.Text);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -