• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# NBrightInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中NBrightInfo的典型用法代码示例。如果您正苦于以下问题:C# NBrightInfo类的具体用法?C# NBrightInfo怎么用?C# NBrightInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NBrightInfo类属于命名空间,在下文中一共展示了NBrightInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CalculateItemPercentDiscount

        public override NBrightInfo CalculateItemPercentDiscount(int portalId, int userId, NBrightInfo cartItemInfo,String discountcode)
        {
            if (userId <= 0) return cartItemInfo;
            cartItemInfo.SetXmlPropertyDouble("genxml/discountcodeamt", "0"); // reset discount amount
            if (discountcode == "") return cartItemInfo;
            var clientData = new ClientData(portalId,userId);
            if (clientData.DiscountCodes.Count == 0) return cartItemInfo;

            Double discountcodeamt = 0;
            foreach (var d in clientData.DiscountCodes)
            {
                var validutil = d.GetXmlProperty("genxml/textbox/validuntil");
                var validutildate = DateTime.Today;
                if (Utils.IsDate(validutil)) validutildate = Convert.ToDateTime(validutil);
                if (d.GetXmlProperty("genxml/textbox/coderef").ToLower() == discountcode.ToLower() && validutildate >= DateTime.Today)
                {
                    var usageleft = d.GetXmlPropertyDouble("genxml/textbox/usageleft");
                    var percentage = d.GetXmlPropertyDouble("genxml/textbox/percentage");
                    if (percentage > 0 && usageleft > 0)
                    {
                        var appliedtotalcost = cartItemInfo.GetXmlPropertyDouble("genxml/appliedtotalcost");
                        discountcodeamt = ((appliedtotalcost/100)*percentage);
                    }
                }
                if (discountcodeamt > 0) break;
            }
            cartItemInfo.SetXmlPropertyDouble("genxml/discountcodeamt", discountcodeamt);

            return cartItemInfo;
        }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:30,代码来源:DiscountCodesProvider.cs


示例2: 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;
 }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:26,代码来源:DiscountCodesProvider.cs


示例3: AddNewRule

 public String AddNewRule()
 {
     var ruleInfo = new NBrightInfo(true);
     ruleInfo.ItemID = -1;
     ruleInfo.SetXmlProperty("genxml/hidden/index","-1");
     return UpdateRule(ruleInfo);
 }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:7,代码来源:ShippingData.cs


示例4: IsValid

        public override bool IsValid(NBrightInfo cartInfo)
        {
            // check if this provider is valid for the counrty in the checkout
            var shipoption = cartInfo.GetXmlProperty("genxml/extrainfo/genxml/radiobuttonlist/rblshippingoptions");
            var countrycode = "";
            switch (shipoption)
            {
                case "1":
                    countrycode = cartInfo.GetXmlProperty("genxml/billaddress/genxml/dropdownlist/country");
                    break;
                case "2":
                    countrycode = cartInfo.GetXmlProperty("genxml/shipaddress/genxml/dropdownlist/country");
                    break;
            }

            var isValid = true;
            var shipData = new ShippingData(Shippingkey);
            var validlist = "," + shipData.Info.GetXmlProperty("genxml/textbox/validcountrycodes") + ",";
            var notvalidlist = "," + shipData.Info.GetXmlProperty("genxml/textbox/notvalidcountrycodes") + ",";
            if (validlist.Trim(',') != "")
            {
                isValid = false;
                if (validlist.Contains("," + countrycode + ",")) isValid = true;
            }
            if (notvalidlist.Trim(',') != "" && notvalidlist.Contains("," + countrycode + ",")) isValid = false;

            return isValid;
        }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:28,代码来源:ShippingProvider.cs


示例5: GetTemplate

        public override string GetTemplate(NBrightInfo cartInfo)
        {
            var info = ProviderUtils.GetProviderSettings("NBrightPayPalpayment");
            var templ = ProviderUtils.GetTemplateData(info.GetXmlProperty("genxml/textbox/checkouttemplate"));

            return templ;
        }
开发者ID:leedavi,项目名称:NBrightPayPal,代码行数:7,代码来源:PaymentProvider.cs


