|
using System;
using Iesi.Collections.Generic;
namespace ECommerceSystem.Domain
{
class OrderNumberHelper
{
public static string GenerateOrderNumber()
{
// GetTodaysDate and make orderno from it
//by concatenating orderno with it
orderNo++;
return ((DateTime.Now.ToShortDateString()).Replace("/","")+orderNo.ToString());
}
private static int orderNo;
}
public class Order
{
public Order()
{
OrderNumber = OrderNumberHelper.GenerateOrderNumber();
OrderItems = new HashedSet<Item>();
NotAvailableItemDescriptions = new System.Collections.Generic.List<ProductDescription>();
}
public Order(bool is_fast_shipping)
{
OrderNumber = OrderNumberHelper.GenerateOrderNumber();
OrderItems = new HashedSet<Item>();
IsFastShipping = true;
NotAvailableItemDescriptions = new System.Collections.Generic.List<ProductDescription>();
}
public virtual long OrderId { get; set; }
public virtual string OrderNumber { get; set; }
public virtual ISet<Item> OrderItems { get; set; }
public virtual Customer OrderedByCustomer { get; set; }
public virtual double ShippingCharges { get; set; }
public virtual double OrderCost { get; set; }
//Order page data
public virtual bool IsFastShipping { get; set; }
//Order page data
public virtual bool IsGiftWrapped { get; set; }
public virtual System.Collections.Generic.IList<ProductDescription> NotAvailableItemDescriptions { get; set; }
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.