示例#1
0
        public override string RedirectForPayment(OrderData orderData)
        {
            orderData.OrderStatus = "020";
            orderData.PurchaseInfo.SetXmlProperty("genxml/paymenterror", "");
            orderData.PurchaseInfo.Lang = Utils.GetCurrentCulture();
            orderData.SavePurchaseData();
            try
            {
                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.Write(ProviderUtils.GetBankRemotePost(orderData));
            }
            catch (Exception ex)
            {
                // rollback transaction
                orderData.PurchaseInfo.SetXmlProperty("genxml/paymenterror", "<div>ERROR: Invalid payment data </div><div>" + ex + "</div>");
                orderData.PaymentFail();
                var param = new string[3];
                param[0] = "orderid=" + orderData.PurchaseInfo.ItemID.ToString("");
                param[1] = "status=0";
                return Globals.NavigateURL(StoreSettings.Current.PaymentTabId, "", param);
            }

            try
            {
                HttpContext.Current.Response.End();
            }
            catch (Exception ex)
            {
                // this try/catch to avoid sending error 'ThreadAbortException'
            }

            return "";
        }
示例#2
0
        private GenXmlTemplate _templateHeader; //this is used to pickup the meta data on page load.

        #endregion Fields

        #region Methods

        protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e)
        {
            var cArg = e.CommandArgument.ToString();
            var param = new string[3];
            if (Utils.RequestParam(Context, "eid") != "") param[0] = "eid=" + Utils.RequestParam(Context, "eid");

            switch (e.CommandName.ToLower())
            {
                case "pay":
                    if (_cartInfo != null)
                    {

                        _cartInfo.SaveModelTransQty(); // move qty into trans
                        _cartInfo.ConvertToOrder(DebugMode);
                        var orderData = new OrderData(_cartInfo.PurchaseInfo.ItemID);

                        orderData.payselectionXml = GenXmlFunctions.GetGenXml(rpPaymentGateways, "", "");

                        orderData.PaymentProviderKey = cArg.ToLower(); // provider keys should always be lowecase
                        orderData.SavePurchaseData();
                        var redirecturl = PaymentsInterface.Instance(orderData.PaymentProviderKey).RedirectForPayment(orderData);
                        if (redirecturl != "") Response.Redirect(redirecturl, true);
                    }
                    Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                    break;
            }
        }
 public override string RedirectForPayment(OrderData orderData)
 {
     orderData.OrderStatus = "020";
     orderData.SavePurchaseData();
     var param = new string[3];
     param[0] = "orderid=" + orderData.PurchaseInfo.ItemID.ToString("D");
     param[1] = "status=1";
     return Globals.NavigateURL(StoreSettings.Current.PaymentTabId, "", param);
 }
示例#4
0
        protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e)
        {
            var cArg = e.CommandArgument.ToString();
            var param = new string[3];
            var navigationData = new NavigationData(PortalId, "OrderAdmin");

            switch (e.CommandName.ToLower())
            {
                case "entrydetail":
                    param[0] = "eid=" + cArg;
                    Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                    break;
                case "reorder":
                    if (Utils.IsNumeric(cArg))
                    {
                        var orderData = new OrderData(PortalId, Convert.ToInt32(cArg));
                        orderData.CopyToCart(DebugMode);
                    }
                    Response.Redirect(Globals.NavigateURL(StoreSettings.Current.CartTabId, "", param), true);
                    break;
                case "return":
                    param[0] = "";
                    Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                    break;
                case "search":
                    var strXml = GenXmlFunctions.GetGenXml(rpSearch, "", "");
                    navigationData.Build(strXml, _templSearch);
                    navigationData.OrderBy = GenXmlFunctions.GetSqlOrderBy(rpSearch);
                    navigationData.XmlData = GenXmlFunctions.GetGenXml(rpSearch);
                    navigationData.Save();
                    if (StoreSettings.Current.DebugModeFileOut)
                    {
                        strXml = "<root><sql><![CDATA[" + navigationData.Criteria + "]]></sql>" + strXml + "</root>";
                        var xmlDoc = new System.Xml.XmlDocument();
                        xmlDoc.LoadXml(strXml);
                        xmlDoc.Save(PortalSettings.HomeDirectoryMapPath + "debug_search.xml");
                    }
                    Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                    break;
                case "resetsearch":
                    // clear cookie info
                    navigationData.Delete();
                    Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                    break;
                case "downloadinvoice":
                    DownloadInvoice(Convert.ToInt32(cArg));
                    break;
                case "orderby":
                    navigationData.OrderBy = GenXmlFunctions.GetSqlOrderBy(rpData);
                    navigationData.Save();
                    break;
            }
        }
示例#5
0
        public static String GetBankRemotePost(OrderData orderData)
        {
            // use this class to build up the post html
            var rPost = new RemotePost();

            // get the gateway settings which have been entered into the back office page (settings.html template)
            var settings = ProviderUtils.GetProviderSettings("NBrightPayPalpayment");

            // get the order data
            var payData = new PayData(orderData);

            rPost.Url = payData.PostUrl;

            rPost.Add("cmd", "_xclick");
            rPost.Add("item_number", payData.ItemId);
            rPost.Add("return", payData.ReturnUrl);
            rPost.Add("currency_code", payData.CurrencyCode);
            rPost.Add("cancel_return", payData.ReturnCancelUrl);
            rPost.Add("notify_url", payData.NotifyUrl);
            rPost.Add("custom", Utils.GetCurrentCulture());
            rPost.Add("business", payData.PayPalId);
            rPost.Add("item_name", orderData.PurchaseInfo.GetXmlProperty("genxml/ordernumber"));
            rPost.Add("amount", payData.Amount);
            rPost.Add("shipping", payData.ShippingAmount);
            rPost.Add("tax", payData.TaxAmount);
            rPost.Add("lc", Utils.GetCurrentCulture().Substring(3,2));

            var extrafields = settings.GetXmlProperty("genxml/textbox/extrafields");
            var fields = extrafields.Split(',');
            foreach (var f in fields)
            {
                var ary = f.Split('=');
                if (ary.Count() == 2)
                {
                    var n = ary[0];
                    var v = ary[1];
                    var d = orderData.PurchaseInfo.GetXmlProperty(v);
                    rPost.Add(n, d);
                }
            }

            //Build the re-direct html
            var rtnStr = rPost.GetPostHtml("/DesktopModules/NBright/NBrightPayPal/Themes/config/img/paypal.gif");
            if (settings.GetXmlPropertyBool("genxml/checkbox/debug.mode"))
            {
                File.WriteAllText(PortalSettings.Current.HomeDirectoryMapPath + "\\debug_NBrightPayPalpost.html", rtnStr);
            }
            return rtnStr;
        }
