📄 productbatchset.cs
字号:
{
this.AddNewRows(dataTable, "UpdateTime", this.PickDate.Text, FieldType.DateTimeType, 0);
}
if (this.ChkTemplateFile.Checked)
{
this.AddNewRows(dataTable, "TemplateFile", this.FscTemplate.Text, FieldType.TemplateType, 0);
}
return dataTable;
}
protected void Page_Load(object sender, EventArgs e)
{
this.m_ModelId = BasePage.RequestInt32("ModelID");
if (!this.Page.IsPostBack)
{
this.TxtGeneralIdList.Text = BasePage.RequestString("GeneralIdList");
IList<NodeInfo> nodeNameForContainerItems = PowerEasy.Contents.Nodes.GetNodeNameForContainerItems();
if (nodeNameForContainerItems.Count < 1)
{
ListItem item = new ListItem("无节点,请先添加节点", "0");
item.Enabled = false;
}
else
{
this.LstNodes.DataSource = nodeNameForContainerItems;
this.LstNodes.DataBind();
}
this.TxtKeyword.KeyWords = PowerEasy.Accessories.Keywords.GetStrArrayKeywords(4);
this.RadEnableSingleSell.Attributes.Add("onclick", "if (document.getElementById('" + this.RadDisabledSingleSell.ClientID + "').checked == true) {document.getElementById('trDependentProduct').style.display='';} else {document.getElementById('trDependentProduct').style.display='none';}");
this.RadDisabledSingleSell.Attributes.Add("onclick", "if (document.getElementById('" + this.RadDisabledSingleSell.ClientID + "').checked == true) {document.getElementById('trDependentProduct').style.display='';} else {document.getElementById('trDependentProduct').style.display='none';}");
this.ChblModelNameList.DataSource = ModelManager.GetShopModelList(ModelShowType.Enable);
this.ChblModelNameList.DataTextField = "ModelName";
this.ChblModelNameList.DataValueField = "ModelId";
this.ChblModelNameList.DataBind();
}
}
private void SaveKeywordToTable(string txtKeyWord, int generalId)
{
if (!string.IsNullOrEmpty(txtKeyWord))
{
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 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)
{
if (this.ChkBarCode.Checked)
{
productInfo.BarCode = this.TxtBarCode.Text;
}
if (this.ChkUnit.Checked)
{
productInfo.Unit = this.ProductUnitPick.ProductUnit;
}
if (this.ChkKeyword.Checked)
{
productInfo.Keyword = this.TxtKeyword.Text;
}
if (this.ChkStocksProject.Checked)
{
productInfo.StocksProject = (StocksProject) DataConverter.CLng(this.RadlStocksProject.SelectedValue);
}
if (this.ChkAlarmNum.Checked)
{
this.SetAlarmNum(productInfo, productDataInfoList);
}
if (this.ChkTaxRateTypeSetting.Checked)
{
productInfo.IncludeTax = this.TaxRateTypeSetting.TaxRate;
}
if (this.ChkTaxRate.Checked)
{
productInfo.TaxRate = DataConverter.CDouble(this.TxtTaxRate.Text);
}
if (this.ChkWeight.Checked)
{
productInfo.Weight = DataConverter.CDouble(this.TxtWeight.Text);
}
if (this.ChkProductType.Checked)
{
productInfo.ProductType = (ProductType) DataConverter.CLng(this.RadlProductType.SelectedValue);
}
if (this.ChkSetIsNew.Checked)
{
productInfo.IsNew = this.ChkIsNew.Checked;
}
if (this.ChkSetIsHot.Checked)
{
productInfo.IsHot = this.ChkIsHot.Checked;
}
if (this.ChkSetIsBest.Checked)
{
productInfo.IsBest = this.ChkIsBest.Checked;
}
if (this.ChkServiceTerm.Checked)
{
productInfo.ServiceTerm = DataConverter.CLng(this.TxtServiceTerm.Text);
productInfo.ServiceTermUnit = (ServiceTermUnit) DataConverter.CLng(this.DropServiceTermUnit.SelectedValue);
}
if (this.ChkDownloadUrl.Checked)
{
productInfo.DownloadUrl = this.TxtDownloadUrl.Text;
}
if (this.ChkDownloadUrlRemark.Checked)
{
productInfo.Remark = this.TxtDownloadUrlRemark.Text;
}
if (this.ChkSetEnableSale.Checked)
{
productInfo.EnableSale = this.ChkEnableSale.Checked;
}
if (this.ChkProductIntro.Checked)
{
if (this.TxtProductIntro.Text.Length > 0xff)
{
AdminPage.WriteErrMsg("<li>商品简介不能超过255字符!</li>");
}
productInfo.ProductIntro = this.TxtProductIntro.Text;
}
if (this.ChkProductExplain.Checked)
{
productInfo.ProductExplain = this.ProductExplain.Value;
}
if (this.ChkProductPic.Checked)
{
this.ProductPic1.GetProductPic(productInfo);
}
if (this.ChkProducer.Checked)
{
productInfo.ProducerName = this.TxtProducer.Text;
}
if (this.ChkTrademark.Checked)
{
productInfo.TrademarkName = this.TxtTrademark.Text;
}
if (this.ChkSetEnableBuyWhenOutofstock.Checked)
{
productInfo.EnableBuyWhenOutofstock = this.ChkEnableBuyWhenOutofstock.Checked;
}
if (this.ChkLimitNum.Checked)
{
productInfo.LimitNum = DataConverter.CLng(this.TxtLimitNum.Text);
}
if (this.ChkStars.Checked)
{
productInfo.Stars = DataConverter.CLng(this.DropStars.SelectedValue);
}
if (this.ChkPrice_Market.Checked)
{
productInfo.PriceMarket = DataConverter.CDecimal(this.TxtPrice_Market.Text);
}
if (this.ChkPrice.Checked)
{
productInfo.PriceInfo.Price = DataConverter.CDecimal(this.TxtPrice.Text);
}
if (this.ChkWholesale.Checked)
{
this.SetWholesale(productInfo);
}
if (this.ChkEnableSingleSell.Checked)
{
productInfo.EnableSingleSell = this.RadEnableSingleSell.Checked;
productInfo.DependentProducts = this.DependentProduct.DependentProducts;
}
this.SetSalePromotion(productInfo);
}
private void SetSalePromotion(ProductInfo productInfo)
{
if (this.ChkSalePromotion.Checked)
{
productInfo.SalePromotionType = this.SalePromotion.SalePromotionType;
productInfo.MinNumber = this.SalePromotion.MinNumber;
productInfo.PresentNumber = this.SalePromotion.PresentNumber;
productInfo.PresentId = DataConverter.CLng(this.SalePromotion.PresentId);
}
if (this.ChkPresentPoint.Checked)
{
productInfo.PresentPoint = DataConverter.CLng(this.TxtPresentPoint.Text);
}
if (this.ChkPresentExp.Checked)
{
productInfo.PresentExp = DataConverter.CLng(this.TxtPresentExp.Text);
}
if (this.ChkPresentMoney.Checked)
{
productInfo.PresentMoney = DataConverter.CDecimal(this.TxtPresentMoney.Text);
}
}
private void SetWholesale(ProductInfo productInfo)
{
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;
}
}
protected void TxtLimitNum_TextChanged(object sender, EventArgs e)
{
if (DataConverter.CLng(this.TxtLimitNum.Text) > 0)
{
this.ChkEnableWholesale.Enabled = false;
}
else
{
this.ChkEnableWholesale.Enabled = true;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -