예제 #1
0
        public void Update(ProfileManagementModel item)
        {
            ProfileEF profile = new ProfileEF(item.Id, item.Name, null);

            _db.Entry(profile).State = EntityState.Modified;
            _db.SaveChanges();
        }
예제 #2
0
        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;
 }
예제 #4
0
        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"));
            }
        }
예제 #5
0
        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);
 }