示例#6
0
 public override string ProcessPaymentReturn(HttpContext context)
 {
     var orderid = Utils.RequestQueryStringParam(context, "orderid");
     if (Utils.IsNumeric(orderid))
     {
         var status = Utils.RequestQueryStringParam(context, "status");
         if (status == "0")
         {
             var orderData = new OrderData(Convert.ToInt32(orderid));
             if (orderData.OrderStatus == "020") // check we have a waiting for bank status (Cancel from bank seems to happen even after notified has accepted it as valid??)
             {
                 var rtnerr = orderData.PurchaseInfo.GetXmlProperty("genxml/paymenterror");
                 rtnerr = "."; // to return this so a fail is activated.
                 orderData.PaymentFail();
                 return rtnerr;
             }
         }
     }
     return "";
 }
        public override string ProcessPaymentReturn(HttpContext context)
        {
            var orderid = Utils.RequestQueryStringParam(context, "orderid");
            if (Utils.IsNumeric(orderid))
            {
                var orderData = new OrderData(Convert.ToInt32(orderid));

                // 010 = Incomplete, 020 = Waiting for Bank,030 = Cancelled,040 = Payment OK,050 = Payment Not Verified,060 = Waiting for Payment,070 = Waiting for Stock,080 = Waiting,090 = Shipped,010 = Closed,011 = Archived
                if (orderData.OrderStatus == "020")
                {
                    var rtnstatus = Utils.RequestQueryStringParam(context, "status");
                    if (rtnstatus == "1") // status 1 = successful (0 = fail)
                    {
                        orderData.PaymentOk("060");
                    }
                }

            }
            return "";
        }
示例#8
0
        public void LoadSettings(OrderData oInfo)
        {
            var settings = ProviderUtils.GetProviderSettings("NBrightPayPalpayment");
            var appliedtotal = oInfo.PurchaseInfo.GetXmlPropertyDouble("genxml/appliedtotal");
            var alreadypaid = oInfo.PurchaseInfo.GetXmlPropertyDouble("genxml/alreadypaid");

            ItemId = oInfo.PurchaseInfo.ItemID.ToString("");
            PostUrl = settings.GetXmlProperty("genxml/textbox/paymenturl");
            VerifyUrl = settings.GetXmlProperty("genxml/textbox/verifyurl");
            PayPalId = settings.GetXmlProperty("genxml/textbox/paypalid");
            CartName = "NBrightStore";

            CurrencyCode = oInfo.PurchaseInfo.GetXmlProperty("genxml/currencycode");
            if (CurrencyCode == "") CurrencyCode = settings.GetXmlProperty("genxml/textbox/currencycode");

            var param = new string[3];
            param[0] = "orderid=" + oInfo.PurchaseInfo.ItemID.ToString("");
            param[1] = "status=1";
            ReturnUrl = Globals.NavigateURL(StoreSettings.Current.PaymentTabId, "", param);
            param[0] = "orderid=" + oInfo.PurchaseInfo.ItemID.ToString("");
            param[1] = "status=0";
            ReturnCancelUrl = Globals.NavigateURL(StoreSettings.Current.PaymentTabId, "", param);
            NotifyUrl = Utils.ToAbsoluteUrl("/DesktopModules/NBright/NBrightPayPal/notify.ashx");
            MerchantLanguage = Utils.GetCurrentCulture();
            Amount = (appliedtotal - alreadypaid).ToString("0.00", CultureInfo.InvariantCulture);
            Email = oInfo.PurchaseInfo.GetXmlProperty("genxml/billaddress/textbox/billaddress");
            if (!Utils.IsEmail(Email)) Email = oInfo.PurchaseInfo.GetXmlProperty("genxml/extrainfo/textbox/cartemailaddress");
            // set shipping and tax to zero, these should be calculated by the store so the amount should always be correct.
            // for some reason paypal seem to add shipping and tax to the total.
            // Not sure if this is a new change by paypal, or if it's always been wrong!!
            //ShippingAmount = oInfo.PurchaseInfo.GetXmlPropertyDouble("genxml/shippingcost").ToString("0.00", CultureInfo.InvariantCulture);
            //TaxAmount = oInfo.PurchaseInfo.GetXmlPropertyDouble("genxml/taxcost").ToString("0.00", CultureInfo.InvariantCulture);
            const int zero = 0;
            ShippingAmount = zero.ToString("0.00", CultureInfo.InvariantCulture);
            TaxAmount = zero.ToString("0.00", CultureInfo.InvariantCulture);
        }
