public void Update(ProfileManagementModel item) { ProfileEF profile = new ProfileEF(item.Id, item.Name, null); _db.Entry(profile).State = EntityState.Modified; _db.SaveChanges(); }
public void Create(ProfileManagementModel item) { ProfileEF profile = new ProfileEF(item.Id, item.Name, null); _db.Profiles.Add(profile); _db.SaveChanges(); }
public AccountManagementModel( int id, string name, int profileId, ProfileManagementModel profile) { Id = id; Name = name; ProfileId = profileId; Profile = profile; }
public IActionResult EditProfile(ProfileManagementModel profile) { try { // TODO: Add update logic here if (ModelState.IsValid) { _profileManagementService.UpdateProfile(profile); } return(RedirectToAction(nameof(Index))); } catch { return(RedirectToAction("EditProfile")); } }
private TableEditorModel GetTableModel(IEnumerable <ProfileManagementModel> profiles, ProfileManagementModel profile) { var entityType = typeof(ProfileManagementModel); var tableModel = new TableEditorModel("Profiles", entityType, "Id", profiles, profile); _tableEditorService.AddColumn(tableModel, "Id", null); _tableEditorService.AddColumn(tableModel, "Name", null, ControlType.Input, null); return(tableModel); }
public void UpdateProfile(ProfileManagementModel profile) { _profileRepository.Update(profile); }