Beispiel #1
0
 public ICTViewModel(ICT ict)
 {
     employeeID          = (ict.employee != null) ? ict.employee.EmployeeID : 0;
     name                = ict.employee?.Name;
     surname             = ict.employee?.Surname;
     localPlus           = ict.employee?.LocalPlus?.Description;
     technicalID         = ict.employee?.UserId;
     workingLocation     = ict.employee?.location?.Description;
     employeeCategory    = ict.employee?.standardEmployeeCategory?.Description;
     costCentre          = ict.employee?.workingCostCentre?.Description;
     activityStatus      = ict.employee?.activityStatus?.Description;
     activeDirAccount    = ict.ActiveDirAccount;
     workstaionNumber    = ict.WorkstaionNumber;
     approvalLevel1      = ict.ApprovalLevel1;
     approvalLevel2      = ict.ApprovalLevel2;
     macroAggregation    = ict.MacroAggregation;
     deskPhoneNumber     = ict.DeskPhoneNumber;
     mobileNumber        = ict.MobileNumber;
     advancedLyncProfile = ict.AdvancedLyncProfile;
     sap = ict.SAP;
     linkToAttachment = ict.LinkToAttachment;
     note             = ict.Note;
     startMoveDate    = ict.StartMoveDate;
     emailAddress     = ict.employee?.EmailAddress;
 }
Beispiel #2
0
        public void ict_test()
        {
            ICT           ict          = new ICT();
            IIterator     ictIterator  = ict.CreateIterator();
            List <string> fromIterator = new List <string>();

            fromIterator.Add(ictIterator.Next());
            Assert.AreEqual(fromIterator.Count(), 1);
            Assert.AreEqual(ictIterator.IsDone(), false);
            fromIterator.Add(ictIterator.Next());
            Assert.AreEqual(fromIterator.Count(), 2);
            Assert.AreEqual(ictIterator.IsDone(), false);
            fromIterator.Add(ictIterator.Next());
            Assert.AreEqual(fromIterator.Count(), 3);
            Assert.AreEqual(ictIterator.IsDone(), false);
            fromIterator.Add(ictIterator.Next());
            Assert.AreEqual(fromIterator.Count(), 4);
            Assert.AreEqual(ictIterator.IsDone(), true);
        }
Beispiel #3
0
        public IActionResult Put(long id, [FromBody] JToken ict)
        {
            ICT oldICT = context.ICTs.Find(id);

            if (oldICT == null)
            {
                return(NotFound());
            }

            try
            {
                oldICT.UpdateFromICTViewModel(context, ict);
                context.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(Ok(ict));
        }