示例#9
0
        private void OrderItemlistDataBind(object sender, EventArgs e)
        {
            var lc = (Literal)sender;
            var container = (IDataItemContainer)lc.NamingContainer;
            try
            {
                var strOut = "";
                lc.Visible = visibleStatus.DefaultIfEmpty(true).First();
                if (lc.Visible)
                {

                    var id = Convert.ToString(DataBinder.Eval(container.DataItem, "ItemId"));
                    var lang = Convert.ToString(DataBinder.Eval(container.DataItem, "lang"));
                    if (lang == "") lang = Utils.GetCurrentCulture();
                    var groupresults = false;
                    if (lc.Text.EndsWith(":GROUPBY"))
                    {
                        groupresults = true;
                        lc.Text = lc.Text.Replace(":GROUPBY", "");
                    }
                    var templName = lc.Text;
                    if (Utils.IsNumeric(id) && (templName != ""))
                    {
                        var buyCtrl = new NBrightBuyController();
                        var rpTempl = buyCtrl.GetTemplateData(-1, templName, lang, _settings, StoreSettings.Current.DebugMode);

                        //remove templName from template, so we don't get a loop.
                        if (rpTempl.Contains(templName)) rpTempl = rpTempl.Replace(templName, "");
                        //build models list

                        var objInfo = (NBrightInfo)container.DataItem;
                        var ordData = new OrderData(objInfo.PortalId,objInfo.ItemID);
                        // render repeater
                        try
                        {
                            var itemTemplate = NBrightBuyUtils.GetGenXmlTemplate(rpTempl, _settings, PortalSettings.Current.HomeDirectory, visibleStatus);
                            strOut = GenXmlFunctions.RenderRepeater(ordData.GetCartItemList(groupresults), itemTemplate);
                        }
                        catch (Exception exc)
                        {
                            strOut = "ERROR: NOTE: sub rendered templates CANNOT contain postback controls.<br/>" + exc;
                        }
                    }
                }
                lc.Text = strOut;

            }
            catch (Exception)
            {
                lc.Text = "";
            }
        }
示例#10
0
        public Boolean ConvertToOrder(Boolean debugMode = false)
        {
            var itemList = GetCartItemList();
            if (IsValidated() && itemList.Count > 0)
            {
                PurchaseTypeCode = "ORDER";
                if (base.PurchaseInfo.GetXmlProperty("genxml/createddate") == "") base.PurchaseInfo.SetXmlProperty("genxml/createddate", DateTime.Now.ToString(CultureInfo.GetCultureInfo(Utils.GetCurrentCulture())), TypeCode.DateTime);
                if (base.PurchaseInfo.GetXmlProperty("genxml/ordernumber") == "") base.PurchaseInfo.SetXmlProperty("genxml/ordernumber", StoreSettings.Current.Get("orderprefix") + DateTime.Today.Year.ToString("").Substring(2, 2) + DateTime.Today.Month.ToString("00") + DateTime.Today.Day.ToString("00") + _cartId);

                Save();
                var ordData = new OrderData(PortalId, base.PurchaseInfo.ItemID);
                ordData.OrderStatus = "010";
                if (ordData.EditMode == "") // don't update if we are in edit mode, we dont; want manager email to be altered.
                {
                    // if the client has updated the email address, link this back to DNN profile. (We assume they alway place there current email address on th order.)
                    var objUser = UserController.GetUserById(PortalSettings.Current.PortalId, ordData.UserId);
                    if (objUser != null && objUser.Email != ordData.EmailAddress)
                    {
                        var clientData = new ClientData(PortalId, ordData.UserId);
                        clientData.UpdateEmail(ordData.EmailAddress);
                    }
                }
                ordData.Save();

                if (StoreSettings.Current.DebugModeFileOut) OutputDebugFile("debug_convertedcart.xml");
                Exists = false;
                return true;
            }
            return false;
        }
示例#11
0
 public static void SendEmailOrderToClient(String templateName, int orderId, String emailsubjectresxkey = "", String fromEmail = "", String emailmsg = "")
 {
     var ordData = new OrderData(orderId);
     var lang = ordData.Lang;
     if (ordData.GetInfo().UserId > 0)
     {
         // this order is linked to a DNN user, so get the order email from the DNN profile (so if it's updated since the order, we pickup the new one)
         var objUser = UserController.GetUserById(ordData.PortalId, ordData.GetInfo().UserId);
         if (objUser != null)
         {
             if (ordData.EmailAddress != objUser.Email)
             {
                 ordData.EmailAddress = objUser.Email;
                 ordData.SavePurchaseData();
             }
             if (objUser.Profile.PreferredLocale != "") lang = objUser.Profile.PreferredLocale;
         }
     }
     if (lang == "") lang = Utils.GetCurrentCulture();
     // we're going to send email to all email addreses linked to the order.
     var emailList = ordData.EmailAddress;
     if (!emailList.Contains(ordData.EmailShippingAddress) && Utils.IsEmail(ordData.EmailShippingAddress)) emailList += "," + ordData.EmailShippingAddress;
     if (!emailList.Contains(ordData.EmailBillingAddress) && Utils.IsEmail(ordData.EmailBillingAddress)) emailList += "," + ordData.EmailBillingAddress;
     ordData.PurchaseInfo.SetXmlProperty("genxml/emailmsg", emailmsg);
     SendEmail(emailList, templateName, ordData.GetInfo(), emailsubjectresxkey, fromEmail, lang);
 }
