示例#1
0
    /****************************************************************
     *
     * AddToCart()
     *
     ***************************************************************/
    protected void AddToCart(string sGUID, int nQty)
    {
        productGUID = new Guid(sGUID);
        try
        {
            product = ProductController.GetProductDeepByGUID(productGUID);
            //make sure we have a product
            TestCondition.IsTrue(product.IsLoaded, "Invalid url/product id");

            //set the page variables
            productID        = product.ProductID;
            productSku       = product.Sku;
            product.Quantity = nQty;

            OrderController.AddCallCenterItem(product);

            /********************
             * //* the following if stmt is to track orders from TheLoveDepot.com 2/10
             * string sID = "";
             * sID = HttpContext.Current.Request.Cookies["ID"].Value;
             * if (sID != null)
             * {
             *  Order currentOrder = OrderController.GetCurrentOrder();
             *  OrderController.AddNote(sID, currentOrder);
             * }
             **************/
        }
        catch (Exception ex)
        {
            LovRubLogger.LogException(ex);
            throw ex;
        }
    }
示例#2
0
    protected void btnWomen3_Click(object sender, EventArgs e)
    {
        string sProductGUID = "f6d3b994-d5ca-491f-b55a-f22fa8974b25";

        productGUID = new Guid(sProductGUID);
        try
        {
            product = ProductController.GetProductDeepByGUID(productGUID);
            //make sure we have a product
            TestCondition.IsTrue(product.IsLoaded, "Invalid url/product id");

            //set the page variables
            productID        = product.ProductID;
            productSku       = product.Sku;
            product.Quantity = 3;
            OrderController.AddItem(product);
            AddKeyForOrderMotion();
            //This behavior is by design
            //See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebhttpresponseclassendtopic.asp
            Response.Redirect("additemresult.aspx", false);
            //Response.Redirect("order.aspx", false); KPL
        }
        catch (Exception ex)
        {
            LovRubLogger.LogException(ex); // 04/10/08 KPL added
            throw ex;
            //ExceptionPolicy.HandleException(ex, "Application Exception");
            //Response.Redirect(Page.ResolveUrl("~/ExceptionPage.aspx"), false);
        }
    }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //this page can be accessed using a CategoryID (cid)
        //or by categoryName using the UrlRewriter

        categoryID   = Utility.GetIntParameter("cid");
        categoryName = Utility.GetParameter("n");
        categoryGUID = Utility.GetParameter("guid");

        if (!Page.IsPostBack)
        {
            LoadData();
        }


        //###############################################################################
        //  Page Validators - these must be implemented or they will be redirected
        //###############################################################################
        try
        {
            TestCondition.IsTrue(ds.Tables.Count == 6, "Invalid Query");
            TestCondition.IsTrue(ds.Tables[0].Rows.Count > 0, "Invalid Query");
        }
        catch (Exception ex)
        {
            ExceptionPolicy.HandleException(ex, "Application Exception");
            Response.Redirect(Page.ResolveUrl("~/ExceptionPage.aspx"), false);
        }
        //##############################################################################

        //track this
        LoadPage();
        //TickStats(); KPL
    }
示例#4
0
    protected void btnMen3_Click(object sender, EventArgs e)
    {
        string sProductGUID = "a3ba18d1-b7d0-488c-9687-706873e0ee53";

        productGUID = new Guid(sProductGUID);
        try
        {
            product = ProductController.GetProductDeepByGUID(productGUID);
            //make sure we have a product
            TestCondition.IsTrue(product.IsLoaded, "Invalid url/product id");

            //set the page variables
            productID        = product.ProductID;
            productSku       = product.Sku;
            product.Quantity = 3;
            OrderController.AddItem(product);
            AddKeyForOrderMotion();
            //This behavior is by design
            //See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebhttpresponseclassendtopic.asp
            Response.Redirect("additemresult.aspx", false);
            //Response.Redirect("order.aspx", false); KPL
        }
        catch (Exception ex)
        {
            LovRubLogger.LogException(ex); // 04/10/08 KPL added
            throw ex;
        }
    }
示例#5
0
 void ValidatePage()
 {
     //Page Validation
     //1) Need items in order to checkout
     try {
         TestCondition.IsTrue(currentOrder.Items.Count > 0, "There are not items in your cart");
     }
     catch {
         //send them to the basket page
         Response.Redirect("~/Basket.aspx", false);
     }
     //2) Need to have this page under SSL!
     Utility.TestForSSL();
 }
