コード例 #1
0
        public JsonResult DeleteMember(int id)
        {
            var  dao  = new MemberDao();
            bool temp = dao.Delete(id);

            return(Json(new
            {
                status = temp
            }));
        }
コード例 #2
0
        public IHttpActionResult DeletingMember(int?id)
        {
            bool flag = memberDao.Delete(id);

            if (flag)
            {
                return(Ok($"Member id {id} deleted"));
            }

            return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.BadRequest, $"Deleting member id {id} failed")));
        }
コード例 #3
0
        public ActionResult DeleteMember(member m)
        {
            if (!ModelState.IsValid)
            {
                ViewBag.Error = "Data format invalid error";
                return(View(m));
            }

            bool flag = memberDao.Delete(m.id);

            if (!flag)
            {
                ViewBag.Error = $"Deleting member id:{m.id} failed";
                return(View(m));
            }

            return(RedirectToAction("GetMembers"));
        }
コード例 #4
0
 public long Delete(int _Id)
 {
     return(memberDao.Delete(_Id));
 }