コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("iftp,userftp,passftp,ipserver,cusualt,faltrto,cusumod,fmod,hmod")] ClientsFtp clientsFtp)
        {
            if (id != clientsFtp.iftp)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(clientsFtp);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClientsFtpExists(clientsFtp.iftp))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(clientsFtp));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("iftp,userftp,passftp,ipserver,cusualt,faltrto,cusumod,fmod,hmod")] ClientsFtp clientsFtp)
        {
            if (ModelState.IsValid)
            {
                _context.Add(clientsFtp);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Edit", new RouteValueDictionary(new { controller = "ClientsLBS", action = "Edit", Id = clientsFtp.iftp, Table = "Cliftp" })));
            }
            return(View(clientsFtp));
        }