public RoleViewModel(Role role) : base(role) { name.SetValue(role.Name); description.SetValue(role.Description); order.SetValue(role.Order); }
public RoleModel(Role role):base(role) { if (role != null) { Name = role.Name; Description = role.Description; Application_Id = role.Application_Id; Order = role.Order; } }
public Role GetRole(int appid, int userId, string token, int id) { try { CheckToken(appid, userId, token); Role role = new Role { Id = id }; modelAccesser.Get(role); return role.Loaded ? role : null; } catch (Exception) { throw new DatabaseException(); } }
public Role AddRole(int appid, int userId, string token, Role role) { try { CheckToken(appid, userId, token); CheckCommand(appid, role.Application_Id, userId, BuiltIns.DefineRoleCommand.Id, BuiltIns.AllRole.Id); modelAccesser.Add(role); return role; } catch (Exception) { throw new DatabaseException(); } }
public void DeleteRole(int appid, int userId, string token, int id) { try { CheckToken(appid, userId, token); Role r = new Role { Id = id }; modelAccesser.Get<Role>(r); if (r.Loaded) { CheckCommand(appid, r.Application_Id, userId, BuiltIns.DefineRoleCommand.Id, BuiltIns.AllRole.Id); modelAccesser.Delete(r); } } catch (Exception) { throw new DatabaseException(); } }
public bool IsRoleInRoom(RoomViewModel room, Role role) { return RoomRoleVMs != null && RoomRoleVMs.FirstOrDefault(rr => rr.RoomId == room.Id && rr.RoleId == role.Id) != null; }
public YoYoStudio.Model.Core.Role AddRole(int userId, string token, YoYoStudio.Model.Core.Role role) { return(client.AddRole(application_Id, userId, token, role)); }
public void UpdateRole(int userId, string token, YoYoStudio.Model.Core.Role role) { client.UpdateRole(application_Id, userId, token, role); }