static public void refuserdemandedelegation(int id)
        {
            Delegation del;

            using (DelegationRepository delegationrepo = new DelegationRepository())
            {
                del         = delegationrepo.GetSingle(id);
                del.treated = true;
                delegationrepo.Update(del);
                delegationrepo.Save();
            }
        }
 static public void addDelegation(Delegation delegation)
 {
     using (DelegationRepository delegationrepo = new DelegationRepository())
     {
         delegationrepo.context.Entry(delegation.Concernedaudit).State = EntityState.Unchanged;
         delegationrepo.context.Entry(delegation.Delegate).State       = EntityState.Unchanged;
         delegationrepo.context.Entry(delegation.Delegator).State      = EntityState.Unchanged;
         delegationrepo.context.Entry(delegation.semaine).State        = EntityState.Unchanged;
         delegationrepo.Add(delegation);
         delegationrepo.Save();
     }
 }
        static public void accepterdemandedelegation(int id)
        {
            Delegation del;

            using (DelegationRepository delegationrepo = new DelegationRepository())
            {
                del          = delegationrepo.GetSingle(id);
                del.treated  = true;
                del.accepted = true;
                del.Concernedaudit.auditeur = del.Delegate;
                //   delegationrepo.context.Entry(del.Concernedaudit).State = EntityState.Modified;
                delegationrepo.Update(del);
                delegationrepo.Save();
            }
        }
        public void FindByIdTestNotNull()
        {
            // Arrange
            delegationRepository.Save(new Delegation()
            {
                DelegationId    = 999999,
                CreatedDateTime = DateTime.Now,
                StartDate       = DateTime.Now,
                EndDate         = DateTime.Now,
            });

            // Act
            var result = delegationRepository.FindById(999999);

            // Assert
            Assert.IsInstanceOfType(result, typeof(Delegation));
        }
 public Delegation DelegateManager(Delegation delegation)
 {
     return(delegationRepository.Save(delegation));
 }