示例#12
0
        protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e)
        {
            var cArg = e.CommandArgument.ToString();
            var tabId = TabId;
            var param = new string[4];
            if (_uid != "") param[0] = "uid=" + _uid;
            var navigationData = new NavigationData(PortalId, "AdminOrders");
            var cmd = e.CommandName.ToLower();
            var resxpath = StoreSettings.NBrightBuyPath() + "/App_LocalResources/Notification.ascx.resx";
            var emailoption = "";

            switch (cmd)
            {
                case "entrydetail":
                    param[0] = "eid=" + cArg;
                    if (_page != "") param[1] = "page=" + _page;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "reorder":
                    param[0] = "";
                    if (Utils.IsNumeric(cArg))
                    {
                        var orderData = new OrderData(PortalId, Convert.ToInt32(cArg));
                        orderData.CopyToCart(DebugMode);
                        tabId = StoreSettings.Current.GetInt("carttab");
                        if (tabId == 0) tabId = TabId;
                    }
                    Response.Redirect(NBrightBuyUtils.AdminUrl(tabId, param), true);
                    break;
                case "editorder":
                    param[0] = "";
                    if (Utils.IsNumeric(cArg))
                    {
                        var orderData = new OrderData(PortalId, Convert.ToInt32(cArg));
                        orderData.ConvertToCart(DebugMode);
                        tabId = StoreSettings.Current.GetInt("carttab");
                        if (tabId == 0) tabId = TabId;
                    }
                    Response.Redirect(NBrightBuyUtils.AdminUrl(tabId, param), true);
                    break;
                case "return":
                    param[0] = "";
                    if (_page != "") param[1] = "page=" + _page;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "search":
                    var strXml = GenXmlFunctions.GetGenXml(rpSearch, "", "");
                    navigationData.Build(strXml, _templSearch);
                    navigationData.OrderBy = GenXmlFunctions.GetSqlOrderBy(rpSearch);
                    navigationData.XmlData = GenXmlFunctions.GetGenXml(rpSearch);
                    navigationData.Save();
                    if (StoreSettings.Current.DebugModeFileOut)
                    {
                        strXml = "<root><sql><![CDATA[" + navigationData.Criteria + "]]></sql>" + strXml + "</root>";
                        var xmlDoc = new System.Xml.XmlDocument();
                        xmlDoc.LoadXml(strXml);
                        xmlDoc.Save(PortalSettings.HomeDirectoryMapPath + "debug_search.xml");
                    }
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "resetsearch":
                    // clear cookie info
                    navigationData.Delete();
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "orderby":
                    navigationData.OrderBy = GenXmlFunctions.GetSqlOrderBy(rpData);
                    navigationData.Save();
                    break;
                case "viewclient":
                    param[1] = "ctrl=clients";
                    if (Utils.IsNumeric(cArg))
                    {
                        var orderData = new OrderData(PortalId, Convert.ToInt32(cArg));
                        param[0] = "uid=" + orderData.UserId.ToString("");
                    }
                    Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                    break;
                case "save":
                    param[0] = "eid=" + _entryid;
                    var result = Update();
                    NBrightBuyUtils.SetNotfiyMessage(ModuleId, NotifyRef + cmd, result);
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "printorder":
                        param[0] = "eid=" + _entryid;
                        param[1] = "print=printorder";
                        param[2] = "template=printorder.html";
                        Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "printreceipt":
                        param[0] = "eid=" + _entryid;
                        param[1] = "print=printorder";
                        param[2] = "template=printreceipt.html";
                        Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "printdeliverylabel":
                    param[0] = "eid=" + _entryid;
                    param[1] = "print=printorder";
                    param[2] = "template=printdeliverylabel.html";
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "emailamended":
                    param[0] = "eid=" + _entryid;
                    emailoption = DnnUtils.GetLocalizedString("orderamended_emailsubject.Text", resxpath, Utils.GetCurrentCulture());
                    Update(emailoption);
                    SendOrderEmail(Convert.ToInt32(_entryid), "orderamendedemail.html", "orderamended_emailsubject.Text");
                    NBrightBuyUtils.SetNotfiyMessage(ModuleId, NotifyRef + cmd, NotifyCode.ok);
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "emailreceipt":
                    param[0] = "eid=" + _entryid;
                    emailoption = DnnUtils.GetLocalizedString("orderreceipt_emailsubject.Text", resxpath, Utils.GetCurrentCulture());
                    Update(emailoption);
                    SendOrderEmail(Convert.ToInt32(_entryid), "orderreceiptemail.html", "orderreceipt_emailsubject.Text");
                    NBrightBuyUtils.SetNotfiyMessage(ModuleId, NotifyRef + cmd, NotifyCode.ok);
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "emailshipped":
                    param[0] = "eid=" + _entryid;
                    emailoption = DnnUtils.GetLocalizedString("ordershipped_emailsubject.Text", resxpath, Utils.GetCurrentCulture());
                    Update(emailoption);
                    SendOrderEmail(Convert.ToInt32(_entryid), "ordershippedemail.html", "ordershipped_emailsubject.Text");
                    NBrightBuyUtils.SetNotfiyMessage(ModuleId, NotifyRef + cmd, NotifyCode.ok);
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "emailvalidated":
                    param[0] = "eid=" + _entryid;
                    emailoption = DnnUtils.GetLocalizedString("ordervalidated_emailsubject.Text", resxpath, Utils.GetCurrentCulture());
                    Update(emailoption);
                    SendOrderEmail(Convert.ToInt32(_entryid), "ordervalidatedemail.html", "ordervalidated_emailsubject.Text");
                    NBrightBuyUtils.SetNotfiyMessage(ModuleId, NotifyRef + cmd, NotifyCode.ok);
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "downloadinvoice":
                    DownloadInvoice(Convert.ToInt32(cArg));
                    break;
                case "deleteinvoice":
                    DeleteInvoice(Convert.ToInt32(cArg));
                    param[0] = "eid=" + _entryid;
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
                case "export":
                    DoExport();
                    Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                    break;
            }
        }
示例#13
0
 private String OrderAdminReOrder(HttpContext context)
 {
     try
     {
         if (UserController.Instance.GetCurrentUserInfo().UserID > 0)
         {
             var settings = GetAjaxFields(context);
             if (!settings.ContainsKey("selecteditemid")) settings.Add("selecteditemid", "");
             var selecteditemid = settings["selecteditemid"];
             if (Utils.IsNumeric(selecteditemid))
             {
                 var orderData = new OrderData(PortalSettings.Current.PortalId, Convert.ToInt32(selecteditemid));
                 if (orderData.UserId == UserController.Instance.GetCurrentUserInfo().UserID || NBrightBuyUtils.CheckRights())
                 {
                     orderData.CopyToCart(false);
                 }
             }
             return "";
         }
         return "";
     }
     catch (Exception ex)
     {
         return ex.ToString();
     }
 }
