/// <summary> /// 加载当前的订单编辑权限人员 /// </summary> private void LoadOrderEditLimit() { LoginOperationLimit model = LoginOperationLimitManager.getLoginOperationLimitByType("1"); if (model != null) { if (model.LimitIds.Trim() != "") { string sql = " id in (" + model.LimitIds + ")"; DataTable dt = LoginInfoManager.getList(sql); for (int i = 0; i < dt.Rows.Count; i++) { if (this.iptuserlist.Value == "") { this.iptuserlist.Value = dt.Rows[i]["cname"].ToString(); } else { this.iptuserlist.Value += "," + dt.Rows[i]["cname"].ToString(); } } } else { this.iptuserlist.Value = ""; } this.hiduserlist.Value = model.LimitIds; } }
/// <summary> /// 设置订单编辑权限 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void imgbtnuser_Click(object sender, ImageClickEventArgs e) { LoginOperationLimit model = LoginOperationLimitManager.getLoginOperationLimitByType("1"); model.LimitIds = this.hiduserlist.Value; int result = LoginOperationLimitManager.updateLoginOperationLimit(model); if (result > 0) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "order", "alert('设置成功')", true); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "error", "alert('设置失败')", true); } }
/// <summary> /// 验证是否能够编辑 /// </summary> /// <param name="makerid"></param> /// <param name="inputerid"></param> /// <returns></returns> public bool IsCanEdit(object makerid, object inputerid) { LoginInfo login = Session["login"] as LoginInfo; LoginOperationLimit limit = LoginOperationLimitManager.getLoginOperationLimitByType("1"); if (limit != null) { string[] limits = limit.LimitIds.Split(','); if (login != null) { //管理员可以编辑 if (limits.Contains(login.Id.ToString())) { return(true); } else if (makerid.Equals(login.Id)) { return(true); } else if (inputerid.Equals(login.Id)) { return(true); } else { return(false); } } else { return(false); } } else { return(false); } }