Ejemplo n.º 1
0
        public ActionResult Create(Country country)
        {
            if (ModelState.IsValid)
            {
                db.Countries.Add(country);
                db.SaveChanges();
                //return RedirectToAction("Index");

            }

            return View(country);
        }
Ejemplo n.º 2
0
        public ActionResult Edit(Country country)
        {
            if (ModelState.IsValid)
            {
                db.Entry(country).State = EntityState.Modified;
                db.SaveChanges();
                //return RedirectToAction("Index");
            }

            else if (Request.IsAjaxRequest())
            {
                return PartialView("_Edit", country);
            }

            return View(country);
        }