private void detach_orderdetails(orderdetail entity)
		{
			this.SendPropertyChanging();
			entity.order = null;
		}
 partial void Deleteorderdetail(orderdetail instance);
 partial void Updateorderdetail(orderdetail instance);
 partial void Insertorderdetail(orderdetail instance);
		private void attach_orderdetails(orderdetail entity)
		{
			this.SendPropertyChanging();
			entity.product = this;
		}
Пример #6
0
        public bool insertOrderDetails(int orderId, int pId, int amount)
        {
            orderdetail od = new orderdetail {
                orderID = orderId,
                productID = pId,
                quantity = amount
            };

            db.orderdetails.InsertOnSubmit(od);
            try
            {
                db.SubmitChanges();
                return true;
            }
            catch
            {
                return false;
            }
        }