示例#14
0
        private void DisplayOrderData(int portalId, UserInfo userInfo, String entryId)
        {
            var strOut = "***ERROR***  Invalid Data";
            if (Utils.IsNumeric(entryId) && entryId != "0")
            {
                var orderData = new OrderData(portalId, Convert.ToInt32(entryId));
                if (orderData.PurchaseInfo.TypeCode == "ORDER")
                {
                    strOut = "***ERROR***  Invalid Security";
                    if (userInfo.UserID == orderData.UserId || userInfo.IsInRole(StoreSettings.ManagerRole) || userInfo.IsInRole(StoreSettings.EditorRole))
                    {
                        //check the payment provider for a print url
                        var shippingprovider = orderData.PurchaseInfo.GetXmlProperty("genxml/extrainfo/genxml/radiobuttonlist/shippingprovider");
                        if (shippingprovider != "")
                        {
                            var shipprov = ShippingInterface.Instance(shippingprovider);
                            if (shipprov != null)
                            {
                                if (_template == "printdeliverylabel.html")
                                {
                                    var printurl = shipprov.GetDeliveryLabelUrl(orderData.PurchaseInfo);
                                    if (printurl != "") Response.Redirect(printurl);
                                }
                            }
                        }

                        // not provider label, so print template
                        var templCtrl = NBrightBuyUtils.GetTemplateGetter(_theme);
                        var strTempl = templCtrl.GetTemplateData(_template, Utils.GetCurrentCulture(), true, true, true, StoreSettings.Current.Settings());

                        strOut = GenXmlFunctions.RenderRepeater(orderData.PurchaseInfo, strTempl, "", "XMLData", Utils.GetCurrentCulture(), StoreSettings.Current.Settings());
                        if (_template.EndsWith(".xsl")) strOut = XslUtils.XslTransInMemory(orderData.PurchaseInfo.XMLData, strOut);
                    }
                }
            }
            var l = new Literal();
            l.Text = strOut;
            phData.Controls.Add(l);
        }
示例#15
0
        private void DisplayOrderData(int portalId, UserInfo userInfo, String entryId)
        {
            var strOut = "***ERROR***  Invalid Data";
            if (Utils.IsNumeric(entryId) && entryId != "0")
            {
                var orderData = new OrderData(portalId, Convert.ToInt32(entryId));
                if (orderData.PurchaseInfo.TypeCode == "ORDER")
                {
                    strOut = "***ERROR***  Invalid Security";
                    if (_scode == orderData.PurchaseInfo.GetXmlProperty("genxml/securitycode") || userInfo.UserID == orderData.UserId || userInfo.IsInRole(StoreSettings.ManagerRole) || userInfo.IsInRole(StoreSettings.EditorRole))
                    {
                        //check the payment provider for a print url
                        var shippingprovider = orderData.PurchaseInfo.GetXmlProperty("genxml/extrainfo/genxml/radiobuttonlist/shippingprovider");
                        if (shippingprovider != "")
                        {
                            var shipprov = ShippingInterface.Instance(shippingprovider);
                            if (shipprov != null)
                            {
                                if (_printtype == "shiplabel")
                                {
                                    var printurl = shipprov.GetDeliveryLabelUrl(orderData.PurchaseInfo);
                                    if (printurl != "") Response.Redirect(printurl);
                                }
                            }
                        }

                        // No print label, so print template specified.
                        var obj = new NBrightInfo(true);
                        obj.PortalId = PortalSettings.Current.PortalId;
                        obj.ModuleId = 0;
                        obj.Lang = Utils.GetCurrentCulture();
                        obj.GUIDKey = _printtype;
                        obj.ItemID = -1;

                        strOut = NBrightBuyUtils.RazorTemplRender("printorder.cshtml", 0, "", obj, "/DesktopModules/NBright/NBrightBuy", _theme, Utils.GetCurrentCulture(), StoreSettings.Current.Settings());
                    }
                }
            }
            var l = new Literal();
            l.Text = strOut;
            phData.Controls.Add(l);
        }
示例#16
0
        private void PageLoad()
        {
            if (UserId > 0 && _cartInfo.UserId == -1) // user may have just logged in.
            {
                _cartInfo.UserId = UserId;
                _cartInfo.Save();
            }

            var orderid = Utils.RequestQueryStringParam(Context, "orderid");

            if ((_provList.Count == 0 || _cartInfo.PurchaseInfo.GetXmlPropertyDouble("genxml/appliedtotal") <= 0) && orderid == "")
            {
                #region "No Payment providers, so process as a ordering system"

                if (_cartInfo != null && _cartInfo.IsValidated())
                {

                    _cartInfo.SaveModelTransQty(); // move qty into trans
                    _cartInfo.ConvertToOrder(DebugMode);
                    _cartInfo.ApplyModelTransQty();

                    // Send emails
                    NBrightBuyUtils.SendEmailOrderToClient("ordercreatedclientemail.html", _cartInfo.PurchaseInfo.ItemID, "ordercreatedemailsubject");
                    NBrightBuyUtils.SendEmailToManager("ordercreatedemail.html", _cartInfo.PurchaseInfo, "ordercreatedemailsubject");

                    // update status to completed
                    _orderData = new OrderData(PortalId, _cartInfo.PurchaseInfo.ItemID);
                    _orderData.SavePurchaseData();

                    var cartL = new List<NBrightInfo>();
                    cartL.Add(_cartInfo.GetInfo());

                    // display payment OK for order
                    rpDetailDisplay.DataSource = cartL;
                    rpDetailDisplay.DataBind();
                }

                #endregion
            }
            else
            {
                #region "Payment Details"

                if (Utils.IsNumeric(orderid))
                {
                    // orderid exists, so must be return from bank; Process it!!
                    _orderData = new OrderData(PortalId, Convert.ToInt32(orderid));
                    DoDetail(rpDetailDisplay, _orderData.PurchaseInfo);
                }
                else
                {
                    // display return page
                    DoDetail(rpDetailDisplay, _cartInfo.PurchaseInfo);
                    DoDetail(rpPaymentGateways, _cartInfo.PurchaseInfo);
                    DoDetail(rpDetailFooter, _cartInfo.PurchaseInfo);
                }

                #endregion
            }
        }
