コード例 #1
0
        public async Task <IActionResult> AgregarSofttekian(Softtekian obj)
        {
            try
            {
                //if (ModelState.IsValid)
                if (true)
                {
                    if (obj.Id == 0)
                    {
                        _Db.Softtekian.Add(obj);
                        await _Db.SaveChangesAsync();
                    }
                    else
                    {
                        _Db.Entry(obj).State = EntityState.Modified;
                        await _Db.SaveChangesAsync();
                    }

                    return(RedirectToAction("ListarSofttekians"));
                }

                //return View();
            }
            catch (Exception ex)
            {
                return(RedirectToAction("ListarSofttekians"));
            }
        }
コード例 #2
0
        public IActionResult CrearSofttekian(Softtekian obj)
        {
            loadDDL("Rol");
            loadDDL("Sexo");

            ViewBag.id_pais = HttpContext.Session.GetInt32("id_pais");
            ViewBag.usuario = HttpContext.Session.GetString("usuario");

            var id_pais = HttpContext.Session.GetInt32("id_pais");
            var usuario = HttpContext.Session.GetString("usuario");

            return(View(obj));
        }