public CustomerOrderFullPOCO(CustomerOrderPOCO order)
 {
     Id                = order.Id;
     OrderType         = order.OrderType;
     Job               = new FullJobPOCO(IDatabaseController.DatabaseController.GetJob(order.LinkedJobId).Result);
     OrderDetals       = order.OrderDetals;
     OrderDate         = order.OrderDate;
     Completed         = order.Completed;
     Customer          = IDatabaseController.DatabaseController.GetCustomer(order.CustomerId).Result;
     Customer.FullName = ShortcutCustomerName(Customer.FullName);
 }
Exemple #2
0
        public static async Task <FullJobPOCO> BuildFullJobDTO(JobPOCO job)
        {
            var result = new FullJobPOCO();

            result.Id             = job.Id;
            result.ComponentsUsed = new Dictionary <ComponentPOCO, int>();
            foreach (var component in job.ComponentsUsed)
            {
                result.ComponentsUsed.Add(await IDatabaseController.DatabaseController.GetComponent(component.Key), component.Value);
            }
            result.Description = job.Description;
            result.Complete    = job.Complete;
            return(result);
        }
        public static async Task <CustomerOrderFullPOCO> BuildCustomerOrderFullDTO(CustomerOrderPOCO order)
        {
            var result = new CustomerOrderFullPOCO();

            result.Id        = order.Id;
            result.OrderType = order.OrderType;
            result.Job       = await FullJobPOCO.BuildFullJobDTO(await IDatabaseController.DatabaseController.GetJob(order.LinkedJobId));

            result.OrderDetals = order.OrderDetals;
            result.OrderDate   = order.OrderDate;
            result.Completed   = order.Completed;
            result.Customer    = await IDatabaseController.DatabaseController.GetCustomer(order.CustomerId);

            result.Customer.FullName = ShortcutCustomerName(result.Customer.FullName);
            return(result);
        }