public ActionResult DeleteConfirmed(long id)
        {
            InventoryLocationsSlottingPost inventorylocationsslotting = _inventorylocationsslottingService.GetPost(id);

            inventorylocationsslotting.UserName = User.Identity.Name;
            _inventorylocationsslottingService.Delete(inventorylocationsslotting);
            return(RedirectToAction("Index"));
        }
        public ActionResult CreateWithID([Bind("ixInventoryLocationSlotting,sInventoryLocationSlotting,ixInventoryLocation,ixMaterial,nMinimumBaseUnitQuantity,nMaximumBaseUnitQuantity")] InventoryLocationsSlottingPost inventorylocationsslotting)
        {
            if (ModelState.IsValid)
            {
                inventorylocationsslotting.UserName = User.Identity.Name;
                _inventorylocationsslottingService.Create(inventorylocationsslotting);
                return(RedirectToAction("Edit", "InventoryLocations", new { id = inventorylocationsslotting.ixInventoryLocation }));
            }
            ViewBag.ixInventoryLocation = new SelectList(_inventorylocationsslottingService.selectInventoryLocations().Where(x => x.ixInventoryLocation == inventorylocationsslotting.ixInventoryLocation).Select(x => new { x.ixInventoryLocation, x.sInventoryLocation }), "ixInventoryLocation", "sInventoryLocation");
            ViewBag.ixMaterial          = new SelectList(_inventorylocationsslottingService.selectMaterials().Select(x => new { x.ixMaterial, x.sMaterial }), "ixMaterial", "sMaterial");

            return(View(inventorylocationsslotting));
        }
        public ActionResult Edit([Bind("ixInventoryLocationSlotting,sInventoryLocationSlotting,ixInventoryLocation,ixMaterial,nMinimumBaseUnitQuantity,nMaximumBaseUnitQuantity")] InventoryLocationsSlottingPost inventorylocationsslotting)
        {
            if (ModelState.IsValid)
            {
                inventorylocationsslotting.UserName = User.Identity.Name;
                _inventorylocationsslottingService.Edit(inventorylocationsslotting);
                return(RedirectToAction("Index"));
            }
            //Custom Code Start | Replaced Code Block
            //Replaced Code Block Start
            //ViewBag.ixInventoryLocation = new SelectList(_inventorylocationsslottingService.selectInventoryLocations().Select( x => new { x.ixInventoryLocation, x.sInventoryLocation }), "ixInventoryLocation", "sInventoryLocation", inventorylocationsslotting.ixInventoryLocation);
            //ViewBag.ixMaterial = new SelectList(_inventorylocationsslottingService.selectMaterials().Select(x => new { x.ixMaterial, x.sMaterial }), "ixMaterial", "sMaterial", inventorylocationsslotting.ixMaterial);
            //Replaced Code Block End
            var currentLocation = _inventorylocationsslottingService.Index().Where(x => x.ixInventoryLocation == inventorylocationsslotting.ixInventoryLocation).Select(x => new { x.ixInventoryLocation, x.InventoryLocations.sInventoryLocation });
            var currentMaterial = _inventorylocationsslottingService.Index().Where(x => x.ixMaterial == inventorylocationsslotting.ixMaterial).Select(x => new { x.ixMaterial, x.Materials.sMaterial });

            ViewBag.ixInventoryLocation = new SelectList(_inventorylocationsslottingService.selectInventoryLocations().Select(x => new { x.ixInventoryLocation, x.sInventoryLocation }).Union(currentLocation), "ixInventoryLocation", "sInventoryLocation", inventorylocationsslotting.ixInventoryLocation);
            ViewBag.ixMaterial          = new SelectList(_inventorylocationsslottingService.selectMaterials().Select(x => new { x.ixMaterial, x.sMaterial }).Union(currentMaterial), "ixMaterial", "sMaterial", inventorylocationsslotting.ixMaterial);
            //Custom Code End
            return(View(inventorylocationsslotting));
        }
        public ActionResult Edit(long id)
        {
            InventoryLocationsSlottingPost inventorylocationsslotting = _inventorylocationsslottingService.GetPost(id);

            if (inventorylocationsslotting == null)
            {
                return(NotFound());
            }
            //Custom Code Start | Replaced Code Block
            //Replaced Code Block Start
            //ViewBag.ixInventoryLocation = new SelectList(_inventorylocationsslottingService.selectInventoryLocations().Select( x => new { x.ixInventoryLocation, x.sInventoryLocation }), "ixInventoryLocation", "sInventoryLocation", inventorylocationsslotting.ixInventoryLocation);
            //ViewBag.ixMaterial = new SelectList(_inventorylocationsslottingService.selectMaterials().Select(x => new { x.ixMaterial, x.sMaterial }), "ixMaterial", "sMaterial", inventorylocationsslotting.ixMaterial);
            //Replaced Code Block End
            var currentLocation = _inventorylocationsslottingService.Index().Where(x => x.ixInventoryLocation == inventorylocationsslotting.ixInventoryLocation).Select(x => new { x.ixInventoryLocation, x.InventoryLocations.sInventoryLocation });
            var currentMaterial = _inventorylocationsslottingService.Index().Where(x => x.ixMaterial == inventorylocationsslotting.ixMaterial).Select(x => new { x.ixMaterial, x.Materials.sMaterial });

            ViewBag.ixInventoryLocation = new SelectList(_inventorylocationsslottingService.selectInventoryLocations().Select(x => new { x.ixInventoryLocation, x.sInventoryLocation }).Union(currentLocation), "ixInventoryLocation", "sInventoryLocation", inventorylocationsslotting.ixInventoryLocation);
            ViewBag.ixMaterial          = new SelectList(_inventorylocationsslottingService.selectMaterials().Select(x => new { x.ixMaterial, x.sMaterial }).Union(currentMaterial), "ixMaterial", "sMaterial", inventorylocationsslotting.ixMaterial);
            //Custom Code End
            return(View(inventorylocationsslotting));
        }
