> >public OrderDetailEntity ShowOrderDetailLine(int detailPK) >{ > OrderDetailEntity orderDetailEntity; > this.GetEntity("SELECT * FROM OrderDetail WHERE ProductID = @ProductID", > this.CreateParameter("@ProductID", detailPK)); > > // to display locally which I don't recommend, I think you should pass it back to the UI to display it regardless of how > // you could just refer to the this.Entity.fieldNames here > > // then pass back the entity > return orderDetailEntity; >} > > >In the button click above I would display the entity once it is returned back >I had this in there >oOrderDetail.ShowOrderDetailLine(pkVal); > >Just add this: >Debug.WriteLine("ProductID is: " + oOrderDetail.Entity.ProductID.ToString() + "Product Name is: " + oOrderDetail.Entity.Name etc...); > >>
public void ShowProduct(int orderPK, int productID) { OrderDetailEntity ode; ode = GetEntity("OrderDetailsSelectByPK", this.CreateParameter("@OrderID", orderPK),this.CreateParameter("@ProductID", productID)); Console.WriteLine("in orderdetail.partial: OrderID is " + ode.OrderID.ToString() + " ProductID is: " + ode.ProductID.ToString() + " qty is: " + ode.Quantity); }I guess what you're telling me is there is no cleaner approach that what I've been doing, so in general the approach would be: