예제 #1
0
        private void putAwayButton_Click(object sender, EventArgs e)
        {
            if (!dxValidationProvider1.Validate())
            {
                return;
            }

            if (SelectedItem == null)
            {
                return;
            }

            RackLocation location = rackSelList.EditValue as RackLocation;

            if (location != null)
            {
                int    qty      = Int32.Parse(qtyText.Text);
                Domain domain   = domainSelList.EditValue as Domain;
                string comments = commentsText.Text;
                if (MaterialService.TransferMaterialToLocation(SelectedItem, domain, location.Label, qty, comments))
                {
                    Scout.Core.UserInteraction.Dialog.ShowMessage("Material Transferred.", UserMessageType.Information);
                    Reset();
                }
            }
        }
예제 #2
0
        private void transferButton_Click(object sender, EventArgs e)
        {
            RackLocation rackLocation = locationLookup.EditValue as RackLocation;

            if (rackLocation == null)
            {
                return;
            }

            try
            {
                bool removeFromTote = removeitemsFromToteCheck.Checked;

                Scout.Core.Service <IToteService>().PutSelectedItemsInLocation
                    (m_args.ItemsToMove, rackLocation, removeFromTote);

                Scout.Core.Data.Save(m_session);

                string msg = "Put away complete";

                if (removeFromTote)
                {
                    msg += " and the items have been removed from the tote";
                }

                Scout.Core.UserInteraction.Dialog.ShowMessage(msg, UserMessageType.Information);

                Close();
            }
            catch (Exception ex)
            {
                Scout.Core.UserInteraction.Dialog.ShowMessage(ex.Message, UserMessageType.Error);
            }
        }
예제 #3
0
        public IActionResult Edit(long id, [Bind("RackLocationID,LocationID,RackID,RackNo")] RackLocation rackLocation)
        {
            if (id != rackLocation.RackLocationID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    service.Update(rackLocation);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RackLocationExists(rackLocation.RackLocationID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LocationID"] = new List <SelectListItem>(service.GetSelectListLocation());
            ViewData["RackID"]     = new List <SelectListItem>(service.GetSelectListRack());
            return(View(rackLocation));
        }
예제 #4
0
        private void rackLocation_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            var itemTapped = e.Item as RackLocation;
            var data       = _rackLocations.ElementAt(itemTapped.Id - 1);

            //new item selected is not null or is same as previously selected is before
            if (_selectedLocation == null || itemTapped == _selectedLocation)
            {   //collapse the selected item if it is expanded
                if (data.IsVisible == true)
                {
                    data.IsVisible = false;
                }
                //if it is not expanded...expand it
                else if (data.IsVisible == false)
                {
                    data.IsVisible = true;
                }
            }
            //selected item is not same
            else if (_selectedLocation != itemTapped)
            {
                _selectedLocation.IsVisible = false;
                itemTapped.IsVisible        = true;
            }
            _selectedLocation         = itemTapped;
            rackLocation.SelectedItem = null;
        }
예제 #5
0
        public IActionResult AddBottle(AddBottleViewModel addTo)
        {
            Wine         wine     = context.Wines.SingleOrDefault(w => w.ID == addTo.WineID);
            RackLocation location = new RackLocation
            {
                RackID = addTo.RackID,
                WineID = addTo.WineID
            };

            if (wine != null)
            {
                wine.Count += 1;
                context.RackLocations.Add(location);

                if (!wine.InStock)
                {
                    wine.InStock = true;
                }

                context.SaveChanges();

                return(Redirect("/Wine"));
            }

            return(View());
        }
예제 #6
0
        public Tuple <long, RackLocation, List <Asset> > GetAllRackLocationsWithAssets(long rackLocationID)
        {
            RackLocation rackLocation = FindById(rackLocationID);

            List <Asset> assets = assetRepository.GetAllAssetsOfRackLocation(rackLocationID);

            return(new Tuple <long, RackLocation, List <Asset> >(rackLocationID, rackLocation, assets));
        }
예제 #7
0
 public IActionResult Create([Bind("RackLocationID,LocationID,RackID,RackNo")] RackLocation rackLocation)
 {
     if (ModelState.IsValid)
     {
         service.Add(rackLocation);
         return(RedirectToAction(nameof(Index)));
     }
     ViewData["LocationID"] = new List <SelectListItem>(service.GetSelectListLocation());
     ViewData["RackID"]     = new List <SelectListItem>(service.GetSelectListRack());
     return(View(rackLocation));
 }
예제 #8
0
        // GET: RackLocation/Details
        public IActionResult Details(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            RackLocation rackLocation = service.FindById(id.Value);

            if (rackLocation == null)
            {
                return(NotFound());
            }

            return(View(rackLocation));
        }
예제 #9
0
        public IActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            RackLocation rackLocation = service.FindById(id.Value);

            if (rackLocation == null)
            {
                return(NotFound());
            }
            ViewData["LocationID"] = new List <SelectListItem>(service.GetSelectListLocation());
            ViewData["RackID"]     = new List <SelectListItem>(service.GetSelectListRack());
            return(View(rackLocation));
        }