示例#17
0
        public static void SendOrderEmail(string emailtype, int orderId, string emailsubjectresxkey, string fromEmail, string emailmsg, bool onlyUserManagerOnly)
        {
            var ordData = new OrderData(orderId);
            var lang = ordData.ClientLang;
            if (ordData.GetInfo().UserId > 0)
            {
                // this order is linked to a DNN user, so get the order email from the DNN profile (so if it's updated since the order, we pickup the new one)
                var objUser = UserController.GetUserById(ordData.PortalId, ordData.GetInfo().UserId);
                if (objUser != null)
                {
                    if (ordData.EmailAddress != objUser.Email)
                    {
                        ordData.EmailAddress = objUser.Email;
                        ordData.SavePurchaseData();
                    }
                    lang = ordData.ClientLang; // pickup is the client prefered local has changed.
                }
            }
            if (lang == "") lang = Utils.GetCurrentCulture();
            // we're going to send email to all email addreses linked to the order.
            var emailList = ordData.EmailAddress;
            if (!emailList.Contains(ordData.EmailShippingAddress) && Utils.IsEmail(ordData.EmailShippingAddress)) emailList += "," + ordData.EmailShippingAddress;
            if (!emailList.Contains(ordData.EmailBillingAddress) && Utils.IsEmail(ordData.EmailBillingAddress)) emailList += "," + ordData.EmailBillingAddress;

            // also send to manager is created.
            if (emailtype == "OrderCreatedClient")
            {
                emailList += "," + StoreSettings.Current.ManagerEmail;
            }

            if (!onlyUserManagerOnly || UserController.Instance.GetCurrentUserInfo().UserID > 0)
            {

                var passSettings = new Dictionary<string, string>();
                passSettings.Add("printtype", emailtype);
                passSettings.Add("emailmessage", emailmsg);
                foreach (var s in StoreSettings.Current.Settings()) // copy store setting, otherwise we get a byRef assignement
                {
                    if (passSettings.ContainsKey(s.Key))
                        passSettings[s.Key] = s.Value;
                    else
                        passSettings.Add(s.Key, s.Value);
                }

                // check for user or manager.
                var sendEmailFlag = true;
                if (onlyUserManagerOnly && UserController.Instance.GetCurrentUserInfo().UserID != ordData.UserId)
                {
                    if (!NBrightBuyUtils.CheckRights())
                    {
                        sendEmailFlag = false;
                    }
                }

                if (sendEmailFlag)
                {
                    var emailBody = "";
                    emailBody = NBrightBuyUtils.RazorTemplRender("OrderHtmlOutput.cshtml", 0, "", ordData, "/DesktopModules/NBright/NBrightBuy", StoreSettings.Current.Get("themefolder"), lang, passSettings);
                    if (StoreSettings.Current.DebugModeFileOut) Utils.SaveFile(PortalSettings.Current.HomeDirectoryMapPath + "\\testemail.html", emailBody);
                    SendEmail(emailBody, emailList, emailtype, ordData.GetInfo(), emailsubjectresxkey, fromEmail, lang);
                    ordData.AddAuditMessage(emailmsg, "email", UserController.Instance.GetCurrentUserInfo().Username, "False", NBrightBuyUtils.ResourceKey("Notification." + emailsubjectresxkey, StoreSettings.Current.EditLanguage));
                    ordData.SavePurchaseData();
                }
            }
        }
示例#18
0
        private String GetOrderDetailData(Dictionary<String, String> settings, bool paging = true)
        {
            var strOut = "";

            if (!settings.ContainsKey("themefolder")) settings.Add("themefolder", "");
            if (!settings.ContainsKey("razortemplate")) settings.Add("razortemplate", "");
            if (!settings.ContainsKey("portalid")) settings.Add("portalid", PortalSettings.Current.PortalId.ToString("")); // aways make sure we have portalid in settings
            if (!settings.ContainsKey("selecteditemid")) settings.Add("selecteditemid", "");

            var themeFolder = settings["themefolder"];
            var selecteditemid = settings["selecteditemid"];
            var razortemplate = settings["razortemplate"];
            var portalId = Convert.ToInt32(settings["portalid"]);

            var passSettings = settings;
            foreach (var s in StoreSettings.Current.Settings()) // copy store setting, otherwise we get a byRef assignement
            {
                if (passSettings.ContainsKey(s.Key))
                    passSettings[s.Key] = s.Value;
                else
                    passSettings.Add(s.Key, s.Value);
            }

            if (!Utils.IsNumeric(selecteditemid)) return "";

            if (themeFolder == "")
            {
                themeFolder = StoreSettings.Current.ThemeFolder;
                if (settings.ContainsKey("themefolder")) themeFolder = settings["themefolder"];
            }

            var ordData = new OrderData(portalId, Convert.ToInt32(selecteditemid));

            // check for user or manager.
            if (UserController.Instance.GetCurrentUserInfo().UserID != ordData.UserId)
            {
                if (!NBrightBuyUtils.CheckRights())
                {
                    return "";
                }
            }

            strOut = NBrightBuyUtils.RazorTemplRender(razortemplate, 0, "", ordData, "/DesktopModules/NBright/NBrightBuy", themeFolder, _lang, passSettings);

            return strOut;
        }
