Exemple #1
0
        public async Task <IActionResult> Edit(string id, [Bind("idMerchant,lstname,fstname,storename,phone,website,stt")] Model.Users.Merchant merchant)
        {
            if (id != merchant.idMerchant)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(merchant);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MerchantExists(merchant.idMerchant))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(merchant));
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("idMerchant,lstname,fstname,storename,phone,website,stt")] Model.Users.Merchant merchant)
        {
            if (ModelState.IsValid)
            {
                _context.Add(merchant);
                await _context.SaveChangesAsync();

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