private void deleteBtn_Click_1(object sender, EventArgs e)
        {
            AdminServices adminServices = new AdminServices();
            Admin         temp          = new Admin();

            temp.Phone = textBox1.Text;
            bool check = adminServices.Delete(temp);

            if (check)
            {
                MessageBox.Show("Admin Deleted");
            }
            else
            {
                MessageBox.Show("Error Occured !");
            }
        }
示例#2
0
        public JsonResult DeleteJson(List <int> ids)
        {
            int      _total          = ids.Count();
            Response _res            = new Response();
            int      _currentAdminID = int.Parse(Session["AdminID"].ToString());

            if (ids.Contains(_currentAdminID))
            {
                ids.Remove(_currentAdminID);
            }
            _res = adminManager.Delete(ids);
            if (_res.Code == 1 && _res.Data < _total)
            {
                _res.Code    = 2;
                _res.Message = "共提交删除" + _total + "名管理员,实际删除" + _res.Data + "名管理员。\n原因:不能删除当前登录的账号";
            }
            else if (_res.Code == 2)
            {
                _res.Message = "共提交删除" + _total + "名管理员,实际删除" + _res.Data + "名管理员。";
            }
            return(Json(_res));
        }