public CarInServiceViewData(CarViewData carViewData, WorkerViewData workerViewData,
                             List <MalfunctionViewData> malfunctionsViewData)
 {
     CarViewData          = carViewData;
     WorkerViewData       = workerViewData;
     MalfunctionsViewData = malfunctionsViewData;
 }
        public RepairOrderViewData(RepairOrder order, ClientViewData clientViewData, CarViewData carViewData,
                                   WorkerViewData workerViewData, List <MalfunctionViewData> malfunctionViewModels)
        {
            Id = order.Id;
            DateOfTheApplication = order.DateOfTheApplication;
            IsReady               = order.IsReady;
            ClientViewData        = clientViewData;
            CarViewData           = carViewData;
            WorkerViewData        = workerViewData;
            MalfunctionViewModels = malfunctionViewModels;

            Price            = MalfunctionViewModels.Sum(m => m.Price);
            DateOfCompletion = DateTime.Now + TimeSpan.FromHours(MalfunctionViewModels.Sum(m => m.TimeToFix) + 12);
        }