示例#6
0
    /****************************************************************
     *
     * AddToCart()
     *
     * *************************************************************/
    void AddToCart(string sGUID, int nQty)
    {
        //string sFemaleProductGUID = "f6d3b994-d5ca-491f-b55a-f22fa8974b25";
        productGUID = new Guid(sGUID);
        try
        {
            product = ProductController.GetProductDeepByGUID(productGUID);
            //make sure we have a product
            TestCondition.IsTrue(product.IsLoaded, "Invalid url/product id");

            //set the page variables
            productID        = product.ProductID;
            productSku       = product.Sku;
            product.Quantity = nQty;
            OrderController.AddCallCenterItem(product);

            //**********************************************************************************
            // Add keycode for OrderMotion
            // but only add one note, so check to see if the keycode note has already been added.
            //**********************************************************************************
            bool bIsCallCtrOrder = false;
            currentOrder = OrderController.GetCurrentOrder();
            OrderNoteCollection noteCollection = currentOrder.Notes;
            int nCount = noteCollection.Count;
            for (int nIndex = 0; nCount > nIndex; nIndex++)
            {
                OrderNote note = noteCollection[nIndex];
                //if (note.Equals("CALLCENTER"))
                if (true == note.Note.Equals("CALLCENTER"))
                {
                    bIsCallCtrOrder = true;
                    break;
                }
            }
            if (false == bIsCallCtrOrder)
            {
                OrderController.AddNote("CALLCENTER", currentOrder);
            }
        }
        catch (Exception ex)
        {
            LovRubLogger.LogException(ex);
            throw ex;
        }
    }
示例#7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //###############################################################################
        //  Page Validators - these must be implemented or they will be redirected
        //###############################################################################
        try {
            string sProductGUID = Utility.GetParameter("guid");
            productID  = Utility.GetIntParameter("id");
            productSku = Utility.GetParameter("n");

            if (sProductGUID != string.Empty)
            {
                productGUID = new Guid(sProductGUID);
                product     = ProductController.GetProductDeepByGUID(productGUID);
            }
            else if (productID != 0)
            {
                product = ProductController.GetProductDeep(productID);
            }
            else if (productSku != string.Empty)
            {
                product = ProductController.GetProductDeep(productSku);
            }

            //make sure we have a product
            TestCondition.IsTrue(product.IsLoaded, "Invalid url/product id");

            //set the page variables
            productID  = product.ProductID;
            productSku = product.Sku;
        }
        catch (Exception ex) {
            //throw ex;
            //ExceptionPolicy.HandleException(ex, "Application Exception");
            Response.Redirect(Page.ResolveUrl("~/ExceptionPage.aspx"), false);
        }
        //##############################################################################

        //load the product ratings

        BindProductInfo();
        //TickStats(); KPL
    }
示例#8
0
    /****************************************************************
     *
     * AddToCart()
     *
     * *************************************************************/
    void AddToCart(string sGUID, int nQty)
    {
        productGUID = new Guid(sGUID);
        try
        {
            product = ProductController.GetProductDeepByGUID(productGUID);
            //make sure we have a product
            TestCondition.IsTrue(product.IsLoaded, "Invalid url/product id");

            //set the page variables
            productID        = product.ProductID;
            productSku       = product.Sku;
            product.Quantity = nQty;
            OrderController.AddCallCenterItem(product);
        }
        catch (Exception ex)
        {
            LovRubLogger.LogException(ex);
            throw ex;
        }
    }
示例#9
0
        public static Commerce.Common.Transaction RunCharge(Commerce.Common.Order order)
        {
            //validations
            //CCNumber
            TestCondition.IsTrue(IsValidCardType(order.CreditCardNumber, order.CreditCardType), "Invalid Credit Card Number");

            //current expiration
            DateTime expDate = new DateTime(order.CreditCardExpireYear, order.CreditCardExpireMonth, 28);

            TestCondition.IsTrue(expDate >= DateTime.Today, "This credit card appears to be expired");

            //amount>0
            TestCondition.IsGreaterThanZero(order.OrderTotal, "Charge amount cannot be 0 or less");

            Commerce.Common.Transaction result = Instance.Charge(order);


            result.TransactionDate = DateTime.UtcNow;
            result.Amount          = order.OrderTotal;

            return(result);
        }