Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
 private void LoadDomains(Shopfloorline shopfloorline)
 {
     receiveDomainLookupEdit.Properties.DataSource    = shopfloorline.LocatorControlledDomains;
     receiveDomainLookupEdit.Properties.DisplayMember = "Label";
     receiveDomainLookupEdit.Properties.ValueMember   = "This";
     receiveDomainLookupEdit.Reset();
 }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
 private void shopfloorlineLookup_EditValueChanged(object sender, EventArgs e)
 {
     m_shopfloorline = shopfloorlineLookup.EditValue as Shopfloorline;
     if (m_shopfloorline != null)
     {
         LoadCustomFields(m_shopfloorline);
     }
 }
Exemplo n.º 5
0
        private void LoadPersistedOrder()
        {
            Shopfloorline sfl = m_materialPurchaseOrder.ReceiveDomain.Parent;

            shopfloorlineLookupEdit.EditValue = sfl;
            LoadDomains(sfl);
            receiveDomainLookupEdit.EditValue = m_materialPurchaseOrder.ReceiveDomain;
        }
Exemplo n.º 6
0
 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);
        }
Exemplo n.º 8
0
 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();
 }
Exemplo n.º 9
0
        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));
        }
Exemplo n.º 10
0
        private void shopfloorlineLookupEdit_EditValueChanged(object sender, EventArgs e)
        {
            Shopfloorline shopfloorline = shopfloorlineLookupEdit.EditValue as Shopfloorline;

            if (shopfloorline != null)
            {
                LoadDomains(shopfloorline);
            }
        }
Exemplo n.º 11
0
        private void sflLookup_EditValueChanged(object sender, EventArgs e)
        {
            Shopfloorline sfl = sflLookup.EditValue as Shopfloorline;

            if (sfl != null)
            {
                stationGrid.DataSource = sfl.ActiveServiceStations;
            }
        }
Exemplo n.º 12
0
        void sflLookUp_EditValueChanged(object sender, EventArgs e)
        {
            Shopfloorline sfl = sflLookUp.EditValue as Shopfloorline;

            CurrentShopfloorline = sfl;

            if (sfl != null)
            {
                LoadConfigurations(sfl);
            }
        }
Exemplo n.º 13
0
        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;
            }
        }
Exemplo n.º 14
0
        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));
        }
Exemplo n.º 15
0
        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);
            }
        }
Exemplo n.º 16
0
        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;
            }
        }
Exemplo n.º 17
0
        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";
        }
Exemplo n.º 18
0
        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);
        }
Exemplo n.º 19
0
        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;
            }
        }
Exemplo n.º 20
0
        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;
        }
Exemplo n.º 21
0
        public Shopfloorline ChangeShopfloorline(Shopfloorline sfl)
        {
            CurrentShopfloorline = sfl;

            ShippingConfigurations =
                Scout.Core.Module <IOrderModule>()
                .Data.GetShippingConfigurations(m_uow, sfl);

            if (ShopfloorlineChanged != null)
            {
                ShopfloorlineChanged(CurrentShopfloorline);
            }

            return(CurrentShopfloorline);
        }
Exemplo n.º 22
0
        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;
        }
Exemplo n.º 23
0
        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();
                }
            }
        }
Exemplo n.º 24
0
 public static ICollection <BomConfiguration> GetStationBomConfigurations(IUnitOfWork uow, Shopfloorline shopfloorline)
 {
     return(MaterialRepository.GetStationBomConfigurations(uow, shopfloorline));
 }
Exemplo n.º 25
0
 public static Action <MaterialConsumableItem> DefaultCreateMapping(Part part, Shopfloorline sfl, int qty)
 {
     return((i) => { i.Part = part;
                     i.Qty = qty;
                     i.Shopfloorline = sfl; });
 }
Exemplo n.º 26
0
 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());
 }
Exemplo n.º 27
0
        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");
        }
Exemplo n.º 28
0
 public static Expression <Func <MaterialConsumableItem, bool> > DefaultSearchExpression(Part part, Shopfloorline sfl)
 {
     return((i) => i.Part.Id == part.Id && i.Shopfloorline.Id == sfl.Id);
 }
Exemplo n.º 29
0
 private void LoadPrograms(Shopfloorline shopfloorline)
 {
     programLookup.Properties.DataSource = shopfloorline.ProgramList;
 }
Exemplo n.º 30
0
 private void LoadDefaults(Shopfloorline shopfloorline)
 {
     m_po.RoutingRequired = shopfloorline.RoutingRequired;
 }