Beispiel #1
0
        public ActionResult Edit(FootballersEditVM model)
        {
            Footballer item = new Footballer();

            if (model.Id > 0)
            {
                item = footballersRepository.GetById(model.Id);
            }
            item.FirstName = model.FirstName;
            item.LastName  = model.LastName;
            item.Username  = model.Username;
            item.Password  = model.Password;
            item.Goals     = model.Goals;
            item.Assists   = model.Assists;
            item.TeamId    = model.TeamId;
            item.IsReferee = model.IsReferee;
            footballersRepository.Save(item);
            return(RedirectToAction("Index", "Footballers"));
        }