示例#1
0
        public ActionResult CreateState(StateViewModel s)
        {
            if (ModelState.IsValid)
            {
                State state = new State()
                {
                    StateName = s.StateName,
                    CountryId = s.CountryID
                };


                serviceState.Add(state);
                serviceState.Commit();
                return(RedirectToAction("States"));
            }
            s.Countries = serviceCountry.GetMany().ToSelectListItems();
            return(View(s));
        }