public ActionResult Index() { List <SelectListItem> stateNames = new List <SelectListItem>(); MarketerModel marketMDL = new MarketerModel(); List <tbl_LK_State> states = _db.tbl_LK_State.ToList(); states.ForEach(x => { stateNames.Add(new SelectListItem { Text = x.StateName, Value = x.StateID.ToString() }); }); marketMDL.LK_StateName = stateNames; return(View(marketMDL)); }
// GET: Marketer/Details/5 public ActionResult Details(string code) { Marketer x = dao.rechercher(code); MarketerModel pm = new MarketerModel { CodeMARKETER = x.codeMARKETER, Nom = x.nom, Adresse = x.adresse, Email = x.email, Pays = x.pays, Telephone = x.telephone, Ville = x.ville }; if (x == null) { return(HttpNotFound()); } return(View(pm)); }