コード例 #1
0
        public IActionResult Delete(Title title)
        {
            var result = _titleService.Delete(title);

            if (result.Success)
            {
                return(Ok(result.Message));
            }

            return(BadRequest(result.Message));
        }
コード例 #2
0
        // POST: /BasicDataManagement/Professional/Delete/
        public ActionResult Delete()
        {
            Title[] datas = ClassConvert <Title> .Process(Request.Form);

            foreach (var data in datas)
            {
                var result = _titleService.Delete(data);
                if (result.ResultType != OperationResultType.Success)
                {
                    return(Json(new { error = result.ResultType.GetDescription(), total = datas.Length, data = datas }));
                }
            }
            return(Json(new { total = datas.Length, data = datas }, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
ファイル: TitleController.cs プロジェクト: csuffyy/Docflow
        public ActionResult DeleteConfirmed(Guid id)
        {
            try
            {
                _Service.Delete(id);
                return(RedirectToAction("Index"));
            }
            catch (Exception e)
            {
                ModelState.AddModelError(string.Empty, e.GetOriginalException().Message);
            }

            var model = _Service.FindView(id);

            if (model == null)
            {
                return(HttpNotFound());
            }

            return(View(model));
        }
コード例 #4
0
        public HttpResponseMessage DeleteTitle([FromBody] string id)
        {
            Guid output;
            var  isValid = Guid.TryParse(id, out output);

            if (!isValid)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest,
                                              "Invalid Title Id."));
            }
            var result = _titleService.GetById(output);

            if (result == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound,
                                              "Invalid Title Id."));
            }
            _titleService.Delete(result);
            var response = Request.CreateResponse(HttpStatusCode.NoContent);

            return(response);
        }
コード例 #5
0
ファイル: TitleController.cs プロジェクト: pninar/KolgraphWeb
        public IHttpActionResult Delete(int id, int userId)
        {
            int result = _service.Delete(id, userId);

            return(Ok());
        }