Пример #1
0
        public ActionResult Create([Bind("ixInventoryUnit,sInventoryUnit,ixFacility,ixCompany,ixMaterial,ixInventoryState,ixHandlingUnit,ixInventoryLocation,nBaseUnitQuantity,sSerialNumber,sBatchNumber,dtExpireAt,ixStatus")] InventoryUnitsPost inventoryunits)
        {
            //Custom Code Start | Added Code Block
            var ixInventoryUnitTransactionContext = _inventoryunittransactioncontextsService.Index().Where(x => x.sInventoryUnitTransactionContext == "Inventory Adjustment").Select(x => x.ixInventoryUnitTransactionContext).FirstOrDefault();

            //Custom Code End
            if (ModelState.IsValid)
            {
                inventoryunits.UserName = User.Identity.Name;
                //Custom Code Start | Replaced Code Block
                //Replaced Code Block Start
                //_inventoryunitsService.Create(inventoryunits);
                //Replaced Code Block End
                _inventoryunitsService.Create(inventoryunits, ixInventoryUnitTransactionContext);
                //Custom Code End
                return(RedirectToAction("Index"));
            }
            ViewBag.ixCompany           = new SelectList(_inventoryunitsService.selectCompanies().Select(x => new { x.ixCompany, x.sCompany }), "ixCompany", "sCompany");
            ViewBag.ixFacility          = new SelectList(_inventoryunitsService.selectFacilities().Select(x => new { x.ixFacility, x.sFacility }), "ixFacility", "sFacility");
            ViewBag.ixHandlingUnit      = new SelectList(_inventoryunitsService.selectHandlingUnits().Select(x => new { x.ixHandlingUnit, x.sHandlingUnit }), "ixHandlingUnit", "sHandlingUnit");
            ViewBag.ixInventoryLocation = new SelectList(_inventoryunitsService.selectInventoryLocations().Select(x => new { x.ixInventoryLocation, x.sInventoryLocation }), "ixInventoryLocation", "sInventoryLocation");
            ViewBag.ixInventoryState    = new SelectList(_inventoryunitsService.selectInventoryStates().Select(x => new { x.ixInventoryState, x.sInventoryState }), "ixInventoryState", "sInventoryState");
            ViewBag.ixMaterial          = new SelectList(_inventoryunitsService.selectMaterials().Select(x => new { x.ixMaterial, x.sMaterial }), "ixMaterial", "sMaterial");
            ViewBag.ixStatus            = new SelectList(_inventoryunitsService.selectStatuses().Select(x => new { x.ixStatus, x.sStatus }), "ixStatus", "sStatus");

            return(View(inventoryunits));
        }
Пример #2
0
        public ActionResult Index()
        {
            var inventoryunittransactioncontexts = _inventoryunittransactioncontextsService.Index();

            return(View(inventoryunittransactioncontexts.ToList()));
        }