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("有帐单在引用,不能删除。")));
            }
        }
Beispiel #2
0
        public JsonResult ShowResult(Models.ShowModel model)
        {
            var data = GetDataSource().FirstOrDefault(o => o.Id == model.Id);

            if (data == null)
            {
                return(Json(DealResult.WrongRefresh("无效操作")));
            }
            return(Json(DealResult.Show(string.Format("显示 {0}", data.Name))));
        }