public async void DeleteApplicantTest()
        {
            await _applicantService.DeleteApplicant(1);

            var findResult = this._context.Applicants.SingleOrDefault(x => x.Id == 1);

            Assert.Null(findResult);
        }
示例#2
0
        public async Task <ActionResult> DeleteApplicant(BaseFormModel model)
        {
            var applicant = ApplicantService.GetApplicantById(int.Parse(model.Id));

            if (applicant == null)
            {
                return(Json(new { model = "failed", modelList = "Абітурієнта не знайдено!" }, JsonRequestBehavior.AllowGet));
            }

            var result = await ApplicantService.DeleteApplicant(applicant);

            return(Json(new { model = result.Successed ? "confirmed" : "failed", modelList = result.Message, type = "remove" }, JsonRequestBehavior.AllowGet));
        }
示例#3
0
        protected async Task Delete_Click()
        {
            await ApplicantService.DeleteApplicant(Applicant.ID);

            NavigationManager.NavigateTo("/");
        }