protected override void OnRowCellClick(DataRow dr, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { if (e.Column.Name == "gc_group_function") //设置权限 { UCFunctionEditor edit = new UCFunctionEditor(); edit.Title = string.Format("设置【{0}】群组权限", dr["group_name"]); edit.EditValue = dr["group_function"].ToString(); if (edit.ShowDialog() == DialogResult.OK) {//设置权限 if (dr["group_function"].ToString() != edit.EditValue) { Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add("group_function", edit.EditValue); bool suc = Tmo_FakeEntityClient.Instance.SubmitData(TmoCommon.DBOperateType.Update, TableName, PrimaryKey, dr[PrimaryKey].ToString(), dic); if (!suc) { DXMessageBox.ShowError("权限设置失败,请重试!"); } else { GetData(); } } } edit.Dispose(); } base.OnRowCellClick(dr, e); }
protected override void OnRowCellClick(DataRow dr, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { if (e.Column.Name == "gc_doc_function") //设置权限 { UCFunctionEditor edit = new UCFunctionEditor(); edit.Title = string.Format("设置健康师【{0}】权限", dr["doc_name"]); string doc_function = dr["doc_function"].ToString(); if (string.IsNullOrWhiteSpace(doc_function)) { DataTable dt = Tmo_FakeEntityClient.Instance.GetData("tmo_docgroup", new[] { "group_function" }, null, "group_id", dr["doc_group"].ToString()); if (TmoShare.DataTableIsNotEmpty(dt)) { doc_function = dt.Rows[0][0].ToString(); } } edit.EditValue = doc_function; if (edit.ShowDialog() == DialogResult.OK) {//设置权限 if (doc_function != edit.EditValue) { Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add("doc_function", edit.EditValue); bool suc = Tmo_FakeEntityClient.Instance.SubmitData(DBOperateType.Update, TableName, PrimaryKey, dr[PrimaryKey].ToString(), dic); if (!suc) { DXMessageBox.ShowError("权限设置失败,请重试!"); } else { GetData(); } } } edit.Dispose(); } base.OnRowCellClick(dr, e); }