示例#19
0
        private String OrderAdminSave(HttpContext context)
        {
            try
            {
                if (NBrightBuyUtils.CheckManagerRights())
                {
                    var ajaxInfo = NBrightBuyUtils.GetAjaxFields(context);
                    var itemId = ajaxInfo.GetXmlPropertyInt("genxml/hidden/itemid");
                    if (itemId > 0)
                    {
                        var ordData = new OrderData(itemId);
                        if (ordData != null)
                        {
                            var newStatusOrder = ajaxInfo.GetXmlProperty("genxml/dropdownlist/orderstatus");
                            if (ordData.OrderStatus != newStatusOrder)
                            {
                                ordData.OrderStatus = newStatusOrder;
                            }

                            ordData.PurchaseInfo.SetXmlProperty("genxml/textbox/shippingdate", ajaxInfo.GetXmlProperty("genxml/textbox/shippingdate"), TypeCode.DateTime);
                            ordData.PurchaseInfo.SetXmlProperty("genxml/textbox/trackingcode", ajaxInfo.GetXmlProperty("genxml/textbox/trackingcode"));

                            // do audit notes
                            if (ajaxInfo.GetXmlProperty("genxml/textbox/auditnotes") != "")
                            {
                                ordData.AddAuditMessage(ajaxInfo.GetXmlProperty("genxml/textbox/auditnotes"),"notes", UserController.Instance.GetCurrentUserInfo().Username,"False");
                            }

                            // save relitive path also
                            if (ajaxInfo.GetXmlProperty("genxml/hidden/optionfilelist") != "")
                            {
                                var fname = Path.GetFileName(ajaxInfo.GetXmlProperty("genxml/hidden/optionfilelist"));

                                if (File.Exists(StoreSettings.Current.FolderTempMapPath.TrimEnd('\\') + "\\" + fname))
                                {
                                    var newfname = Utils.GetUniqueKey();
                                    // save relitive path also
                                    if (File.Exists(ordData.PurchaseInfo.GetXmlProperty("genxml/hidden/invoicefilepath")))
                                    {
                                        File.Delete(StoreSettings.Current.FolderUploadsMapPath.TrimEnd('\\') + "\\" + newfname);
                                    }

                                    File.Copy(StoreSettings.Current.FolderTempMapPath.TrimEnd('\\') + "\\" + fname, StoreSettings.Current.FolderUploadsMapPath.TrimEnd('\\') + "\\" + newfname);
                                    File.Delete(StoreSettings.Current.FolderTempMapPath.TrimEnd('\\') + "\\" + fname);

                                    ordData.PurchaseInfo.SetXmlProperty("genxml/hidden/invoicefilepath", StoreSettings.Current.FolderUploadsMapPath.TrimEnd('\\') + "\\" + newfname);
                                    ordData.PurchaseInfo.SetXmlProperty("genxml/hidden/invoicefilename", newfname);
                                    ordData.PurchaseInfo.SetXmlProperty("genxml/hidden/invoiceuploadname", fname);
                                    ordData.PurchaseInfo.SetXmlProperty("genxml/hidden/invoicefileext", Path.GetExtension(fname));
                                    ordData.PurchaseInfo.SetXmlProperty("genxml/hidden/invoicefilerelpath", StoreSettings.Current.FolderUploads + "/" + newfname);
                                    ordData.PurchaseInfo.SetXmlProperty("genxml/hidden/invoicedownloadname", "NBS" + ordData.OrderNumber + Path.GetExtension(fname));
                                }
                            }

                            ordData.Save();
                        }
                    }

                    return "";
                }
                return "";
            }
            catch (Exception ex)
            {
                return ex.ToString();
            }
        }
示例#20
0
 public PayData(OrderData oInfo)
 {
     LoadSettings(oInfo);
 }
示例#21
0
 private void DownloadInvoice(int orderid)
 {
     var orderData = new OrderData(PortalId, orderid);
     Utils.ForceDocDownload(StoreSettings.Current.FolderUploadsMapPath + "\\" + orderData.InvoiceFileName, orderData.InvoiceDownloadName, Response);
 }
示例#22
0
        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());
                }

            }
        }
示例#23
0
        private NotifyCode Update(String emailoption = "")
        {
            // we don;t have the full field set on this form, so only update the fields we know are there.
            var trackingcode = GenXmlFunctions.GetField(rpDataF, "trackingcode");
            var shippingdate = GenXmlFunctions.GetField(rpDataF, "shippingdate");
            var orderstatus = GenXmlFunctions.GetField(rpDataF, "orderstatus");
            var showtouser = GenXmlFunctions.GetField(rpDataF, "showtouser");
            var notes = GenXmlFunctions.GetField(rpDataF, "notes");
            var emailmsg = GenXmlFunctions.GetField(rpDataF, "emailmsg");

            var strUpd = GenXmlFunctions.GetGenXml(rpDataF, "", StoreSettings.Current.FolderUploadsMapPath);
            var nbi = new NBrightInfo(true);
            nbi.XMLData = strUpd;

            if (!Utils.IsNumeric(_entryid)) return NotifyCode.error;
            var ordData = new OrderData(PortalId, Convert.ToInt32(_entryid));
            if (ordData.PurchaseInfo.ItemID == -1) return NotifyCode.fail;
            ordData.ShippedDate = shippingdate;
            ordData.OrderStatus = orderstatus;
            ordData.TrackingCode = trackingcode;
            ordData.InvoiceFileName = nbi.GetXmlProperty("genxml/hidden/hidinvoicedoc");
            ordData.InvoiceFileExt = Path.GetExtension(ordData.InvoiceFileName);
            ordData.InvoiceFilePath = StoreSettings.Current.FolderUploadsMapPath + "\\" + ordData.InvoiceFileName;
            ordData.AddAuditMessage(notes,"msg",UserInfo.Username,showtouser);
            if (emailoption != "")
            {
                ordData.AddAuditMessage(emailmsg, "email", UserInfo.Username, showtouser, emailoption);
            }

            if (ordData.OrderNumber == "") ordData.OrderNumber = StoreSettings.Current.Get("orderprefix") + ordData.PurchaseInfo.ModifiedDate.Year.ToString("").Substring(2, 2) + ordData.PurchaseInfo.ModifiedDate.Month.ToString("00") + ordData.PurchaseInfo.ModifiedDate.Day.ToString("00") + _entryid;

            ordData.InvoiceDownloadName = ordData.OrderNumber + ordData.InvoiceFileExt;

            ordData.Save();
            return NotifyCode.ok;
        }
示例#24
0
 private void DeleteInvoice(int orderid)
 {
     var orderData = new OrderData(PortalId, orderid);
     GenXmlFunctions.DeleteFile(orderData.InvoiceFileName, StoreSettings.Current.FolderUploadsMapPath,"");
     orderData.InvoiceDownloadName = "";
     orderData.InvoiceFileExt = "";
     orderData.InvoiceFileName = "";
     orderData.InvoiceFilePath = "";
     orderData.SavePurchaseData();
 }