示例6: DoDetail

 /// <summary>
 /// Display template with moduleid set
 /// </summary>
 /// <param name="rp1"></param>
 /// <param name="moduleId"></param>
 public void DoDetail(Repeater rp1,int moduleId)
 {
     var obj = new NBrightInfo(true);
     obj.ModuleId = moduleId;
     var l = new List<object> { obj };
     rp1.DataSource = l;
     rp1.DataBind();
 }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:13,代码来源:NBrightBuyBase.cs


示例7: DoWork

        /// <summary>
        /// 
        /// </summary>
        /// <param name="portalfinfo"></param>
        /// <returns></returns>
        public override string DoWork()
        {
            try
            {
                var objCtrl = new NBrightBuyController();

                // the sceduler runs at host level, we therefore need to loop through ALL portals to process data at a portal level.
                var portalList = NBrightDNN.DnnUtils.GetAllPortals();
                foreach (var portal in portalList)
                {
                    // check if we have NBS in this portal by looking for default settings.
                    var nbssetting = objCtrl.GetByGuidKey(portal.PortalID, -1, "SETTINGS", "NBrightBuySettings");
                    if (nbssetting != null)
                    {
                        var storeSettings = new StoreSettings(portal.PortalID);
                        var pluginData = new PluginData(portal.PortalID); // get plugin data to see if this scheduler is active on this portal
                        var plugin = pluginData.GetPluginByCtrl("dnnsearchindex");
                        if (plugin != null && plugin.GetXmlPropertyBool("genxml/checkbox/active"))
                        {
                            // The NBS scheduler is normally set to run hourly, therefore if we only want a process to run daily we need the logic this function.
                            // To to this we keep a last run flag on the sceduler settings
                            var setting = objCtrl.GetByGuidKey(portal.PortalID, -1, "DNNIDXSCHEDULER", "DNNIDXSCHEDULER");
                            if (setting == null)
                            {
                                setting = new NBrightInfo(true);
                                setting.ItemID = -1;
                                setting.PortalId = portal.PortalID;
                                setting.TypeCode = "DNNIDXSCHEDULER";
                                setting.GUIDKey = "DNNIDXSCHEDULER";
                                setting.ModuleId = -1;
                                setting.XMLData = "<genxml></genxml>";
                            }

                            var lastrun = setting.GetXmlPropertyRaw("genxml/lastrun");
                            var lastrundate = DateTime.Now.AddYears(-99);
                            if (Utils.IsDate(lastrun)) lastrundate = Convert.ToDateTime(lastrun);

                            var rtnmsg = DoProductIdx(portal, lastrundate, storeSettings.DebugMode);
                            setting.SetXmlProperty("genxml/lastrun", DateTime.Now.ToString("s"), TypeCode.DateTime);
                            objCtrl.Update(setting);
                            if (rtnmsg != "") return rtnmsg;

                        }
                    }

                }

                return " - NBS-DNNIDX scheduler OK ";
            }
            catch (Exception ex)
            {
                return " - NBS-DNNIDX scheduler FAIL: " + ex.ToString() + " : ";
            }
        }
开发者ID:DNNMonster,项目名称:NBrightBuyDnnIdx,代码行数:59,代码来源:DnnIdxProvider.cs


示例8: OnInit

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            // inject any pageheader we need
            var nbi = new NBrightInfo();
            nbi.Lang = Utils.GetCurrentCulture();
            nbi.PortalId = PortalId;
            var pageheaderTempl = NBrightBuyUtils.RazorTemplRender("Admin_Orders_head.cshtml", 0, "", nbi, "/DesktopModules/NBright/NBrightBuy", "config", Utils.GetCurrentCulture(), StoreSettings.Current.Settings());
            PageIncludes.IncludeTextInHeader(Page, pageheaderTempl);
        }
开发者ID:DNNMonster,项目名称:NBrightBuy,代码行数:11,代码来源:Orders.ascx.cs


