public ActionResult Details(int id) { Part model = db.Get(id); if (model == null) { return View(ViewNameNotFound); } return View(model); }
private void Constructor(IPartData partData, OrderPart OrderPart) { Part part = partData.Get(OrderPart.PartId); OrderId = OrderPart.OrderId; PartId = OrderPart.PartId; Name = part.Name; Amount = OrderPart.Amount; Price = part.Price; }
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; }