예제 #1
0
        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();
            }
        }
예제 #2
0
 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();
     }
 }
예제 #3
0
        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));
        }
예제 #5
0
 public Delegation DelegateManager(Delegation delegation)
 {
     return(delegationRepository.Save(delegation));
 }