public string DelUser(string UserId) { UserInfo user = new UserInfo(); user = (UserInfo)Session["LoginUser"]; if (UserId != null && UserId.Trim() != "") { UserInfo ui = userInfoBll.GetUserInfo(UserId); //删除用户 int k = userInfoBll.Delete(UserId); new LogMessage().Save("ID:" + UserId + "。"); if (k > 0) { //删除设备关联SETMANAGER Transfers.ClintSendCommData(1108, "1", "7", ui.UserLname, "", "", "", "", "", "", "", "", "", "", "", "", "", "", user.UserName); //刷新用户 Transfers.ClintSendCommData(1160, "1108", "", "", "", "", "", "", "", "", "", "1", "1", "", "", "", "", "", ""); return("true"); } else { return("false"); } } else { return("false"); } }
public ActionResult DelUser(string id) { try { bool result = userbll.Delete(userbll.GetById(id)); if (result) { return(Json(new { success = true, msg = "操作成功" })); } else { return(Json(new { success = false, msg = "操作失败" })); } } catch (Exception ex) { return(Json(new { success = false, msg = "服务器内部错误" })); } }
/// <summary> /// 删除 /// </summary> /// <returns></returns> public ActionResult Delete() { int KeyID = Convert.ToInt32(Request.Form["KeyID"]); if (UserInfoBLL.Delete(KeyID)) { return(Content(new JsonMessage { Success = true }.ToString())); } else { return(Content(new JsonMessage { Success = false }.ToString())); } }
private void Delete() { AjaxResult result = new AjaxResult(); result.IsSuccess = false; result.Msg = "删除失败!"; if (Request.Form["cbx_select"] != null) { if (userBll.Delete(Request.Form["cbx_select"].ToString())) { result.IsSuccess = true; result.Msg = "删除成功!"; } } Response.Clear(); Response.Write(result.ToJsonString()); Response.ContentType = "application/json"; Response.End(); }
private void ButtonDelete_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(TextBoxName.Text) && _currentUser.Role == "Administrator") { var updateUser = _userInfo.Delete(new SmartDB(), _userId); bool flag = updateUser.Code == ErrorEnum.NoError; if (flag) { MessageBox.Show("User Deleted"); ResetControls(); } else { MessageBox.Show("User is not deleted!"); } } else { MessageBox.Show("No User to delete or Contact Admin."); } }
public JsonResult Delete(string id) { var json = _bll.Delete(id); return(Json(json, JsonRequestBehavior.AllowGet)); }