public JsonResult Remove(Guid[] selectedId) { if (selectedId == null || selectedId.Length == 0) { return(Json(DealResult.Refresh())); } var appClients = new Application.AppClient(); var actionResult = true; foreach (var item in selectedId) { if (!appClients.Remove(item)) { actionResult = false; } } if (actionResult) { return(Json(DealResult.Refresh())); } else { return(Json(DealResult.WrongRefresh("有帐单在引用,不能删除。"))); } }
public ActionResult Edit(Guid selectedId) { var data = new Application.AppClient().Get(selectedId); if (data == null) { return(HttpNotFound()); } var form = FormHorizontal.Create(data.MapTo(new Models.AppClientEditModel()), Url.Location(new Func <Models.AppClientEditModel, JsonResult>(EditResult))); var panel = new Panel(); panel.ConfigLocation(); panel.Append(form); return(new HtmlResult(panel.CreateGrid())); }