コード例 #1
0
        public JsonResult DeleteData(int id)
        {
            if (id > 0)
            {
                Appointment app = new Appointment();
                app.Id          = id;
                app.Status      = Statuses.Cancelado.ToString();
                app.Deleted     = true;
                app.DeletedBy   = User.Identity.GetUserId();
                app.DeletedDate = DateTime.Today;
                db.Delete(app);
                return(Json("success", JsonRequestBehavior.AllowGet));
            }

            return(Json("error", JsonRequestBehavior.DenyGet));
        }
コード例 #2
0
 public void delete(DeleteAppointmentRequest request)
 {
     try
     {
         var response = new DeleteAppointmentResponse();
         var bc       = new AppointmentComponent();
         bc.Delete(request.Appointment);
     }
     catch (Exception ex)
     {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422,
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }