//skatīšanās public ActionResult View(long personId) { var db = new PersonListEntities(); var person = db.Persons.Find(personId); var model = new PersonModel2(person); return(View(model)); }
private void WireUpList(List <KeyValuePair <PersonModel, int> > _people) { List <PersonModel2> list = new List <PersonModel2>(); foreach (KeyValuePair <PersonModel, int> pair in _people) { PersonModel2 per = new PersonModel2(); per.FirstName = pair.Key.FirstName; per.LastName = pair.Key.LastName; per.Degree = pair.Key.Degree; per.Id = pair.Key.Id; per.Identifier = pair.Key.Identifier; per.LessonsCnt = pair.Value; list.Add(per); } peopleDataGridView.AutoGenerateColumns = false; peopleDataGridView.DataSource = list; peopleDataGridView.Refresh(); }
public ActionResult Index(PersonModel2 model) { return(View(model)); }