public String GetIndividualOrderTitle(orders.IndividualOrder indOrder)
        {
            String title = String.Format(Title, number);

            number++;
            return(title);
        }
        public static IndividualOrder GetIndividualOrderByID(int individualOrderID)
        {
            DBIndividualOrder dbItem = DBProviderManager <DBIndividualOrderProvider> .Provider.GetIndividualOrderByID(individualOrderID);

            IndividualOrder indivOrder = DBMapping(dbItem);

            return(indivOrder);
        }
 public String GetIndividualOrderURL(orders.IndividualOrder indOrder)
 {
     if (indOrder != null)
     {
         return(SEOHelper.GetIndividualOrderURL(indOrder));
     }
     return(string.Empty);
 }
        public static void DeleteIndividualOrder(int IndividualOrderID)
        {
            IndividualOrder indivOrder = GetIndividualOrderByID(IndividualOrderID);

            if (indivOrder != null)
            {
                DBProviderManager <DBIndividualOrderProvider> .Provider.DeleteIndividualOrder(IndividualOrderID);
            }
        }
        private static IndividualOrder DBMapping(DBIndividualOrder dbItem)
        {
            if (dbItem == null)
            {
                return(null);
            }

            IndividualOrder item = new IndividualOrder();

            item.IndividualOrderID      = dbItem.IndividualOrderID;
            item.OrderText              = dbItem.OrderText;
            item.Price                  = dbItem.Price;
            item.SerialNumberInShCart   = dbItem.SerialNumberInShCart;
            item.CurrentUserSessionGuid = item.CurrentUserSessionGuid;

            return(item);
        }
        private static IndividualOrderCollection DBMapping(DBIndividualOrderCollection dbCollection)
        {
            if (dbCollection == null)
            {
                return(null);
            }

            IndividualOrderCollection collection = new IndividualOrderCollection();

            foreach (DBIndividualOrder dbItem in dbCollection)
            {
                IndividualOrder item = DBMapping(dbItem);
                collection.Add(item);
            }

            return(collection);
        }
        public String GetIndividualOrderPriceString(orders.IndividualOrder indOrder)
        {
            String price = String.Empty;

            if (indOrder != null)
            {
                if (Request.Cookies["Currency"] != null && Request.Cookies["Currency"].Value == "USD")
                {
                    price = Math.Round(PriceConverter.ToUsd(indOrder.Price)).ToString() + "$";
                }
                else
                {
                    price = indOrder.Price.ToString();
                }
            }

            return(price);
        }
        public static IndividualOrder InsertIndividualOrder(Guid userGuid, long Price, String OrderText)
        {
            if (userGuid == null || Price == null)
            {
                return(null);
            }

            if (HttpContext.Current.Request.Cookies["Currency"] != null && HttpContext.Current.Request.Cookies["Currency"].Value == "USD")
            {
                Price = PriceConverter.ToBYR(Price);
            }

            DBIndividualOrder dbItem = null;

            dbItem = DBProviderManager <DBIndividualOrderProvider> .Provider.InsertIndividualOrder(userGuid, Price, OrderText);

            IndividualOrder indOrder = DBMapping(dbItem);

            return(indOrder);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Gets individual order URL
        /// </summary>
        /// <param name="product">Product</param>
        /// <returns>Product URL</returns>
        public static string GetIndividualOrderURL(IndividualOrder indOrder)
        {
            if (indOrder == null)
                throw new ArgumentNullException("indOrder");

            string url = string.Format("{0}IndividualOrder.aspx?orderID={1}", 
                                       CommonHelper.GetStoreLocation(), indOrder.IndividualOrderID);
            return url;
        }