public OrderPart_Detail(IOrderPartData OrderPartData, IPartData partData, int orderId, int OrderPartId) { OrderPart OrderPart = OrderPartData.Get(orderId, OrderPartId); if (OrderPart == null) { throw new NotFoundInDatabaseException(); } Constructor(partData, OrderPart); }
public OrderController(ICustomerData customerDb, IEmployeeData employeeDb, IImageData imageListDb, IOrderData orderDb, IPartData partDb, IOrderPartData OrderPartDb, IStatusData statusDb) { this.customerDb = customerDb; this.employeeDb = employeeDb; this.imageListDb = imageListDb; this.orderDb = orderDb; this.partDb = partDb; this.OrderPartDb = OrderPartDb; this.statusDb = statusDb; }
public OrderPart_Detail(IPartData partData, IOrderPartData OrderPartData, int orderId, int partId) { OrderPart orderPart = OrderPartData.Get(orderId, partId); if (orderPart == null) { throw new NotFoundInDatabaseException(); } Part part = partData.Get(orderPart.PartId); OrderId = orderPart.OrderId; PartId = orderPart.PartId; Name = part.Name; Amount = orderPart.Amount; Price = part.Price; }
public Order_FullDetails(ICustomerData customerData, IEmployeeData employeeData, IImageData imageData, IOrderData orderData, IPartData partData, IOrderPartData OrderPartData, IStatusData statusData, int orderId) { Order order = orderData.Get(orderId); if (order == null) { throw new NotFoundInDatabaseException(); } Employee employee = employeeData.Get(order.EmployeeId); Details = new Order_Detail(employee, customerData, statusData, order); this.OrderParts = new List <OrderPart_Detail>(); EmployeePayPerHour = employee.PayPerHour; IEnumerable <OrderPart> OrderParts = OrderPartData.Get(orderId); foreach (OrderPart OrderPart in OrderParts) { OrderPart_Detail newDetail = new OrderPart_Detail(partData, OrderPart); this.OrderParts = this.OrderParts.Concat(new[] { newDetail }); } Images = imageData.GetOrderImages(orderId); }