예제 #10
0
        public static bool PutAwayMaterial(MaterialWarehouseItem item, RackLocation location, int qty, string comments)
        {
            if (!new PutAwayMaterialValidator(item, location, qty).Validated())
            {
                return(false);
            }

            var repo      = location.Session.AsRepository();
            var warehouse = new MaterialsWarehouseInventory(repo);

            warehouse.IncreaseItemQuantity(item.Part, item.Domain, location.Label, qty);
            warehouse.DecreaseItemQuantity(item.Part, item.Domain, null, qty);

            // Write Transaction
            WriteMaterialPutAwayTransaction(item.Part, qty, item.Domain, location.Label, comments);

            repo.Save();

            return(true);
        }
예제 #11
0
        private void putAwayButton_Click(object sender, EventArgs e)
        {
            if (!dxValidationProvider1.Validate())
            {
                return;
            }


            RackLocation location = rackSelList.EditValue as RackLocation;

            if (location != null)
            {
                int    qty      = Int32.Parse(qtyText.Text);
                string comments = "";
                if (MaterialService.PutAwayMaterial(SelectedItem, location, qty, comments))
                {
                    Scout.Core.UserInteraction.Dialog.ShowMessage("Material Put Away", UserMessageType.Information);
                    Reset();
                }
            }
        }
예제 #12
0
        public void PutSelectedItemsInLocation(List <InventoryItem> items, RackLocation location, bool removeFromTote)
        {
            foreach (InventoryItem item in items)
            {
                // Create putaway transaction
                string currentLocation = item.Domain.FullLocation;
                Scout.Core.Service <ITransactionService>().CreateTransaction(
                    "PUTAWAY",
                    item,
                    currentLocation,
                    location.FullLocation, "", "");

                // Update the inventory item's rack location
                item.LocatorLabel = location.FullLocation;

                if (removeFromTote)
                {
                    Scout.Core.Service <IInventoryService>().RemoveItemFromTote(item);
                }
            }
        }
 public void Update(RackLocation rackLocation)
 {
     context.RackLocations.Update(rackLocation);
     context.SaveChanges();
 }
예제 #14
0
 public PutAwayMaterialValidator(MaterialWarehouseItem item, RackLocation location, int qty)
 {
     m_item     = item;
     m_location = location;
     m_qty      = qty;
 }
 public void Add(RackLocation rackLocation)
 {
     context.RackLocations.Add(rackLocation);
     context.SaveChanges();
 }
예제 #16
0
 public void Add(RackLocation rackLocation)
 {
     repository.Add(rackLocation);
 }
예제 #17
0
 public void Update(RackLocation rackLocation)
 {
     repository.Update(rackLocation);
 }