示例#1
0
        public Order(Guid id, Customer customer, Employee employee, DateTime RequiredDate, string shipName, string shipAddress,
                     string shipCity, string shipPostalCode, string shipCountry, Guid shipVia)
        {
            if (_orderDetails == null)
            {
                _orderDetails = new List <OrderDetail>();
            }
            TypeDataCheck.IsNull(customer);
            TypeDataCheck.checkId(customer.Id);

            TypeDataCheck.IsNull(employee);
            TypeDataCheck.checkId(employee.Id);

            TypeDataCheck.checkId(shipVia);

            TypeDataCheck.IsNull(shipName);
            TypeDataCheck.IsNull(shipAddress);
            TypeDataCheck.IsNull(shipCity);
            TypeDataCheck.IsNull(shipCountry);

            SetId(id);
            CustomerID     = customer.Id;
            EmployeeID     = employee.Id;
            ShipName       = shipName;
            ShipAddress    = shipAddress;
            ShipCity       = shipCity;
            ShipPostalCode = shipPostalCode;
            ShipCountry    = shipCountry;
            ShipVia        = shipVia;
            SetOrderDate();
            setShippedDate();
            setRequiredDate(RequiredDate);
        }
        public Category(Guid id, string name, string description = "", string picture = "")
        {
            TypeDataCheck.checkId(id);
            TypeDataCheck.IsNullOrEmpty(name);

            SetId(id);
            SetName(name);
            Description = description;
            Picture     = picture;
        }
        public Shipper(Guid id, string companyName, string phone)
        {
            TypeDataCheck.checkId(id);
            TypeDataCheck.IsNullOrEmpty(companyName);
            TypeDataCheck.IsNullOrEmpty(phone);

            SetId(id);
            CompanyName = companyName;
            Phone       = phone;
        }
示例#4
0
        public void AddOrderDetail(OrderDetail orderdetail)
        {
            TypeDataCheck.IsNull(orderdetail);
            TypeDataCheck.checkId(orderdetail.OrderID);
            TypeDataCheck.checkId(orderdetail.ProductId);

            var exitsOrderDetail = _orderDetails.Where(x => x.ProductId == orderdetail.ProductId && x.OrderID == orderdetail.OrderID).SingleOrDefault();

            if (exitsOrderDetail != null)
            {
                throw new OrderDetailAlreadyExistException();
            }

            _orderDetails.Add(orderdetail);
        }
示例#5
0
        public OrderDetail(Guid id, Product product, Order order, double unitPrice,
                           short quantity, double disCount = 0)
        {
            TypeDataCheck.checkId(id);
            Id = id;

            TypeDataCheck.IsNull(product);
            SetProductId(product.Id);

            TypeDataCheck.IsNull(order);
            SetOrderId(order.Id);

            SetUnitPrice(unitPrice);
            SetQuantity(quantity);
            SetDisCount(disCount);
        }
 public void AddOrder(Order order)
 {
     TypeDataCheck.IsNull(order);
     TypeDataCheck.checkId(order.Id);
     _orders.Add(order);
 }
 public void SetId(Guid id)
 {
     TypeDataCheck.checkId(id);
     Id = id;
 }
示例#8
0
 public void SetOrderId(Guid orderId)
 {
     TypeDataCheck.checkId(orderId);
     OrderID = orderId;
 }
示例#9
0
 public void SetProductId(Guid productId)
 {
     TypeDataCheck.checkId(productId);
     ProductId = productId;
 }
示例#10
0
 public void SetId(Guid orderId)
 {
     TypeDataCheck.checkId(orderId);
     Id = orderId;
 }
示例#11
0
 public void SetSupplierId(Guid id)
 {
     TypeDataCheck.checkId(id);
     SupplierID = id;
 }
示例#12
0
 public void SetCategoryId(Guid id)
 {
     TypeDataCheck.checkId(id);
     CategoryID = id;
 }
示例#13
0
 public void SetId(Guid employeeId)
 {
     TypeDataCheck.checkId(employeeId);
     Id = employeeId;
 }