Пример #1
0
 public Order_Edit(ICustomerData customerData, IEmployeeData employeeData, IStatusData statusData, Order order)
 {
     Order     = order;
     Customers = customerData.GetAll();
     Employees = employeeData.GetAll();
     Statuses  = statusData.GetAll();
 }
Пример #2
0
 public Order_Edit(ICustomerData customerDb, IEmployeeData employeeDb, IStatusData statusDb, IOrderData orderDb, int id) : this(customerDb, employeeDb, statusDb, orderDb.Get(id))
 {
     if (Order == null)
     {
         throw new NotFoundInDatabaseException();
     }
 }
        public AmountPerStatusModel()
        {
            IStatusData statusData = DependencyResolver.Current.GetService <IStatusData>();
            IOrderData  orderData  = DependencyResolver.Current.GetService <IOrderData>();

            AmountPerStatuses = new List <Order_Index_Status>();

            IEnumerable <Status> statuses = statusData.GetAll();
            IEnumerable <Order>  orders   = orderData.GetAllToDo();

            foreach (Status status in statuses)
            {
                AmountPerStatuses = AmountPerStatuses.Concat(new[] { new Order_Index_Status {
                                                                         Id = status.Id, Status = status.StatusDescription, StatusColour = status.StatusColour, Amount = 0
                                                                     } });
            }
            foreach (Order order in orders)
            {
                foreach (Order_Index_Status status in AmountPerStatuses)
                {
                    if (order.StatusId == status.Id)
                    {
                        status.Amount++;
                        break;
                    }
                }
            }
        }
 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 Order_Detail(IEmployeeData employeeData, ICustomerData customerData, IStatusData statusData, IOrderData orderData, int orderId) : base()
        {
            Order order = orderData.Get(orderId);

            if (order == null)
            {
                throw new NotFoundInDatabaseException();
            }

            Employee             employee = employeeData.Get(order.EmployeeId);
            IEnumerable <Status> statuses = statusData.GetAll();

            Construtor(employee, customerData, statuses, order);
        }
Пример #6
0
        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);
        }
Пример #7
0
 public StatusController(IStatusData statusData)
 {
     this.statusData = statusData;
 }
        public Order_Detail(Employee employee, ICustomerData customerData, IStatusData statusData, Order order) : base()
        {
            IEnumerable <Status> statuses = statusData.GetAll();

            Construtor(employee, customerData, statuses, order);
        }