public IActionResult AddMachineToOrder(AddMachineGetDTO dtoGet) { var model = orderManager.GetAddingMachineViewModel(dtoGet); dbManager.Commit(); return(View("AddMachineToOrder", model)); }
internal AddingMachineViewModel GetAddingMachineViewModel(AddMachineGetDTO dtoGet) { var model = new AddingMachineViewModel { OrderId = dtoGet.OrderId, MachineryOnShift = dtoGet.MoSId > 0 ? dbManager.GetById <MachineryOnShift>(dtoGet.MoSId) : new MachineryOnShift(dbManager.GetById <Machinery>(dtoGet.MachineId)) }; model = FillViewModelForAddingMachine(model); return(model); }