Beispiel #1
0
        public ActionResult Modificar(ServiceReference1.CityModel model)
        {
            if (ModelState.IsValid)
            {
                ServiceReference1.city cc = new ServiceReference1.city();
                cc.city1   = model.city;
                cc.city_id = model.cityId;

                bool al = SC.ActualizarCity(cc);

                if (al == true)
                {
                    return(RedirectToAction("MostrarTodos"));
                }
            }
            return(View(model));
        }
Beispiel #2
0
        public ActionResult Crear(ServiceReference1.CityModel model)
        {
            if (ModelState.IsValid)
            {
                ServiceReference1.city cc = new ServiceReference1.city();

                cc.city1      = model.city;
                cc.country_id = short.Parse(model.countryId.ToString());

                bool al = SC.InsertarCity(cc);

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