public IActionResult ApproveByHumanResourceDept(int id) { var username = this.GetCurrentUserName(); var repo = this.Storage.GetRepository <IRequestBusinesstripRepository>(); RequestBusinesstrip requestBusinesstrip = repo.WithKey(id); if (requestBusinesstrip == null) { return(this.NotFound(new { success = false })); } if (requestBusinesstrip.HasFeedbackByScrumMaster() || requestBusinesstrip.HasFeedbackByHumanResource()) { this.ModelState.AddModelError("id", "Already have feedback by Scrum Master or HR"); } if (ModelState.IsValid) { requestBusinesstrip.HumanResourceDeptApproved(20, GetCurrentUserName()); this.Storage.Save(); return(Ok(new { success = true })); } return(BadRequest()); }
public IActionResult ApproveByHumanResourceDept(int id) { var username = this.GetCurrentUserName(); var repo = this.Storage.GetRepository <IRequestBusinesstripRepository>(); RequestBusinesstrip requestBusinesstrip = repo.WithKey(id); if (requestBusinesstrip == null) { return(this.NotFound(new { success = false })); } requestBusinesstrip.HumanResourceDeptApproved(20, GetCurrentUserName()); this.Storage.Save(); return(Ok(new { success = true })); }