/// <summary>
 /// Custom ctor for "casting" a order detail in a shopping cart
 /// </summary>
 /// <param name="Detail"></param>
 public SHOPPING_CART(ORDER_DETAIL Detail)
 {
     this.ProdAttrID = Detail.ProdAttrID;
     this.CampaignID = Detail.CampaignID;
     this.CampaignName = Detail.CampaignName;
     this.BrandName = Detail.BrandName;
     this.ProductName = Detail.ProductName;
     this.ProductAttribute = Detail.ProductAttribute;
     this.ProductThumbnail = Detail.ProductThumbnail;
     this.Quantity = Detail.Quantity;
     if (Detail.UnitPrice.HasValue)
     {
         this.UnitPrice = Detail.UnitPrice.Value;
     }
 }
示例#2
0
 /// <summary>
 /// Custom ctor for "casting" a order detail in a shopping cart
 /// </summary>
 /// <param name="Detail"></param>
 public SHOPPING_CART(ORDER_DETAIL Detail)
 {
     this.ProdAttrID       = Detail.ProdAttrID;
     this.CampaignID       = Detail.CampaignID;
     this.CampaignName     = Detail.CampaignName;
     this.BrandName        = Detail.BrandName;
     this.ProductName      = Detail.ProductName;
     this.ProductAttribute = Detail.ProductAttribute;
     this.ProductThumbnail = Detail.ProductThumbnail;
     this.Quantity         = Detail.Quantity;
     if (Detail.UnitPrice.HasValue)
     {
         this.UnitPrice = Detail.UnitPrice.Value;
     }
 }
示例#3
0
        private void FixupORDER_DETAIL(ORDER_DETAIL previousValue)
        {
            if (previousValue != null && previousValue.RETURN_DETAILS.Contains(this))
            {
                previousValue.RETURN_DETAILS.Remove(this);
            }

            if (ORDER_DETAIL != null)
            {
                if (!ORDER_DETAIL.RETURN_DETAILS.Contains(this))
                {
                    ORDER_DETAIL.RETURN_DETAILS.Add(this);
                }
                if (OrderDetailID != ORDER_DETAIL.ID)
                {
                    OrderDetailID = ORDER_DETAIL.ID;
                }
            }
            else if (!_settingFK)
            {
                OrderDetailID = null;
            }
        }
        private void FixupORDER_DETAIL(ORDER_DETAIL previousValue)
        {
            if (previousValue != null && previousValue.RETURN_DETAILS.Contains(this))
            {
                previousValue.RETURN_DETAILS.Remove(this);
            }

            if (ORDER_DETAIL != null)
            {
                if (!ORDER_DETAIL.RETURN_DETAILS.Contains(this))
                {
                    ORDER_DETAIL.RETURN_DETAILS.Add(this);
                }
                if (OrderDetailID != ORDER_DETAIL.ID)
                {
                    OrderDetailID = ORDER_DETAIL.ID;
                }
            }
            else if (!_settingFK)
            {
                OrderDetailID = null;
            }
        }
        public void InsertDetailsFromCart(ORDERS Order, List<SHOPPING_CART> Cart, bool Attach = true)
        {
            if (Cart != null && Cart.Count > 0)
            {
                ORDER_DETAIL detail;
                foreach (SHOPPING_CART item in Cart)
                {
                    detail = new ORDER_DETAIL();
                    detail.OrderID = Order.ID;
                    detail.CampaignID = item.CampaignID;
                    detail.ProdAttrID = item.ProdAttrID;
                    detail.Quantity = item.Quantity;

                    // first insert order
                    _orderDAO.InsertDetail(detail);

                    item.CAMPAIGN = null;
                    item.CUSTOMER = null;
                    item.PRODUCT_ATTRIBUTE = null;

                    //second remove the related cart item
                    _cartDAO.Delete(item, Attach);
                }
                Context.SaveChanges();
            }
        }
示例#6
0
 public void InsertDetail(ORDER_DETAIL Detail)
 {
     Context.ORDER_DETAIL.AddObject(Detail);
 }
 private static void WriteBodyDettailOrder(ORDER_DETAIL orderDett, PdfPTable tblFattura, int count, Font itemsStyle, ref int nrItem)
 {
     PdfPCell cellFat;
     cellFat = new PdfPCell
     {
         Border = Rectangle.NO_BORDER,
         BorderWidthBottom = 1f,
         BorderColorBottom = BaseColor.GRAY,
         HorizontalAlignment = 2
     };
     string info = string.Empty;
     switch (count)
     {
         case 2:
             info = nrItem.ToString();
             nrItem += 1;
             break;
         case 3:
             info = String.Format(FashionZone.BL.Configuration.OrderNrFormatting, orderDett.ProdAttrID);
             break;
         case 4:
             info = orderDett.ProductNameWithSizeAndCode;
             break;
         case 5:
             info = CalcTvsh(orderDett.UnitPrice.Value);
             break;
         case 6:
             info = ConfigurationManager.AppSettings["TVSHPDF"];
             break;
         case 7:
             info = orderDett.UnitPrice.Value.ToString();
             break;
         case 8:
             info = orderDett.Quantity.ToString();
             break;
         case 9:
             info = (orderDett.UnitPrice * orderDett.Quantity).ToString();
             break;
     }
     cellFat.AddElement(new Phrase(info, itemsStyle));
     tblFattura.AddCell(cellFat);
 }