public void Create(DalRole entity) { var role = new Role() { Id = entity.Id, RoleOfUser = entity.RoleOfUser }; context.Set<Role>().Add(role); }
public FrmRoleEditor(Entities.Role role = null) { InitializeComponent(); CreateControls(); this.role = new Role(); if (role != null) { this.role.Copy(role); this.editRole = role; } SetupControls(); BindControls(); }
public override void CreateRole(string roleName) { if (!string.IsNullOrEmpty(roleName)) { using (DataContext Context = new DataContext()) { Role Role = null; Role = Context.Roles.FirstOrDefault(Rl => Rl.RoleName == roleName); if (Role == null) { Role NewRole = new Role { RoleId = Guid.NewGuid(), RoleName = roleName }; Context.Roles.Add(NewRole); Context.SaveChanges(); } } } }
public int Update_Roles(Role r) { RolesBAL rolesBal = new RolesBAL(); return rolesBal.Update_RolesBAL(r); }
public static void CheckIfNotNull(Role value, string role) { CheckIfNotNull(value, role, "Cannot find '{0}' role"); }
public bool Delete(Entities.Role role) { return(true); }
public bool Update(Entities.Role role) { return(true); }
public bool Insert(Entities.Role role) { return(true); }
public bool RemoveTaskFromRole(Entities.Role role, Entities.Task task) { return(true); }
public bool AddTaskToRole(Entities.Role role, Entities.Task task) { return(true); }
public override void CreateRole(string roleName) { if (string.IsNullOrEmpty(roleName)) throw ErrorUtility.CreateArgumentNullOrEmptyException("roleName"); if (RoleExists(roleName)) throw new InvalidOperationException( string.Format(CultureInfo.InvariantCulture, "Role '{0}' already exists", roleName)); var role = new Role { RoleName = roleName }; _roles.Create(role); _uow.Commit(); }