Beispiel #1
0
        //删除账号
        public ActionResult <Message> DeleteAdmin()
        {
            string[] idsStr = Request.Form["ids"];

            var msg    = new Message(10, "删除失败");
            var idsInt = new List <int>();

            if (idsStr != null && idsStr.Count() > 0)
            {
                foreach (var id in idsStr)
                {
                    if (Validator.IsNumbers(id))
                    {
                        idsInt.Add(int.Parse(id));
                    }
                }

                msg = CMSAdminBO.DeleteAdminByIDs(idsInt);
            }
            else
            {
                msg.Code = 101;
                msg.Msg  = "请选择要删除的账号";
            }

            return(new JsonResult(msg));
        }