示例#5
0
        public Task Delete(InventoryLocationsSlottingPost inventorylocationsslottingPost)
        {
            // Additional validations

            // Pre-process

            // Process
            this._inventorylocationsslottingRepository.RegisterDelete(inventorylocationsslottingPost);
            try
            {
                this._inventorylocationsslottingRepository.Commit();
            }
            catch (Exception ex)
            {
                this._inventorylocationsslottingRepository.Rollback();
                // Log exception
                throw;
            }

            // Post-process

            return(Task.CompletedTask);
        }
示例#6
0
        public Task <Int64> Create(InventoryLocationsSlottingPost inventorylocationsslottingPost)
        {
            // Additional validations

            // Pre-process

            // Process
            this._inventorylocationsslottingRepository.RegisterCreate(inventorylocationsslottingPost);
            try
            {
                this._inventorylocationsslottingRepository.Commit();
            }
            catch (Exception ex)
            {
                this._inventorylocationsslottingRepository.Rollback();
                // Log exception
                throw;
            }

            // Post-process

            return(Task.FromResult(inventorylocationsslottingPost.ixInventoryLocationSlotting));
        }
示例#7
0
 public void RegisterDelete(InventoryLocationsSlottingPost inventorylocationsslottingPost)
 {
     _context.InventoryLocationsSlottingPost.Remove(inventorylocationsslottingPost);
 }
示例#8
0
 public void RegisterEdit(InventoryLocationsSlottingPost inventorylocationsslottingPost)
 {
     _context.Entry(inventorylocationsslottingPost).State = EntityState.Modified;
 }
示例#9
0
 public void RegisterCreate(InventoryLocationsSlottingPost inventorylocationsslottingPost)
 {
     _context.InventoryLocationsSlottingPost.Add(inventorylocationsslottingPost);
 }