/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IErpIssueInventory erpIssueInventoriesCasted = item.As <IErpIssueInventory>(); if ((erpIssueInventoriesCasted != null)) { this._parent.ErpIssueInventories.Add(erpIssueInventoriesCasted); } IErpReqLineItem erpReqLineItemsCasted = item.As <IErpReqLineItem>(); if ((erpReqLineItemsCasted != null)) { this._parent.ErpReqLineItems.Add(erpReqLineItemsCasted); } IMaterialItem materialItemsCasted = item.As <IMaterialItem>(); if ((materialItemsCasted != null)) { this._parent.MaterialItems.Add(materialItemsCasted); } ICUMaterialItem cUMaterialItemsCasted = item.As <ICUMaterialItem>(); if ((cUMaterialItemsCasted != null)) { this._parent.CUMaterialItems.Add(cUMaterialItemsCasted); } }
/// <summary> /// Removes the given item from the collection /// </summary> /// <returns>True, if the item was removed, otherwise False</returns> /// <param name="item">The item that should be removed</param> public override bool Remove(IModelElement item) { IErpIssueInventory erpIssueInventoryItem = item.As <IErpIssueInventory>(); if (((erpIssueInventoryItem != null) && this._parent.ErpIssueInventories.Remove(erpIssueInventoryItem))) { return(true); } IErpReqLineItem erpReqLineItemItem = item.As <IErpReqLineItem>(); if (((erpReqLineItemItem != null) && this._parent.ErpReqLineItems.Remove(erpReqLineItemItem))) { return(true); } IMaterialItem materialItemItem = item.As <IMaterialItem>(); if (((materialItemItem != null) && this._parent.MaterialItems.Remove(materialItemItem))) { return(true); } ICUMaterialItem cUMaterialItemItem = item.As <ICUMaterialItem>(); if (((cUMaterialItemItem != null) && this._parent.CUMaterialItems.Remove(cUMaterialItemItem))) { return(true); } return(false); }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { if ((this._parent.Status == null)) { IStatus statusCasted = item.As <IStatus>(); if ((statusCasted != null)) { this._parent.Status = statusCasted; return; } } if ((this._parent.MaterialItem == null)) { IMaterialItem materialItemCasted = item.As <IMaterialItem>(); if ((materialItemCasted != null)) { this._parent.MaterialItem = materialItemCasted; return; } } if ((this._parent.AssetModel == null)) { IAssetModel assetModelCasted = item.As <IAssetModel>(); if ((assetModelCasted != null)) { this._parent.AssetModel = assetModelCasted; return; } } }
private void domainItemsGrid_DoubleClick(object sender, EventArgs e) { IMaterialItem selectedItem = materialItemsView.GetFocusedRow() as IMaterialItem; if (selectedItem != null) { SelectedItem = selectedItem; } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { if ((this._parent.ErpPOLineItem == null)) { IErpPOLineItem erpPOLineItemCasted = item.As <IErpPOLineItem>(); if ((erpPOLineItemCasted != null)) { this._parent.ErpPOLineItem = erpPOLineItemCasted; return; } } if ((this._parent.ErpInvoiceLineItem == null)) { IErpInvoiceLineItem erpInvoiceLineItemCasted = item.As <IErpInvoiceLineItem>(); if ((erpInvoiceLineItemCasted != null)) { this._parent.ErpInvoiceLineItem = erpInvoiceLineItemCasted; return; } } if ((this._parent.Status == null)) { IStatus statusCasted = item.As <IStatus>(); if ((statusCasted != null)) { this._parent.Status = statusCasted; return; } } if ((this._parent.ErpReceiveDelivery == null)) { IErpReceiveDelivery erpReceiveDeliveryCasted = item.As <IErpReceiveDelivery>(); if ((erpReceiveDeliveryCasted != null)) { this._parent.ErpReceiveDelivery = erpReceiveDeliveryCasted; return; } } IMaterialItem materialItemsCasted = item.As <IMaterialItem>(); if ((materialItemsCasted != null)) { this._parent.MaterialItems.Add(materialItemsCasted); } IAsset assetsCasted = item.As <IAsset>(); if ((assetsCasted != null)) { this._parent.Assets.Add(assetsCasted); } }
private static void WriteQtyAdjustmentTransaction(IMaterialItem item, int adjustmentQty, string comments, AdjustmentTransactionType sourceType) { if (item == null) { return; } string itemLocation = ""; if (item is MaterialWarehouseItem) { itemLocation = item.RackLocation ?? item.Domain.FullLocation; } else if (item is MaterialConsumableItem) { itemLocation = item.Shopfloorline.FullLocation; } Part part = item.Part; Transaction trans = TransactionFactory.CreateTransaction(part.Session, sourceType.Code); trans.TransType = sourceType.Code; if (sourceType.Direction == "IN") { trans.ArrivalLocation = itemLocation; } else { trans.DepartLocation = itemLocation; } trans.Part = part; trans.Qty = adjustmentQty; trans.TransRef = "Material Qty Adjustment"; trans.TransBy = Security.UserSecurity.CurrentUser.Login; trans.TransDate = DateTime.Now; trans.Item = InventoryRepository.GetItemRecordById(trans.Session, "LRAWMATERIALS000"); trans.Comments = comments; }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { if ((this._parent.WorkEquipmentAsset == null)) { IWorkEquipmentInfo workEquipmentAssetCasted = item.As <IWorkEquipmentInfo>(); if ((workEquipmentAssetCasted != null)) { this._parent.WorkEquipmentAsset = workEquipmentAssetCasted; return; } } if ((this._parent.WorkTask == null)) { IWorkTask workTaskCasted = item.As <IWorkTask>(); if ((workTaskCasted != null)) { this._parent.WorkTask = workTaskCasted; return; } } if ((this._parent.MaterialItem == null)) { IMaterialItem materialItemCasted = item.As <IMaterialItem>(); if ((materialItemCasted != null)) { this._parent.MaterialItem = materialItemCasted; return; } } if ((this._parent.Status == null)) { IStatus statusCasted = item.As <IStatus>(); if ((statusCasted != null)) { this._parent.Status = statusCasted; return; } } }
/// <summary> /// Removes the given item from the collection /// </summary> /// <returns>True, if the item was removed, otherwise False</returns> /// <param name="item">The item that should be removed</param> public override bool Remove(IModelElement item) { if ((this._parent.ErpPOLineItem == item)) { this._parent.ErpPOLineItem = null; return(true); } if ((this._parent.ErpInvoiceLineItem == item)) { this._parent.ErpInvoiceLineItem = null; return(true); } if ((this._parent.Status == item)) { this._parent.Status = null; return(true); } if ((this._parent.ErpReceiveDelivery == item)) { this._parent.ErpReceiveDelivery = null; return(true); } IMaterialItem materialItemItem = item.As <IMaterialItem>(); if (((materialItemItem != null) && this._parent.MaterialItems.Remove(materialItemItem))) { return(true); } IAsset assetItem = item.As <IAsset>(); if (((assetItem != null) && this._parent.Assets.Remove(assetItem))) { return(true); } return(false); }
private static void Propagate(IMaterialContainer parent, IMaterialItem item) { item?.SetParent(parent); }
private void Reset() { partText_Validated(null, null); SelectedItem = null; }