Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("id,BaseUrl,PostUrl,UserName,Password,ApiKey")] Tbl_ApiSetting tbl_ApiSetting)
        {
            if (id != tbl_ApiSetting.id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tbl_ApiSetting);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Tbl_ApiSettingExists(tbl_ApiSetting.id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tbl_ApiSetting));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("id,BaseUrl,PostUrl,UserName,Password,ApiKey")] Tbl_ApiSetting tbl_ApiSetting)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tbl_ApiSetting);
                await _context.SaveChangesAsync();

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