コード例 #1
0
 public ActionResult Details(int id)
 {
     Part model = db.Get(id);
     if (model == null)
     {
         return View(ViewNameNotFound);
     }
     return View(model);
 }
コード例 #2
0
        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;
        }
コード例 #3
0
        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;
        }