Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("icli,ihos,iftp,ipredis,dnom,dnommail,est,dobs,tcli,cusualt,faltrto,cusumod,fmod,hmod")] ClientsLB clientsLB)
        {
            if (id != clientsLB.icli)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(clientsLB);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClientsLBExists(clientsLB.icli))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["iftp"]    = new SelectList(_context.ClientsFtp, "iftp", "iftp", clientsLB.iftp);
            ViewData["ihos"]    = new SelectList(_context.CliHosting, "ihos", "ihos", clientsLB.ihos);
            ViewData["ipredis"] = new SelectList(_context.ClientsPredis, "ipredis", "ipredis", clientsLB.ipredis);
            ViewData["icliacc"] = new SelectList(_context.ClientsAcces, "icliacc", "icliacc", clientsLB.icliacc);
            return(View(clientsLB));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("icli,ihos,iftp,ipredis,dnom,dnommail,est,dobs,tcli,cusualt,faltrto,cusumod,fmod,hmod")] ClientsLB clientsLB)
        {
            if (ModelState.IsValid)
            {
                _context.Add(clientsLB);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["iftp"]    = new SelectList(_context.ClientsFtp, "iftp", "iftp", clientsLB.iftp);
            ViewData["ihos"]    = new SelectList(_context.CliHosting, "ihos", "ihos", clientsLB.ihos);
            ViewData["ipredis"] = new SelectList(_context.ClientsPredis, "ipredis", "ipredis", clientsLB.ipredis);
            ViewData["icliacc"] = new SelectList(_context.ClientsAcces, "icliacc", "icliacc", clientsLB.icliacc);
            return(View(clientsLB));
        }