Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("MeasurintUnitId,MeasuringUnits")] TblItemUnits tblItemUnits)
        {
            if (id != tblItemUnits.MeasurintUnitId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tblItemUnits);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TblItemUnitsExists(tblItemUnits.MeasurintUnitId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tblItemUnits));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("MeasurintUnitId,MeasuringUnits")] TblItemUnits tblItemUnits)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tblItemUnits);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tblItemUnits));
        }