Esempio n. 1
0
        public ActionResult <Work> GetById(int id)
        {
            if (!workService.GetById(id, out var work))
            {
                return(NotFound());
            }

            return(work);
        }
Esempio n. 2
0
        public IActionResult UpdateWork(int id)
        {
            TempData["Active"] = TempDataInfo.Work;

            var work = _workService.GetById(id);

            ViewBag.Urgencies = new SelectList(_urgenyService.GetAll(), "Id", "Description", work.UrgencyId);

            return(View(_mapper.Map <WorkUpdateDto>(work)));
        }
        public IActionResult AssignStaff(AssignPersonDto model)
        {
            var updatedWork = _workService.GetById(model.WorkId);

            updatedWork.AppUserId = model.PersonId;

            _workService.Update(updatedWork);

            _notificationService.Create(new Notification
            {
                AppUserId   = model.PersonId,
                Description = $"{updatedWork.Name} isimli iş için görevlendirildiniz."
            });


            return(RedirectToAction("Index"));
        }
Esempio n. 4
0
        public async Task <IActionResult> CompleteWork(int id)
        {
            var updatedWork = _workService.GetById(id);

            updatedWork.Status = true;
            _workService.Update(updatedWork);

            var user = await GetLoggedUser();

            var adminUserList = await _userManager.GetUsersInRoleAsync("Admin");

            foreach (var admin in adminUserList)
            {
                _notificationService.Create(new Notification
                {
                    Description = $"{user.Name} {user.Surname} bir görevi tamamladı.",
                    AppUserId   = admin.Id,
                });
            }

            return(Json(null));
        }
Esempio n. 5
0
        public IActionResult Details(Guid workId)
        {
            var work = _workService.GetById(workId);

            return(View(work));
        }