コード例 #1
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);
        }
コード例 #2
0
        public bool RemoveAssociate(Guid associateId, Guid pcId)
        {
            PCAssociate pcAssociate =
                _dbEntities.PCAssociates.FirstOrDefault(p => p.PCUserId == pcId && p.AssociateUserId == associateId);

            if (pcAssociate != null)
            {
                _dbEntities.PCAssociates.Remove(pcAssociate);
            }
            _dbEntities.SaveChanges();
            return(true);
        }
コード例 #3
0
 public PCAssociate EditPCAssociate(PCAssociate pcAssociate)
 {
     _dbEntities.Entry(pcAssociate).State = EntityState.Modified;
     _dbEntities.SaveChanges();
     return(pcAssociate);
 }