示例9: DoXslTransOnTemplate

 public static string DoXslTransOnTemplate(string strTemplateText, NBrightInfo objInfo)
 {
     if (strTemplateText.ToLower().Contains("<xsl:stylesheet"))
     {
         var xmlOut = "<root>";
         var l = new List<NBrightInfo> {objInfo};
         xmlOut += NBrightBuyUtils.FormatListtoXml(l);
         xmlOut += "</root>";
         return XslUtils.XslTransInMemory(xmlOut, strTemplateText);
     }
     return strTemplateText;
 }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:12,代码来源:NBrightBuyUtils.cs


示例10: UpdateItemPercentDiscountCode

 public static NBrightInfo UpdateItemPercentDiscountCode(int portalId, int userId, NBrightInfo cartItemInfo, String discountcode)
 {
     cartItemInfo.SetXmlPropertyDouble("genxml/discountcodeamt", "0");
     foreach (var prov in ProviderList)
     {
         var newItemInfo = prov.Value.CalculateItemPercentDiscount(portalId, userId, cartItemInfo, discountcode);
         if (cartItemInfo.GetXmlPropertyDouble("genxml/discountcodeamt") < newItemInfo.GetXmlPropertyDouble("genxml/discountcodeamt"))
         {
             cartItemInfo.SetXmlPropertyDouble("genxml/discountcodeamt", newItemInfo.GetXmlPropertyDouble("genxml/discountcodeamt"));
         }
     }
     return cartItemInfo;
 }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:13,代码来源:DiscountCodeInterface.cs


示例11: AddAddress

 /// <summary>
 /// Add Adddress
 /// </summary>
 /// <param name="rpData"></param>
 /// <param name="debugMode"></param>
 public String AddAddress(Repeater rpData, Boolean debugMode = false)
 {
     var strXml = GenXmlFunctions.GetGenXml(rpData, "", "");
     // load into NBrigthInfo class, so it's easier to get at xml values.
     var objInfoIn = new NBrightInfo();
     objInfoIn.XMLData = strXml;
     var addIndex = objInfoIn.GetXmlProperty("genxml/hidden/index"); // addresses updated from manager should have a index hidden field.
     if (addIndex == "") addIndex = objInfoIn.GetXmlProperty("genxml/dropdownlist/selectaddress"); // updated from cart should have a selected address
     if (!Utils.IsNumeric(addIndex)) addIndex = "-1"; // assume new address.
     var addressIndex = Convert.ToInt32(addIndex);
     AddAddress(objInfoIn,addressIndex);
     return ""; // if everything is OK, don't send a message back.
 }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:18,代码来源:AddressData.cs


示例12: GetProfile

 public NBrightInfo GetProfile()
 {
     var pInfo = new NBrightInfo(true);
     if (_uData.Exists)
     {
         var xmlNode = _uData.Info.XMLDoc.SelectSingleNode("genxml/profile/genxml");
         if (xmlNode != null)
         {
             pInfo.PortalId = _uData.Info.PortalId;
             pInfo.Lang = _uData.Info.Lang;
             pInfo.XMLData = xmlNode.OuterXml;
         }
     }
     return pInfo;
 }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:15,代码来源:ProfileData.cs


示例13: GetRuleList

 /// <summary>
 /// Get Current Cart Item List
 /// </summary>
 /// <returns></returns>
 public List<NBrightInfo> GetRuleList()
 {
     var rtnList = new List<NBrightInfo>();
         var xmlNodeList = Info.XMLDoc.SelectNodes("genxml/list/*");
         if (xmlNodeList != null)
         {
             foreach (XmlNode carNod in xmlNodeList)
             {
                 var newInfo = new NBrightInfo {XMLData = carNod.OuterXml};
                 newInfo.ItemID = rtnList.Count;
                 newInfo.SetXmlProperty("genxml/hidden/index", rtnList.Count.ToString(""));
                 rtnList.Add(newInfo);
             }
         }
     return rtnList;
 }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:20,代码来源:DiscountCodesData.cs


