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)); }
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); }
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)); }
public void RegisterDelete(InventoryLocationsSlottingPost inventorylocationsslottingPost) { _context.InventoryLocationsSlottingPost.Remove(inventorylocationsslottingPost); }
public void RegisterEdit(InventoryLocationsSlottingPost inventorylocationsslottingPost) { _context.Entry(inventorylocationsslottingPost).State = EntityState.Modified; }
public void RegisterCreate(InventoryLocationsSlottingPost inventorylocationsslottingPost) { _context.InventoryLocationsSlottingPost.Add(inventorylocationsslottingPost); }