Exemple #1
0
        public ActionResult Crear(ServiceReference1.CountryModel model)
        {
            if (ModelState.IsValid)
            {
                ServiceReference1.country cc = new ServiceReference1.country();

                cc.country1 = model.country;

                bool al = SC.InsertarCountry(cc);

                if (al == true)
                {
                    return(RedirectToAction("Crear"));
                }
            }
            return(View(model));
        }
Exemple #2
0
        public ActionResult Modificar(ServiceReference1.CountryModel model)
        {
            if (ModelState.IsValid)
            {
                ServiceReference1.country cc = new ServiceReference1.country();

                cc.country1   = model.country;
                cc.country_id = short.Parse(model.country_id.ToString());

                bool al = SC.ActualizarCountry(cc);

                if (al == true)
                {
                    return(RedirectToAction("MostrarTodos"));
                }
            }
            return(View(model));
        }