private void DisplayDataEntryRepeater(String entryId) { if (Utils.IsNumeric(entryId) && entryId != "0") { var orderData = new OrderData(PortalId, Convert.ToInt32(entryId)); if (orderData.UserId == UserId) { // if debug , output the xml used. if (StoreSettings.Current.DebugModeFileOut) { var xmlDoc = new System.Xml.XmlDocument(); xmlDoc.LoadXml(orderData.GetInfo().XMLData); xmlDoc.Save(PortalSettings.HomeDirectoryMapPath + "debug_order.xml"); } //render the detail page base.DoDetail(rpData, orderData.GetInfo()); base.DoDetail(rpItemH, orderData.GetInfo()); rpItem.DataSource = orderData.GetCartItemList(StoreSettings.Current.Get("chkgroupresults") == "True"); rpItem.DataBind(); base.DoDetail(rpItemF, orderData.GetInfo()); // display header (Do header after the data return so the productcount works) base.DoDetail(rpDataH, orderData.GetInfo()); } } }
private NBrightInfo PurchaseNotify(NBrightInfo nbrightInfo) { var objCtrl = new NBrightBuyController(); var purhcaseNotifyInfo = objCtrl.GetPluginSinglePageData("OS_PurchaseNotificationDATA", "OS_PurchaseNotificationDATA", Utils.GetCurrentCulture()); if (purhcaseNotifyInfo.GetXmlPropertyBool("genxml/checkbox/turnoff")) { return(nbrightInfo); } var orderData = new OrderData(nbrightInfo.ItemID); // remove and products that have reached the client purchase limit var cartitemList = orderData.GetCartItemList(); var sendEmailFlag = false; foreach (var cartItemInfo in cartitemList) { var productid = cartItemInfo.GetXmlPropertyInt("genxml/productid"); if (productid > 0) { var modelid = cartItemInfo.GetXmlProperty("genxml/modelid"); var productData = new ProductData(productid, Utils.GetCurrentCulture(), true); var model = productData.GetModel(modelid); if (model != null) { var purchaseNotificationFlag = model.GetXmlPropertyBool("genxml/checkbox/purchasenotificationflag"); if (purchaseNotificationFlag) { sendEmailFlag = true; // Just put a flag, most of work done in Razor Template. } } } } if (sendEmailFlag) { var passSettings = new Dictionary <string, string>(); var emailBody = NBrightBuyUtils.RazorTemplRender("EmailHtmlOutput.cshtml", 0, "", orderData, "/DesktopModules/NBright/OS_PurchaseNotification", "config", orderData.Lang, passSettings); var emailList = StoreSettings.Current.ManagerEmail + ","; emailList += purhcaseNotifyInfo.GetXmlProperty("genxml/textbox/emailcsv"); emailList = emailList.TrimEnd(','); var emailSubject = purhcaseNotifyInfo.GetXmlProperty("genxml/textbox/emailsubject"); NBrightBuyUtils.SendEmail(emailBody, emailList, "", orderData.GetInfo(), emailSubject, "", orderData.Lang); } return(nbrightInfo); }
private void DisplayDataEntryRepeater(String entryId) { if (Utils.IsNumeric(entryId) && entryId != "0") { var orderData = new OrderData(PortalId, Convert.ToInt32(entryId)); //render the detail page base.DoDetail(rpData, orderData.GetInfo()); base.DoDetail(rpItemH, orderData.GetInfo()); rpItem.DataSource = orderData.GetCartItemList(StoreSettings.Current.Get("chkgroupresults") == "True"); rpItem.DataBind(); base.DoDetail(rpItemF, orderData.GetInfo()); // display header (Do header so we pickup the special invoice document field in the header) base.DoDetail(rpDataH, orderData.GetInfo()); // display footer (Do here so we pickup the itemid of the order for the action buttons.) base.DoDetail(rpDataF, orderData.GetInfo()); } }