本文整理汇总了C#中NBrightInfo.GetXmlPropertyBool方法的典型用法代码示例。如果您正苦于以下问题:C# NBrightInfo.GetXmlPropertyBool方法的具体用法?C# NBrightInfo.GetXmlPropertyBool怎么用?C# NBrightInfo.GetXmlPropertyBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NBrightInfo
的用法示例。
在下文中一共展示了NBrightInfo.GetXmlPropertyBool方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdatePercentUsage
public override NBrightInfo UpdatePercentUsage(int portalId, int userId, NBrightInfo purchaseInfo)
{
if (userId <= 0) return purchaseInfo;
var discountcode = purchaseInfo.GetXmlProperty("genxml/extrainfo/genxml/textbox/promocode");
if (!purchaseInfo.GetXmlPropertyBool("genxml/discountprocessed"))
{
if (discountcode == "") return purchaseInfo;
var clientData = new ClientData(portalId, userId);
if (clientData.DiscountCodes.Count == 0) return purchaseInfo;
var list = clientData.DiscountCodes;
foreach (var d in list)
{
if (d.GetXmlProperty("genxml/textbox/coderef").ToLower() == discountcode.ToLower())
{
var usageleft = d.GetXmlPropertyDouble("genxml/textbox/usageleft");
var used = d.GetXmlPropertyDouble("genxml/textbox/used");
d.SetXmlPropertyDouble("genxml/textbox/usageleft", (usageleft - 1));
d.SetXmlPropertyDouble("genxml/textbox/used", (used + 1));
}
}
clientData.UpdateDiscountCodeList(list);
clientData.Save();
purchaseInfo.SetXmlProperty("genxml/discountprocessed", "True");
}
return purchaseInfo;
}
示例2: UpdateRule
public void UpdateRule(Repeater rpData)
{
foreach (RepeaterItem i in rpData.Items)
{
var strXml = GenXmlFunctions.GetGenXml(i);
var nbi = new NBrightInfo(true);
nbi.XMLData = strXml;
if (nbi.GetXmlPropertyBool("genxml/hidden/isdirty"))
{
UpdateRule(i);
}
}
}
示例3: IsModelInStock
private Boolean IsModelInStock(NBrightInfo dataItem)
{
var stockOn = dataItem.GetXmlPropertyBool("genxml/checkbox/chkstockon");
if (stockOn)
{
var modelstatus = dataItem.GetXmlProperty("genxml/dropdownlist/modelstatus");
if (modelstatus == "010") return true;
}
else
{
return true;
}
return false;
}
示例4: GetItemDisplay
private String GetItemDisplay(NBrightInfo obj, String templ, Boolean displayPrices)
{
var isDealer = CmsProviderManager.Default.IsInRole(StoreSettings.DealerRole);
var outText = templ;
var stockOn = obj.GetXmlPropertyBool("genxml/checkbox/chkstockon");
var stock = obj.GetXmlPropertyDouble("genxml/textbox/txtqtyremaining");
if (stock > 0 || !stockOn)
{
outText = outText.Replace("{ref}", obj.GetXmlProperty("genxml/textbox/txtmodelref"));
outText = outText.Replace("{name}", obj.GetXmlProperty("genxml/lang/genxml/textbox/txtmodelname"));
outText = outText.Replace("{stock}", stock.ToString(""));
if (displayPrices)
{
//[TODO: add promotional calc]
var saleprice = obj.GetXmlPropertyDouble("genxml/textbox/txtsaleprice");
var price = obj.GetXmlPropertyDouble("genxml/textbox/txtunitcost");
var bestprice = price;
if (saleprice > 0 && saleprice < price) bestprice = saleprice;
var strprice = NBrightBuyUtils.FormatToStoreCurrency(price);
var strbestprice = NBrightBuyUtils.FormatToStoreCurrency(bestprice);
var strsaleprice = NBrightBuyUtils.FormatToStoreCurrency(saleprice);
var strdealerprice = "";
var dealerprice = obj.GetXmlPropertyDouble("genxml/textbox/txtdealercost");
if (isDealer)
{
strdealerprice = NBrightBuyUtils.FormatToStoreCurrency(dealerprice);
if (!outText.Contains("{dealerprice}") && (price > dealerprice)) strprice = strdealerprice;
if (dealerprice < bestprice) bestprice = dealerprice;
}
outText = outText.Replace("{price}", "(" + strprice + ")");
outText = outText.Replace("{dealerprice}", strdealerprice);
outText = outText.Replace("{bestprice}", strbestprice);
outText = outText.Replace("{saleprice}", strsaleprice);
}
else
{
outText = outText.Replace("{price}", "");
outText = outText.Replace("{dealerprice}", "");
outText = outText.Replace("{bestprice}", "");
outText = outText.Replace("{saleprice}", "");
}
return outText;
}
return ""; // no stock so return empty string.
}
示例5: SendEmail
public static void SendEmail(String toEmail, String templateName, NBrightInfo dataObj, String emailsubjectresxkey, String fromEmail,String lang)
{
dataObj = ProcessEventProvider(EventActions.BeforeSendEmail, dataObj, templateName);
if (!dataObj.GetXmlPropertyBool("genxml/stopprocess"))
{
if (lang == "") lang = Utils.GetCurrentCulture();
var emaillist = toEmail;
if (emaillist != "")
{
var emailsubject = "";
if (emailsubjectresxkey != "")
{
var resxpath = StoreSettings.NBrightBuyPath() + "/App_LocalResources/Notification.ascx.resx";
emailsubject = DnnUtils.GetLocalizedString(emailsubjectresxkey, resxpath, lang);
if (emailsubject == null) emailsubject = emailsubjectresxkey;
}
// we can't use StoreSettings.Current.Settings(), becuase of external calls from providers to this function, so load in the settings directly
var modCtrl = new NBrightBuyController();
var storeSettings = modCtrl.GetStoreSettings(dataObj.PortalId);
var strTempl = modCtrl.GetTemplateData(-1, templateName, lang, storeSettings.Settings(), storeSettings.DebugMode);
var emailbody = GenXmlFunctions.RenderRepeater(dataObj, strTempl, "", "XMLData", lang, storeSettings.Settings());
if (templateName.EndsWith(".xsl")) emailbody = XslUtils.XslTransInMemory(dataObj.XMLData, emailbody);
if (fromEmail == "") fromEmail = storeSettings.AdminEmail;
var emailarray = emaillist.Split(',');
emailsubject = storeSettings.Get("storename") + " : " + emailsubject;
foreach (var email in emailarray)
{
if (!string.IsNullOrEmpty(email.Trim()) && Utils.IsEmail(fromEmail.Trim()) && Utils.IsEmail(email.Trim()))
{
// multiple attachments as csv with "|" seperator
DotNetNuke.Services.Mail.Mail.SendMail(fromEmail.Trim(), email.Trim(), "", emailsubject, emailbody, dataObj.GetXmlProperty("genxml/emailattachment"), "HTML", "", "", "", "");
}
}
}
}
ProcessEventProvider(EventActions.AfterSendEmail, dataObj, templateName);
}
示例6: CheckSecurity
private Boolean CheckSecurity(NBrightInfo pluginData)
{
if (pluginData.GetXmlPropertyBool("genxml/checkbox/hidden")) return false;
var roles = pluginData.GetXmlProperty("genxml/textbox/roles");
if (roles.Trim() == "") return true;
if (UserInfo.IsSuperUser) return true;
if (UserInfo.IsInRole("Administrator")) return true;
var rlist = roles.Split(',');
foreach (var r in rlist)
{
if (UserInfo.IsInRole(r)) return true;
}
return false;
}
示例7: CalculateItemTax
public override Double CalculateItemTax(NBrightInfo cartItemInfo)
{
var info = ProviderUtils.GetProviderSettings("tax");
var taxtype = info.GetXmlProperty("genxml/radiobuttonlist/taxtype");
if (taxtype == "3") return 0;
var rateDic = GetRates();
if (!rateDic.Any()) return 0;
// loop through each item and calc the tax for each.
Double taxtotal = 0;
var totalcost = cartItemInfo.GetXmlPropertyDouble("genxml/totalcost");
if (cartItemInfo.GetXmlPropertyBool("genxml/isdealer")) totalcost = cartItemInfo.GetXmlPropertyDouble("genxml/totaldealercost");
var taxratecode = cartItemInfo.GetXmlProperty("genxml/taxratecode");
if (taxratecode == "") taxratecode = "0";
if (!rateDic.ContainsKey(taxratecode)) taxratecode = "0";
Double taxrate = 0;
if (rateDic.ContainsKey(taxratecode)) taxrate = rateDic[taxratecode]; // Can happen is no default tax added.
if (taxtype == "1") // included in unit price
{
taxtotal += totalcost - ((totalcost / (100 + taxrate)) * 100);
}
if (taxtype == "2") // NOT included in unit price
{
taxtotal += (totalcost / 100) * taxrate;
}
return Math.Round(taxtotal, 2);
}
示例8: CalcGroupPromoItem
public static string CalcGroupPromoItem(NBrightInfo p)
{
var objCtrl = new NBrightBuyController();
var typeselect = p.GetXmlProperty("genxml/radiobuttonlist/typeselect");
var catgroupid = p.GetXmlProperty("genxml/dropdownlist/catgroupid");
var propgroupid = p.GetXmlProperty("genxml/dropdownlist/propgroupid");
var promoname = p.GetXmlProperty("genxml/textbox/name");
var amounttype = p.GetXmlProperty("genxml/radiobuttonlist/amounttype");
var amount = p.GetXmlPropertyDouble("genxml/textbox/amount");
var validfrom = p.GetXmlProperty("genxml/textbox/validfrom");
var validuntil = p.GetXmlProperty("genxml/textbox/validuntil");
var overwrite = p.GetXmlPropertyBool("genxml/checkbox/overwrite");
var disabled = p.GetXmlPropertyBool("genxml/checkbox/disabled");
var lastcalculated = p.GetXmlProperty("genxml/hidden/lastcalculated");
if (!disabled)
{
var runcalc = true;
if (Utils.IsDate(lastcalculated))
{
if (Convert.ToDateTime(lastcalculated) >= p.ModifiedDate) runcalc = false; // only run if changed
if (DateTime.Now.Date > Convert.ToDateTime(lastcalculated).Date.AddDays(1)) runcalc = true; // every day just after midnight. (for site performace)
}
if (Utils.IsDate(validuntil))
{
if (DateTime.Now.Date > Convert.ToDateTime(validuntil)) runcalc = true; // need to disable the promo if passed date
}
if ((runcalc) && Utils.IsDate(validfrom) && Utils.IsDate(validuntil))
{
var dteF = Convert.ToDateTime(validfrom).Date;
var dteU = Convert.ToDateTime(validuntil).Date;
CategoryData gCat;
var groupid = catgroupid;
if (typeselect != "cat") groupid = propgroupid;
gCat = CategoryUtils.GetCategoryData(groupid, Utils.GetCurrentCulture());
var prdList = gCat.GetAllArticles();
foreach (var prd in prdList)
{
if (DateTime.Now.Date >= dteF && DateTime.Now.Date <= dteU)
{
// CALC Promo
CalcProductSalePrice(p.PortalId, prd.ParentItemId, amounttype, amount, promoname, p.ItemID, overwrite,dteF,dteU);
}
if (DateTime.Now.Date > dteU)
{
// END Promo
RemoveProductPromoData(p.PortalId, prd.ParentItemId, p.ItemID);
p.SetXmlProperty("genxml/checkbox/disabled", "True");
objCtrl.Update(p);
}
ProductUtils.RemoveProductDataCache(p.PortalId, prd.ParentItemId);
}
p.SetXmlProperty("genxml/hidden/lastcalculated", DateTime.Now.AddSeconds(10).ToString("O")); // Add 10 sec to time so we don't get exact clash with update time.
objCtrl.Update(p);
}
}
return "OK";
}
示例9: UpdatePercentUsage
public override NBrightInfo UpdatePercentUsage(int portalId, int userId, NBrightInfo purchaseInfo)
{
var discountcode = purchaseInfo.GetXmlProperty("genxml/extrainfo/genxml/textbox/promocode");
if (!purchaseInfo.GetXmlPropertyBool("genxml/discountprocessed"))
{
if (userId > 0)
{
if (discountcode == "") return purchaseInfo;
var clientData = new ClientData(portalId, userId);
if (clientData.DiscountCodes.Count > 0)
{
var list = clientData.DiscountCodes;
foreach (var d in list)
{
if (d.GetXmlProperty("genxml/textbox/coderef").ToLower() == discountcode.ToLower())
{
var usageleft = d.GetXmlPropertyDouble("genxml/textbox/usageleft");
var used = d.GetXmlPropertyDouble("genxml/textbox/used");
d.SetXmlPropertyDouble("genxml/textbox/usageleft", (usageleft - 1));
d.SetXmlPropertyDouble("genxml/textbox/used", (used + 1));
}
}
clientData.UpdateDiscountCodeList(list);
clientData.Save();
purchaseInfo.SetXmlProperty("genxml/discountprocessed", "True");
}
}
var objCtrl = new NBrightBuyController();
var dis = objCtrl.GetByGuidKey(portalId, -1, "DISCOUNTCODE", discountcode);
if (dis != null)
{
var usage = dis.GetXmlPropertyDouble("genxml/textbox/usage");
dis.SetXmlPropertyDouble("genxml/textbox/usage", (usage + 1));
objCtrl.Update(dis);
purchaseInfo.SetXmlProperty("genxml/discountprocessed", "True");
}
}
return purchaseInfo;
}