コード例 #1
0
ファイル: MaterialService.cs プロジェクト: ewin66/SCOUT_NS
        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);
            }
        }
コード例 #2
0
 private void LoadDomains(Shopfloorline shopfloorline)
 {
     receiveDomainLookupEdit.Properties.DataSource    = shopfloorline.LocatorControlledDomains;
     receiveDomainLookupEdit.Properties.DisplayMember = "Label";
     receiveDomainLookupEdit.Properties.ValueMember   = "This";
     receiveDomainLookupEdit.Reset();
 }
コード例 #3
0
ファイル: MaterialService.cs プロジェクト: ewin66/SCOUT_NS
        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);
            }
        }
コード例 #4
0
 private void shopfloorlineLookup_EditValueChanged(object sender, EventArgs e)
 {
     m_shopfloorline = shopfloorlineLookup.EditValue as Shopfloorline;
     if (m_shopfloorline != null)
     {
         LoadCustomFields(m_shopfloorline);
     }
 }
コード例 #5
0
        private void LoadPersistedOrder()
        {
            Shopfloorline sfl = m_materialPurchaseOrder.ReceiveDomain.Parent;

            shopfloorlineLookupEdit.EditValue = sfl;
            LoadDomains(sfl);
            receiveDomainLookupEdit.EditValue = m_materialPurchaseOrder.ReceiveDomain;
        }
コード例 #6
0
 private void Session_ShopfloorlineChanged(Shopfloorline obj)
 {
     Session_ConfigurationChanged(null);
     if (obj != null)
     {
         shippingConfigurationLookUp.Properties.DataSource = Session.ShippingConfigurations;
     }
 }
コード例 #7
0
        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);
        }
コード例 #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();
 }
コード例 #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));
        }
コード例 #10
0
        private void shopfloorlineLookupEdit_EditValueChanged(object sender, EventArgs e)
        {
            Shopfloorline shopfloorline = shopfloorlineLookupEdit.EditValue as Shopfloorline;

            if (shopfloorline != null)
            {
                LoadDomains(shopfloorline);
            }
        }
コード例 #11
0
ファイル: stationSelectForm.cs プロジェクト: ewin66/SCOUT_NS
        private void sflLookup_EditValueChanged(object sender, EventArgs e)
        {
            Shopfloorline sfl = sflLookup.EditValue as Shopfloorline;

            if (sfl != null)
            {
                stationGrid.DataSource = sfl.ActiveServiceStations;
            }
        }
コード例 #12
0
        void sflLookUp_EditValueChanged(object sender, EventArgs e)
        {
            Shopfloorline sfl = sflLookUp.EditValue as Shopfloorline;

            CurrentShopfloorline = sfl;

            if (sfl != null)
            {
                LoadConfigurations(sfl);
            }
        }
コード例 #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;
            }
        }
コード例 #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));
        }
コード例 #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);
            }
        }
コード例 #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;
            }
        }
コード例 #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";
        }
コード例 #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);
        }
コード例 #19
0
ファイル: salesOrderControl.cs プロジェクト: ewin66/SCOUT_NS
        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;
            }
        }
コード例 #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;
        }
コード例 #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);
        }
コード例 #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;
        }
コード例 #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();
                }
            }
        }
コード例 #24
0
ファイル: MaterialService.cs プロジェクト: ewin66/SCOUT_NS
 public static ICollection <BomConfiguration> GetStationBomConfigurations(IUnitOfWork uow, Shopfloorline shopfloorline)
 {
     return(MaterialRepository.GetStationBomConfigurations(uow, shopfloorline));
 }
コード例 #25
0
 public static Action <MaterialConsumableItem> DefaultCreateMapping(Part part, Shopfloorline sfl, int qty)
 {
     return((i) => { i.Part = part;
                     i.Qty = qty;
                     i.Shopfloorline = sfl; });
 }
コード例 #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());
 }
コード例 #27
0
ファイル: MaterialService.cs プロジェクト: ewin66/SCOUT_NS
        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");
        }
コード例 #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);
 }
コード例 #29
0
 private void LoadPrograms(Shopfloorline shopfloorline)
 {
     programLookup.Properties.DataSource = shopfloorline.ProgramList;
 }
コード例 #30
0
 private void LoadDefaults(Shopfloorline shopfloorline)
 {
     m_po.RoutingRequired = shopfloorline.RoutingRequired;
 }