partial void UpdateProductionRequestDetail(ProductionRequestDetail instance);
 partial void DeleteProductionRequestDetail(ProductionRequestDetail instance);
		private void detach_ProductionRequestDetails(ProductionRequestDetail entity)
		{
			this.SendPropertyChanging();
			entity.BaseAttribute = null;
		}
 partial void InsertProductionRequestDetail(ProductionRequestDetail instance);
		private void attach_ProductionRequestDetails(ProductionRequestDetail entity)
		{
			this.SendPropertyChanging();
			entity.ProductionRequest = this;
		}
		private void detach_ProductionRequestDetails(ProductionRequestDetail entity)
		{
			this.SendPropertyChanging();
			entity.MeasurementUnit = null;
		}
 private void dgvProduct_CellEndEdit(object sender, DataGridViewCellEventArgs e)
 {
     DataGridView dgv = (DataGridView)sender;
     if (productionRequestDetailInProductions == null)
     {
         productionRequestDetailInProductions = new BindingList<ProductionRequestDetail>();
     }
     if (productionRequestDetailInProductions.Count < dgvProduct.RowCount - 1)
     {
         ProductionRequestDetail productionRequestDetail = new ProductionRequestDetail();
         productionRequestDetailInProductions.Add(productionRequestDetail);
     }
     if (dgv.CurrentCell.Value != null)
     {
         switch (e.ColumnIndex)
         {
             case ProductAttrCell:
                 {
                     ProductAttributeService productAttrService = new ProductAttributeService();
                     ProductAttribute pa = productAttrService.GetProductAttribute((int)dgv.CurrentCell.Value);
                     if (pa != null)
                     {
                         productionRequestDetailInProductions[e.RowIndex].ProductId = pa.ProductId;
                         productionRequestDetailInProductions[e.RowIndex].AttributeId = pa.AttributeId;
                     }
                 } break;
             case NumberUnitCell:
                 productionRequestDetailInProductions[e.RowIndex].NumberUnit = (int)dgv.CurrentCell.Value;
                 break;
             case UnitCell:
                 productionRequestDetailInProductions[e.RowIndex].UnitId = (int)dgv.CurrentCell.Value;
                 break;
             case NoteCell:
                 productionRequestDetailInProductions[e.RowIndex].Note = (string)dgv.CurrentCell.Value;
                 break;
         }
     }
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the ProductionRequestDetails EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToProductionRequestDetails(ProductionRequestDetail productionRequestDetail)
 {
     base.AddObject("ProductionRequestDetails", productionRequestDetail);
 }
 /// <summary>
 /// Create a new ProductionRequestDetail object.
 /// </summary>
 /// <param name="reqId">Initial value of the ReqId property.</param>
 /// <param name="productId">Initial value of the ProductId property.</param>
 public static ProductionRequestDetail CreateProductionRequestDetail(global::System.Int32 reqId, global::System.Int32 productId)
 {
     ProductionRequestDetail productionRequestDetail = new ProductionRequestDetail();
     productionRequestDetail.ReqId = reqId;
     productionRequestDetail.ProductId = productId;
     return productionRequestDetail;
 }