Ejemplo n.º 1
0
        public virtual void UpdateCustomActions(Dictionary <int, bool> actions, PartyId userId, List <ActionType> roleActionTypes)
        {
            var newList = new List <PartyCustomAction>();

            actions.ToList().ForEach(c =>
            {
                newList.Add(new PartyCustomAction(userId, c.Key, c.Value));
            });

            this.customActions = new Dictionary <int, bool>();
            newList.ForEach(d =>
            {
                if (d.IsGranted)
                {
                    if (!roleActionTypes.Exists(c => (int)c == d.ActionTypeId))
                    {
                        this.customActions.Add(d.ActionTypeId, d.IsGranted);
                    }
                }
                else
                {
                    if (roleActionTypes.Exists(c => (int)c == d.ActionTypeId))
                    {
                        this.customActions.Add(d.ActionTypeId, d.IsGranted);
                    }
                }
            });
        }
Ejemplo n.º 2
0
 public Party(PartyId id)
 {
     if (id == null)
     {
         throw new ArgumentNullException("id");
     }
     this.id = id;
 }
Ejemplo n.º 3
0
 public SuperAdminUser(PartyId userId, string fName, string lName, string email)
     : base(userId, fName, lName, email)
 {
     Actions = new List <ActionType>();
     foreach (ActionType action in Enum.GetValues(typeof(ActionType)))
     {
         Actions.Add(action);
     }
 }
Ejemplo n.º 4
0
 public AdminUser(PartyId userId, string fName, string lName, string email)
     : base(userId, fName, lName, email)
 {
 }
Ejemplo n.º 5
0
 public PartyCustomAction(PartyId partyId, int actionTypeId, bool isGranted)
 {
     this.PartyId      = partyId;
     this.ActionTypeId = actionTypeId;
     this.IsGranted    = isGranted;
 }
Ejemplo n.º 6
0
 public EmployeeUser(PartyId userId, string employeeNo, string fname, string lname, string email)
     : base(userId, fname, lname, email)
 {
     this.employeeNo = employeeNo;
 }
Ejemplo n.º 7
0
 public bool SameValueAs(PartyId other)
 {
     return(PartyName.ToLower().Equals(other.partyName.ToLower()));
 }
Ejemplo n.º 8
0
 public User(PartyId id, string firstname, string lastname, string email, bool isActive)
     : base(id)
 {
     setProperties(firstname, lastname, email, isActive);
 }
Ejemplo n.º 9
0
 public User(PartyId id, string firstname, string lastname, string email)
     : base(id)
 {
     setProperties(firstname, lastname, email, true);
 }
Ejemplo n.º 10
0
 public Group(PartyId id, string description) : base(id)
 {
     this.description = description;
 }