public static bool IssueOutMaterial(MaterialWarehouseItem item, Shopfloorline shopfloorline, int qty) { if (!new MaterialIssueOutValidator(item, shopfloorline, qty).Validated()) { return(false); } try { var repo = Scout.Core.Data.GetRepository(shopfloorline.Session); var warehouse = new MaterialsWarehouseInventory(repo); var consumable = new MaterialsConsumableInventory(repo); consumable.IncreaseItemQty(item.Part, shopfloorline, qty); warehouse.DecreaseItemQuantity(item.Part, item.Domain, item.RackLocation, qty); // Write the transaction WriteIssueOutTransaction(item, qty, shopfloorline); //Commit return(repo.Save()); } catch (Exception ex) { Scout.Core.UserInteraction.Dialog.ShowMessage(ex.Message, UserMessageType.Error); return(false); } }
private void LoadDomains(Shopfloorline shopfloorline) { receiveDomainLookupEdit.Properties.DataSource = shopfloorline.LocatorControlledDomains; receiveDomainLookupEdit.Properties.DisplayMember = "Label"; receiveDomainLookupEdit.Properties.ValueMember = "This"; receiveDomainLookupEdit.Reset(); }
public static bool AdjustMaterialConsumableItem(Part part, Shopfloorline sfl, int qty, string comments, AdjustmentTransactionType sourceType, MessageListener messages) { var repo = Scout.Core.Data.GetRepository(part.Session); var consumable = new MaterialsConsumableInventory(repo); MaterialConsumableItem item; try { if (sourceType.Direction == "IN") { item = consumable.IncreaseItemQty(part, sfl, qty); } else { item = consumable.DecreaseItemQty(part, sfl, qty); } WriteQtyAdjustmentTransaction(item, qty, comments, sourceType); return(repo.Save()); } catch (Exception ex) { Scout.Core.UserInteraction.Dialog.ShowMessage(ex.Message, UserMessageType.Error); return(false); } }
private void shopfloorlineLookup_EditValueChanged(object sender, EventArgs e) { m_shopfloorline = shopfloorlineLookup.EditValue as Shopfloorline; if (m_shopfloorline != null) { LoadCustomFields(m_shopfloorline); } }
private void LoadPersistedOrder() { Shopfloorline sfl = m_materialPurchaseOrder.ReceiveDomain.Parent; shopfloorlineLookupEdit.EditValue = sfl; LoadDomains(sfl); receiveDomainLookupEdit.EditValue = m_materialPurchaseOrder.ReceiveDomain; }
private void Session_ShopfloorlineChanged(Shopfloorline obj) { Session_ConfigurationChanged(null); if (obj != null) { shippingConfigurationLookUp.Properties.DataSource = Session.ShippingConfigurations; } }
public MaterialConsumableItem IncreaseItemQty(Part part, Shopfloorline sfl, int qty) { var item = m_repository.GetAndCreateIfNotFound(DefaultSearchExpression(part, sfl), DefaultCreateMapping(part, sfl, 0)); item.IncreaseQty(qty); return(item); }
private void sflSelList_SelectedValueChanged(object sender, EventArgs e) { m_shopfloorline = sflSelList.SelectedItem as Shopfloorline; transferTypeSelList.EditValue = null; sourceSelList.EditValue = null; destinationSelList.EditValue = null; sourceSelList.Properties.Items.Clear(); destinationSelList.Properties.Items.Clear(); }
public void GenerateStations(Shopfloorline shopfloorline) { //Create a new route if the user is switching shopfloorlines //if(m_route.Stations.Count > 0) // m_route= new ServiceRoute(shopfloorline.Session); // Add the stations to the route via a mapper m_route.AddStations(ServiceStationsForShopfloorline(shopfloorline)); }
private void shopfloorlineLookupEdit_EditValueChanged(object sender, EventArgs e) { Shopfloorline shopfloorline = shopfloorlineLookupEdit.EditValue as Shopfloorline; if (shopfloorline != null) { LoadDomains(shopfloorline); } }
private void sflLookup_EditValueChanged(object sender, EventArgs e) { Shopfloorline sfl = sflLookup.EditValue as Shopfloorline; if (sfl != null) { stationGrid.DataSource = sfl.ActiveServiceStations; } }
void sflLookUp_EditValueChanged(object sender, EventArgs e) { Shopfloorline sfl = sflLookUp.EditValue as Shopfloorline; CurrentShopfloorline = sfl; if (sfl != null) { LoadConfigurations(sfl); } }
private void sflSelList_EditValueChanged(object sender, EventArgs e) { Shopfloorline shopfloorline = sflSelList.EditValue as Shopfloorline; if (shopfloorline != null) { // ask the controller to generate the stations m_controller.GenerateStations(shopfloorline); // display the stations in the grid stationsGrid.DataSource = m_route.Stations; } }
public ICollection <ServiceStation> ServiceStationsForShopfloorline(Shopfloorline shopfloorline) { GroupOperator criteria = new GroupOperator( new CriteriaOperator[] { new BinaryOperator("Shopfloorline", shopfloorline), new BinaryOperator("Active", true) }); return(Scout.Core.Data .GetList <ServiceStation>(m_route.Session) .ByCriteria(criteria)); }
private void shopfloorlineSelList_SelectedValueChanged(object sender, EventArgs e) { m_shopfloorline = shopfloorlineSelList.SelectedItem as Shopfloorline; if (m_shopfloorline != null && CanLoadShopfloorline()) { m_po.Shopfloorline = m_shopfloorline; LoadDefaults(m_shopfloorline); LoadDomains(m_shopfloorline); LoadRoutes(m_shopfloorline); LoadPrograms(m_shopfloorline); } }
private void Search() { Shopfloorline sfl = shopfloorlineSelList.EditValue as Shopfloorline; if (sfl != null) { dfileItemsGrid.DataSource = m_dfile.Repository.GetOpenDfileItemsByShopfloorline(m_unitOfWork, sfl); } else { dfileItemsGrid.DataSource = null; } }
private void LoadRoutes(Shopfloorline shopfloorline) { if (shopfloorline == null) { return; } routeSelList.DataSource = shopfloorline.GetServiceRoutesByReturnType(m_po.ReturnType); routeSelList.DisplayMember = "Name"; routeSelList.ValueMember = "This"; headerRouteSelList.Properties.DataSource = shopfloorline.GetServiceRoutesByReturnType(m_po.ReturnType); headerRouteSelList.Properties.DisplayMember = "Name"; headerRouteSelList.Properties.ValueMember = "This"; }
public MaterialConsumableItem DecreaseItemQty(Part part, Shopfloorline sfl, int qty) { MaterialConsumableItem item = null; Expression <Func <MaterialConsumableItem, bool> > criteria = mci => mci.Part.Id == part.Id && mci.Shopfloorline.Id == sfl.Id && mci.Qty > 0; ExecutionHelpers.ThrowIfNull( () => item = m_repository.Get(criteria), "Consumable item not found" ); item.DecreaseQty(qty); return(item); }
void shopfloorlineLookup_EditValueChanged(object sender, EventArgs e) { Shopfloorline sfl = shopfloorlineLookup.EditValue as Shopfloorline; if (sfl != null) { requiredRouteLookUp.Properties.DataSource = sfl.ActiveServiceRoutes; requiredProgramLookUp.Properties.DataSource = sfl.ProgramList; multiShipToDomainLookUp.DataSource = sfl.ShippableDomains; } else { requiredRouteLookUp.Properties.DataSource = null; } }
private void LoadDomains(Shopfloorline sfl) { // guard if (sfl == null) { return; } // Load only the domains that are defined as pre-process domains recDomainSelList.SelectedIndex = -1; recDomainSelList.Properties.Items.Clear(); recDomainSelList.Properties.Items.AddRange(sfl.PreProcessDomains); itemRecDomainLookup.DataSource = sfl.PreProcessDomains; }
public Shopfloorline ChangeShopfloorline(Shopfloorline sfl) { CurrentShopfloorline = sfl; ShippingConfigurations = Scout.Core.Module <IOrderModule>() .Data.GetShippingConfigurations(m_uow, sfl); if (ShopfloorlineChanged != null) { ShopfloorlineChanged(CurrentShopfloorline); } return(CurrentShopfloorline); }
private void LoadCustomFields(Shopfloorline shopfloorline) { m_loading = true; foreach (CheckedListBoxItem item in customFieldsList.Items) { item.CheckState = CheckState.Unchecked; foreach (CustomField field in shopfloorline.CustomFields) { if (item.Value.ToString().Equals(field.FieldName)) { item.CheckState = CheckState.Checked; } } } m_loading = false; }
private void putAwayButton_Click(object sender, EventArgs e) { if (!dxValidationProvider1.Validate()) { return; } Shopfloorline shopfloorline = shopfloorlineSelList.EditValue as Shopfloorline; if (shopfloorline != null) { int qty = Int32.Parse(qtyText.Text); if (MaterialService.IssueOutMaterial(SelectedItem, shopfloorline, qty)) { Scout.Core.UserInteraction.Dialog.ShowMessage("Material Issued Out", UserMessageType.Information); Reset(); } } }
public static ICollection <BomConfiguration> GetStationBomConfigurations(IUnitOfWork uow, Shopfloorline shopfloorline) { return(MaterialRepository.GetStationBomConfigurations(uow, shopfloorline)); }
public static Action <MaterialConsumableItem> DefaultCreateMapping(Part part, Shopfloorline sfl, int qty) { return((i) => { i.Part = part; i.Qty = qty; i.Shopfloorline = sfl; }); }
public ICollection <ShippingConfiguration> GetShippingConfigurations(IUnitOfWork uow, Shopfloorline sfl) { return(Scout.Core.Data.GetRepository(uow) .Find <ShippingConfiguration>() .Where(c => c.Shopfloorline.Id == sfl.Id && c.Active) .ToList()); }
private static void WriteIssueOutTransaction(MaterialWarehouseItem item, int qty, Shopfloorline shopfloorline) { Part part = item.Part; Transaction trans = TransactionFactory.CreateTransaction(part.Session, "MATLISSUEOUT"); trans.TransType = "MATLISSUEOUT"; trans.DepartLocation = item.Domain.FullLocation + "-" + item.RackLocation; trans.ArrivalLocation = shopfloorline.FullLocation; trans.Part = part; trans.Qty = qty; trans.TransRef = "Material Issue Out"; trans.TransBy = Security.UserSecurity.CurrentUser.Login; trans.TransDate = DateTime.Now; trans.Item = InventoryRepository.GetItemRecordById(trans.Session, "LRAWMATERIALS000"); }
public static Expression <Func <MaterialConsumableItem, bool> > DefaultSearchExpression(Part part, Shopfloorline sfl) { return((i) => i.Part.Id == part.Id && i.Shopfloorline.Id == sfl.Id); }
private void LoadPrograms(Shopfloorline shopfloorline) { programLookup.Properties.DataSource = shopfloorline.ProgramList; }
private void LoadDefaults(Shopfloorline shopfloorline) { m_po.RoutingRequired = shopfloorline.RoutingRequired; }