Ejemplo n.º 1
0
        public ActionResult ActivationCode(int NewOrderId, int Id, string sessionId) //enter activation code in each product
        {
            //define the variable needed first
            string activationCode = "";

            List <Order> OrderSummary = (List <Order>)Session[sessionId + "_Orders"];

            foreach (Order order in OrderSummary)
            {
                for (int i = 0; i < order.Quantity; i++)
                {
                    activationCode = Add.getCode();
                    string message = ProductsData.EnterActivationCode(NewOrderId, order.ProductId, activationCode);
                }
            }

            return(RedirectToAction("ViewPurchaseHistory", "Checkout", new { NewOrderId = NewOrderId, Id = Id, sessionId = sessionId }));
        }