示例14: PluginData

        public PluginData(int portalId, Boolean systemlevel = false)
        {
            _templCtrl = NBrightBuyUtils.GetTemplateGetter(portalId,"config");

            portallevel = !systemlevel;

            if (StoreSettings.Current == null)
            {
                storeSettings = new StoreSettings(portalId);
            }
            else
            {
                storeSettings = StoreSettings.Current;
            }

            var menuplugin = _templCtrl.GetTemplateData("menuplugin.xml", Utils.GetCurrentCulture(), true, true, portallevel, storeSettings.Settings());
            if (menuplugin != "")
            {
                Info = new NBrightInfo();
                Info.XMLData = menuplugin;
                _pluginList = new List<NBrightInfo>();
                _pluginList = GetPluginList();
            }
            else
            {
                // no menuplugin.xml exists, so must be new install, get new config
                var pluginfoldermappath = System.Web.Hosting.HostingEnvironment.MapPath(StoreSettings.NBrightBuyPath() + "/Plugins");
                if (pluginfoldermappath != null && Directory.Exists(pluginfoldermappath))
                {
                    var xmlDoc = new XmlDocument();
                    xmlDoc.Load(pluginfoldermappath + "\\menu.config");
                    pluginfoldermappath = System.Web.Hosting.HostingEnvironment.MapPath(StoreSettings.NBrightBuyPath() + "/Themes/config/default");
                    xmlDoc.Save(pluginfoldermappath + "\\menuplugin.xml");
                    //load new config
                    menuplugin = _templCtrl.GetTemplateData("menuplugin.xml", Utils.GetCurrentCulture(), true, true, portallevel, storeSettings.Settings());
                    if (menuplugin != "")
                    {
                        Info = new NBrightInfo();
                        Info.XMLData = menuplugin;
                        _pluginList = new List<NBrightInfo>();
                        _pluginList = GetPluginList();
                    }
                }
            }
        }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:45,代码来源:PluginData.cs


示例15: AddEntity

 public static NBrightInfo AddEntity(NBrightInfo objInfo, String entityName, int numberToAdd = 1, String genxmlData = "<genxml></genxml>")
 {
     var xNod = objInfo.XMLDoc.SelectSingleNode("genxml/" + entityName.ToLower());
     if (xNod != null)
     {
         var strModelXml = "";
         for (int i = 0; i < numberToAdd; i++)
         {
             strModelXml += genxmlData;
         }
         // Create a document fragment to contain the XML to be inserted.
         var docFrag = objInfo.XMLDoc.CreateDocumentFragment();
         // Set the contents of the document fragment.
         docFrag.InnerXml = strModelXml;
         //Add new model data
         xNod.AppendChild(docFrag);
         objInfo.XMLData = objInfo.XMLDoc.OuterXml;
     }
     return objInfo;
 }
开发者ID:DNNMonster,项目名称:NBrightBuy,代码行数:20,代码来源:ProductUtils.cs


示例16: AddToSettingDic

 private void AddToSettingDic(NBrightInfo settings, string xpath)
 {
     if (settings.XMLDoc != null)
     {
         var nods = settings.XMLDoc.SelectNodes(xpath);
         if (nods != null)
         {
             foreach (XmlNode nod in nods)
             {
                 if (_settingsDic.ContainsKey(nod.Name))
                 {
                     _settingsDic[nod.Name] = nod.InnerText; // overwrite same name node
                 }
                 else
                 {
                     _settingsDic.Add(nod.Name, nod.InnerText);
                 }
             }
         }
     }
 }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:21,代码来源:ModSettings.cs


示例17: GetTemplateData

 public static String GetTemplateData(String templatename, NBrightInfo info)
 {
     var controlMapPath = HttpContext.Current.Server.MapPath("/DesktopModules/NBright/NBrightBuy/Providers/ManualPaymentProvider");
     var templCtrl = new NBrightCore.TemplateEngine.TemplateGetter(PortalSettings.Current.HomeDirectoryMapPath, controlMapPath, "Themes\\config", "");
     var templ = templCtrl.GetTemplateData(templatename, Utils.GetCurrentCulture());
     var dic = new Dictionary<String, String>();
     foreach (var d in StoreSettings.Current.Settings())
     {
         dic.Add(d.Key,d.Value);
     }
     foreach (var d in info.ToDictionary())
     {
         if (dic.ContainsKey(d.Key))
             dic[d.Key] = d.Value;
         else
             dic.Add(d.Key, d.Value);
     }
     templ = Utils.ReplaceSettingTokens(templ, dic);
     templ = Utils.ReplaceUrlTokens(templ);
     return templ;
 }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:21,代码来源:ProviderUtils.cs


