private void BindOPAccess(SysRole role) { //if (role.ID == 0) // return; ItemsControl op = View.Extension.UIHelper.GetVisualChild <ItemsControl>(myRadDataForm, "opList"); if (op == null) { return; } BasicInfoEnum bi = (BasicInfoEnum)role.OPAccess; var fields = op.ChildrenOfType <CheckBox>(); if (fields != null && fields.Count() > 0) { foreach (var field in fields) { BasicInfoEnum tag = (BasicInfoEnum)field.Tag; if ((bi & tag) == tag) { field.IsChecked = true; } else { field.IsChecked = false; } } } }
public static DataFormCommandButtonsVisibility GetCurrentUserDataFormCommand(BasicInfoEnum bi) { var op = DataFormCommandButtonsVisibility.Navigation; if ((VMGlobal.CurrentUser.OperateAccess & bi) == bi) { op = DataFormCommandButtonsVisibility.All; } return(op); }