Ejemplo n.º 1
0
        public IActionResult RejectByHumanResourceDept([FromRoute] int id)
        {
            var            username       = this.GetCurrentUserName();
            var            repo           = this.Storage.GetRepository <IRequestMedicalRepository>();
            RequestMedical requestMedical = repo.WithKey(id);

            if (requestMedical == null)
            {
                return(this.NotFound(new { success = false }));
            }
            requestMedical.HumanResourceDeptRejected(20, GetCurrentUserName());

            this.Storage.Save();
            return(Ok(new { success = true }));
        }
Ejemplo n.º 2
0
        public IActionResult RejectByHumanResourceDept([FromRoute] int id)
        {
            var            username       = this.GetCurrentUserName();
            var            repo           = this.Storage.GetRepository <IRequestMedicalRepository>();
            RequestMedical requestMedical = repo.WithKey(id);

            if (requestMedical == null)
            {
                return(this.NotFound(new { success = false }));
            }
            if (requestMedical.HasFeedbackByScrumMaster() || requestMedical.HasFeedbackByHumanResource())
            {
                this.ModelState.AddModelError("id", "Already have feedback by Srum Master or HR");
            }

            if (ModelState.IsValid)
            {
                requestMedical.HumanResourceDeptRejected(20, GetCurrentUserName());

                this.Storage.Save();
                return(Ok(new { success = true }));
            }
            return(BadRequest());
        }