public bool AddPeer(Peer peer)
        {
            var appraisalProcesses = _dbEntities.AppraisalSeasons.First(p => p.IsActive == true);

//            peer.AppraisalSeasonId = appraisalProcesses.AppraisalSeasonId;
//            peer.FeedbackStatus = false;
            _dbEntities.Peers.Add(peer);
            _dbEntities.SaveChanges();
            return(true);
        }
Beispiel #2
0
        public bool MakeUserPC(Guid userId)
        {
            int pcRoleId = _roles.First(x => x.RoleName == ROLE_NAME_PC).RoleId;

            UserRole newPC = new UserRole
            {
                UserId = userId, RoleId = pcRoleId
            };

            _dbEntities.UserRoles.Add(newPC);
            _dbEntities.SaveChanges();
            GetAllUserRoles(true);
            return(true);
        }
Beispiel #3
0
        public bool AddAsociate(PCAssociate pcAssociate)
        {
            //todo appraisal season selection from ui(multiple seasons are active) or in code(if one is active only)
            var appraisalProcesses = _dbEntities.AppraisalSeasons.First(p => p.IsActive == true);

            pcAssociate.AppraisalSeasonId = appraisalProcesses.AppraisalSeasonId;
//            pcAssociate.SelfAppraisalStatus = false;
            _dbEntities.PCAssociates.Add(pcAssociate);
            _dbEntities.SaveChanges();
            return(true);
        }
 public ActiveDirectoryUser EditActiveDirectoryUser(ActiveDirectoryUser activeDirectoryUser)
 {
     _slapDbEntities.Entry(activeDirectoryUser).State = EntityState.Modified;
     _slapDbEntities.SaveChanges();
     return(activeDirectoryUser);
 }
 public bool CreateAppraisalSeason(AppraisalSeason appraisalSeason)
 {
     _dbEntities.AppraisalSeasons.Add(appraisalSeason);
     return(_dbEntities.SaveChanges() > 0);
 }