private static string AppendUserData(User user, CustomResource template) { var str = template.Value.Replace("#NAME#", user.UserName); str = str.Replace("#DATA#", DateTime.Now.ToShortDateString()); // TODO : �������� �������� ���� ... return str; }
public void EditUser(User user) { var _user = _repository.EditUser(user); if (!String.IsNullOrEmpty(user.Role) && !Roles.IsUserInRole(_user.UserName, user.Role)) { Roles.RemoveUserFromRoles(_user.UserName, Roles.GetRolesForUser(_user.UserName)); Roles.AddUserToRole(_user.UserName, user.Role); } }
public User CreateUser(User user) { try { return _repository.CreateUser(user); } catch (Exception ex) { _validationDictionary.AddError("_FORM", "User is not saved. " + ex.Message); return null; } }