示例18: CalculateShipping

        public override NBrightInfo CalculateShipping(NBrightInfo cartInfo)
        {
            var shipData = new ShippingData(Shippingkey);
            var shipoption = cartInfo.GetXmlProperty("genxml/extrainfo/genxml/radiobuttonlist/rblshippingoptions");
            Double rangeValue = 0;
            if (shipData.CalculationUnit == "1")
                rangeValue = cartInfo.GetXmlPropertyDouble("genxml/totalweight");
            else
                rangeValue = cartInfo.GetXmlPropertyDouble("genxml/appliedsubtotal");
            var countrycode = "";
            var regioncode = "";
            var regionkey = "";
            var total = cartInfo.GetXmlPropertyDouble("genxml/appliedsubtotal");
            switch (shipoption)
            {
                case "1":
                    countrycode = cartInfo.GetXmlProperty("genxml/billaddress/genxml/dropdownlist/country");
                    regionkey = cartInfo.GetXmlProperty("genxml/billaddress/genxml/dropdownlist/region");
                    break;
                case "2":
                    countrycode = cartInfo.GetXmlProperty("genxml/shipaddress/genxml/dropdownlist/country");
                    regionkey = cartInfo.GetXmlProperty("genxml/shipaddress/genxml/dropdownlist/region");
                    break;
            }

            if (regionkey != "")
            {
                var rl = regionkey.Split(':');
                if (rl.Count() == 2) regioncode = rl[1];
            }

            var shippingcost = shipData.CalculateShipping(countrycode, regioncode, rangeValue, total);
            var shippingdealercost = shippingcost;
            cartInfo.SetXmlPropertyDouble("genxml/shippingcost", shippingcost);
            cartInfo.SetXmlPropertyDouble("genxml/shippingdealercost", shippingdealercost);

            return cartInfo;
        }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:38,代码来源:ShippingProvider.cs


示例19: GetProviderSettings

        public static NBrightInfo GetProviderSettings(String ctrlkey)
        {
            var info = (NBrightInfo)Utils.GetCache("NBrightPayPalPaymentProvider" + PortalSettings.Current.PortalId.ToString(""));
            if (info == null)
            {
                var modCtrl = new NBrightBuyController();

                info = modCtrl.GetByGuidKey(PortalSettings.Current.PortalId, -1, "NBrightPayPalPAYMENT", ctrlkey);

                if (info == null)
                {
                    info = new NBrightInfo(true);
                    info.GUIDKey = ctrlkey;
                    info.TypeCode = "NBrightPayPalPAYMENT";
                    info.ModuleId = -1;
                    info.PortalId = PortalSettings.Current.PortalId;
                }

                Utils.SetCache("NBrightPayPalPaymentProvider" + PortalSettings.Current.PortalId.ToString(""), info);
            }

            return info;
        }
开发者ID:leedavi,项目名称:NBrightPayPal,代码行数:23,代码来源:ProviderUtils.cs


示例20: UpdateRule

 public String UpdateRule(NBrightInfo ruleInfo, Boolean debugMode = false)
 {
     var addIndex = ruleInfo.GetXmlProperty("genxml/hidden/index");
     if (!Utils.IsNumeric(addIndex)) addIndex = "-1"; // assume new .
     var ruleIndex = Convert.ToInt32(addIndex);
     if (debugMode) ruleInfo.XMLDoc.Save(PortalSettings.Current.HomeDirectoryMapPath + "debug_ruleadd.xml");
     if (ruleIndex >= 0)
         {
             UpdateRule(ruleInfo.XMLData, ruleIndex);
         }
         else
         {
             _shippingList.Add(ruleInfo);
         }
     return ""; // if everything is OK, don't send a message back.
 }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:16,代码来源:ShippingData.cs



注:本文中的NBrightInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NFA类代码示例发布时间:2022-05-24
下一篇:
C# N2类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap