예제 #1
0
        public async Task <IActionResult> Delete(int id)
        {
            termService.Delete(id);
            await unitOfWork.CompleteAsync();

            return(Ok(id));
        }
예제 #2
0
        public ActionResult <DeleteTermResponse> Delete([FromBody] DeleteTermRequest request)
        {
            request.CommanderID = User.GetUserId();
            var result = _termService.Delete(request);

            return(result);
        }
예제 #3
0
        public HttpResponseMessage RemoveTerm(RequestModel request)
        {
            var result = WebHelper.GetResult(request);

            if (result.Code == DoubleX.Infrastructure.Utility.EnumHelper.GetValue(EnumResultCode.操作成功))
            {
                var id   = Guid.Parse(JsonHelper.GetValue(request.Obj, "Id"));
                var tgt  = JsonHelper.GetValue(request.Obj, "Tgt");
                var item = termService.Query(i => i.Id == id).FirstOrDefault();
                termService.Delete(item);
                result.Message = "删除术语成功!";
            }
            return(WebApiHelper.ToHttpResponseMessage(result));
        }
예제 #4
0
        //#endregion

        //#region Delete
        public virtual async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(Content(null));
            }
            string resultmsg = "";

            _TermService.Delete(id.Value);
            await _unitOfWork.SaveChangesAsync();

            CacheManager.InvalidateChildActionsCache();
            resultmsg = "Remove Sucessful";
            return(Json(new { msg = resultmsg }, JsonRequestBehavior.AllowGet));
        }
예제 #5
0
        public async Task <TermDTO> Delete([FromBody] TermDTO termRequestDTO)
        {
            Term term = new Term
            {
                Id = termRequestDTO.Id
            };
            Term res = await TermService.Delete(term);

            return(new TermDTO
            {
                Id = res.Id,
                SemesterCode = res.SemesterCode,
                SubjectName = res.SubjectName,
                SemesterId = res.SemesterId,
                Errors = res.Errors
            });
        }