Пример #1
0
        public ActionResult FlowDelete(IList <int> idList)
        {
            Flow flow = new Flow();

            if (ModelState.IsValid)
            {
                bool delete;
                try
                {
                    delete = flow.Delete(idList);
                }
                catch (Exception)
                {
                    delete = false;
                }

                if (delete)
                {
                    return(Json(new { IsSuccess = true, Message = "删除成功" }));
                }
                else
                {
                    return(Json(new { IsSuccess = false, Message = "删除失败" }));
                }
            }
            return(View());
        }
Пример #2
0
        public async Task <ActionResult> Del(string ID)
        {
            Flow flow = await Models.Flow.GetInstanceAsync(ID);

            if (flow == null)
            {
                return(View("~/Views/Shared/Error.cshtml"));
            }

            if (flow.Delete())
            {
                return(Redirect("/Flow"));
            }
            else
            {
                return(View("~/Views/Shared/Error.cshtml"));
            }
        }