コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override WorkAssignment Get(int id)
        {
            var wa = waRepo.GetById(id);

            if (wa.workerAssignedID != null)
            {
                wa.workerAssignedDDD = wRepo.GetById((int)wa.workerAssignedID);
            }
            return(wa);
        }
コード例 #2
0
        public async Task <WorkerDTO> GetByIdAsync(long Id)
        {
            var result = await _workerRepository.GetById(Id);

            var worker = _mapper.Map <Worker, WorkerDTO>(result);

            return(worker);
        }
コード例 #3
0
 public ActionResult Delete(int id)
 {
     try{
         Worker worker = workerRepository.GetById(id);
         workRepository.DeleteWorker(id);
         studentRepository.SaveChanges();
     }
     catch (DataException)
     {
         return(RedirectToAction("Delete", new { id = id, saveChangesError = true }));
     }
     return(RedirectToAction("Index"));
 }
コード例 #4
0
 public Worker GetById(int id)
 {
     return(_repository.GetById(id));
 }