Example #1
0
        public ActionResult Update(InterviewRound referal)
        {
            ApiResult <InterviewRound> apiResult;

            if (ModelState.IsValid)
            {
                if (referal.Id > 0)
                {
                    apiResult = TryExecute(() =>
                    {
                        _interviewRoundRepository.Update(referal);
                        _unitOfWork.Commit();
                        return(referal);
                    }, "Interview updated sucessfully");
                }
                else
                {
                    apiResult = TryExecute(() =>
                    {
                        _interviewRoundRepository.Create(referal);
                        _unitOfWork.Commit();
                        return(referal);
                    }, "Interview created sucessfully");
                }
            }
            else
            {
                apiResult = ApiResultFromModelErrors <InterviewRound>();
            }

            return(Json(apiResult, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Edit(InterviewRound interviewRound)
        {
            if (ModelState.IsValid)
            {
                _interviewRoundRepository.Update(interviewRound);
                _unitOfWork.Commit();

                return(RedirectToAction("Index"));
            }

            ViewBag.CandidateId   = new SelectList(_candidateRepository.GetAll(o => o.OrderByDescending(c => c.Id), "Person").Select(c => new { c.Id, Name = c.Person.Name + "- [" + c.Code + "]" }), "Id", "Name", interviewRound.CandidateId);
            ViewBag.InterviewerId = new SelectList(_userRepository.GetAllBy(u => u.EmployeeStatus != EmployeeStatus.Ex && u.Id != 1, "Person"), "Id", "Person.Name", interviewRound.InterviewerId);
            ViewBag.JobOpeningId  = new SelectList(_jobOpeningRepository.GetAll(), "Id", "Title", interviewRound.JobOpeningId);
            ViewBag.RoundId       = new SelectList(_roundRepository.GetAll(), "Id", "Title", interviewRound.RoundId);

            return(View(interviewRound));
        }
            public async Task <Unit> Handle(UpdateInterviewRoundCommand request, CancellationToken cancellationToken)
            {
                var interviewRound = new InterviewRound();

                interviewRound.Id         = request.Id;
                interviewRound.FeedbackId = request.FeedbackId;
                interviewRound.Date       = System.DateTime.Now;
                _context.Update(interviewRound);
                return(Unit.Value);
            }