Exemple #1
0
        public async Task <IActionResult> Edit(string id, [Bind("FranchisorNo,FranchisorName,FranchisorAddress,FranchisorPostcode,FranchisorTel,FranchisorFax")] Franchisors franchisors)
        {
            if (id != franchisors.FranchisorNo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(franchisors);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FranchisorsExists(franchisors.FranchisorNo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(franchisors));
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("FranchisorNo,FranchisorName,FranchisorAddress,FranchisorPostcode,FranchisorTel,FranchisorFax")] Franchisors franchisors)
        {
            if (ModelState.IsValid)
            {
                _context.Add(franchisors);
                await _context.SaveChangesAsync();

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