Esempio n. 1
0
        public ActionResult Delete(string ids)
        {
            if (string.IsNullOrEmpty(ids))
            {
                return(Content("请选中要删除的数据!"));
            }
            #region shit删除
            ////拆分接收过来的ids
            //string[] strids = ids.Split(',');
            //foreach (string id in strids)
            //{
            //    roleInfoService.Delete(new RoleInfo() { ID = int.Parse(id) });
            //}
            #endregion

            //换成批量删除
            string[]   strids = ids.Split(',');
            List <int> idList = new List <int>();
            foreach (string id in strids)
            {
                idList.Add(int.Parse(id));
            }
            int result = roleInfoService.DeleteList(idList);
            if (result <= 0)
            {
                return(Content("删除失败!"));
            }
            return(Content("ok"));
        }