Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("StockId,Active,DistAmountKg,Item,Buffer,Zarib")] TlkpFstock tlkpFstock)
        {
            if (id != tlkpFstock.StockId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tlkpFstock);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TlkpFstockExists(tlkpFstock.StockId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(tlkpFstock));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("StockId,Active,DistAmountKg,Item,Buffer,Zarib")] TlkpFstock tlkpFstock)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tlkpFstock);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(tlkpFstock));
        }