示例#25
0
        private String OrderAdminRemoveInvoice(HttpContext context)
        {
            try
            {
                if (NBrightBuyUtils.CheckManagerRights())
                {
                    var ajaxInfo = NBrightBuyUtils.GetAjaxFields(context);
                    var itemId = ajaxInfo.GetXmlPropertyInt("genxml/hidden/itemid");
                    if (itemId > 0)
                    {
                        var ordData = new OrderData(itemId);
                        if (ordData != null)
                        {

                            // save relitive path also
                            if (File.Exists(ordData.PurchaseInfo.GetXmlProperty("genxml/hidden/invoicefilepath")))
                            {
                                File.Delete(ordData.PurchaseInfo.GetXmlProperty("genxml/hidden/invoicefilepath"));
                            }

                            ordData.PurchaseInfo.SetXmlProperty("genxml/hidden/invoicefilepath","");
                            ordData.PurchaseInfo.SetXmlProperty("genxml/hidden/invoicefilename", "");
                            ordData.PurchaseInfo.SetXmlProperty("genxml/hidden/invoicefileext", "");
                            ordData.PurchaseInfo.SetXmlProperty("genxml/hidden/invoicefilerelpath", "");
                            ordData.PurchaseInfo.SetXmlProperty("genxml/hidden/invoicedownloadname", "");
                            ordData.AddAuditMessage(NBrightBuyUtils.ResourceKey("OrderAdmin.cmdDeleteInvoice"), "invremove", UserController.Instance.GetCurrentUserInfo().Username, "False");

                            ordData.Save();
                        }
                    }

                    return "";
                }
                return "";
            }
            catch (Exception ex)
            {
                return ex.ToString();
            }
        }
示例#26
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (ModSettings.Get("themefolder") == "")  // if we don't have module setting jump out
            {
                rpPaymentGateways.ItemTemplate = new GenXmlTemplate("NO MODULE SETTINGS");
                return;
            }

            try
            {

                var pluginData = new PluginData(PortalSettings.Current.PortalId);
                _provList = pluginData.GetPaymentProviders();
                _cartInfo = new CartData(PortalId);

                var orderid = Utils.RequestQueryStringParam(Context, "orderid");
                var templOk = ModSettings.Get("paymentoktemplate");
                var templFail = ModSettings.Get("paymentfailtemplate");
                var templHeader = "";
                var templFooter = "";
                var templText = "";

                if ((_provList.Count == 0 || _cartInfo.PurchaseInfo.GetXmlPropertyDouble("genxml/appliedtotal") <= 0) && orderid == "")
                {
                    #region "No Payment providers, so process as a ordering system"

                    var displayTempl = templOk;
                    if (!_cartInfo.IsValidated()) displayTempl = templFail;

                    rpDetailDisplay.ItemTemplate = NBrightBuyUtils.GetGenXmlTemplate(ModCtrl.GetTemplateData(ModSettings, displayTempl, Utils.GetCurrentCulture(), DebugMode), ModSettings.Settings(), PortalSettings.HomeDirectory);
                    _templateHeader = (GenXmlTemplate) rpDetailDisplay.ItemTemplate;

                    #endregion
                }
                else
                {
                    #region "Payment Details"

                    // display the payment method by default
                    templHeader = ModSettings.Get("paymentordersummary");
                    templFooter = ModSettings.Get("paymentfooter");
                    var templPaymentText = "";
                    var msg = "";
                    if (Utils.IsNumeric(orderid))
                    {
                        // orderid exists, so must be return from bank; Process it!!
                        _orderData = new OrderData(PortalId, Convert.ToInt32(orderid));
                        _prov = PaymentsInterface.Instance(_orderData.PaymentProviderKey);

                        msg = _prov.ProcessPaymentReturn(Context);
                        if (msg == "") // no message so successful
                        {
                            _orderData = new OrderData(PortalId, Convert.ToInt32(orderid)); // get the updated order.
                            _orderData.PaymentOk("050");
                            templText = templOk;
                        }
                        else
                        {
                            _orderData = new OrderData(PortalId, Convert.ToInt32(orderid)); // reload the order, becuase the status and typecode may have changed by the payment provider.
                            _orderData.AddAuditMessage(msg, "paymsg", "payment.ascx", "False");
                            _orderData.Save();
                            templText = templFail;
                        }
                        templFooter = ""; // return from bank, hide footer
                    }
                    else
                    {
                        // not returning from bank, so display list of payment providers.
                        rpPaymentGateways.ItemTemplate = NBrightBuyUtils.GetGenXmlTemplate(GetPaymentProviderTemplates(), ModSettings.Settings(), PortalSettings.HomeDirectory);
                    }

                    if (templText == "") templText = templHeader; // if we are NOT returning from bank, then display normal header summary template
                    templPaymentText = ModCtrl.GetTemplateData(ModSettings, templText, Utils.GetCurrentCulture(), DebugMode);

                    rpDetailDisplay.ItemTemplate = NBrightBuyUtils.GetGenXmlTemplate(templPaymentText, ModSettings.Settings(), PortalSettings.HomeDirectory);
                    _templateHeader = (GenXmlTemplate) rpDetailDisplay.ItemTemplate;

                    if (templFooter != "")
                    {
                        var templPaymentFooterText = ModCtrl.GetTemplateData(ModSettings, templFooter, Utils.GetCurrentCulture(), DebugMode);
                        rpDetailFooter.ItemTemplate = NBrightBuyUtils.GetGenXmlTemplate(templPaymentFooterText, ModSettings.Settings(), PortalSettings.HomeDirectory);
                    }

                    #endregion
                }

                // insert page header text
                NBrightBuyUtils.IncludePageHeaders(ModCtrl, ModuleId, Page, _templateHeader, ModSettings.Settings(), null, DebugMode);

            }
            catch (Exception exc)
            {
                //display the error on the template (don;t want to log it here, prefer to deal with errors directly.)
                var l = new Literal();
                l.Text = exc.ToString();
                phData.Controls.Add(l);
            }
        }
示例#27
0
        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());

            }
        }