C # implement permission control in WinForm and WebForm

xiaoxiao2021-03-06  130

Using system.data; using system.collections;

Namespace XSTBD.COMMON.right {///

/// Action Summary Description. /// public class action {private string m_actionname; private bool m_Actionenabled = true; private dataset m_dsrights; private hashtable m_actionobjht; private arraylist m_actionList;

///

/// Operation /// public action () {resetAction ();}

Public action (String ActionName, Bool Actionenable) {this.m_actionname = actionname; this.m_Actionenabled = Actionenabled; resetAction ();

Public action (String actionName) {this.m_actionname = actionname; this.m_Actionenabled = false; resetAction ();} ///

/// Operation name /// public string actionname {get {Return THIS .m_actionname;} set {this.m_actionname = value;}}

///

/// Operation enabled ///// public bool actionenabled {get {return this.m_Actionenabled;} set {this.m_actionenablenabled = value;}}

///

/// Action correspondence object table /// public hashtable actionObjht {get {return this.m_actionobjht;} set {this.m_actionobjht = value;}} /// / The sub-action /// public arraylist actionList {get {return} set} set {this.m_actionlist = value;}}

///

// / permission set and /// public dataset dsrights {get {return this.m_dsrights;} set {this.m_dsrights = value;}} public void address (action action) {m_ActionList .Add (action);} /// /// Reset Action /// private void resetAction () {m_actionobjht = new hashtable (); m_ActionList = new arraylist ();} /// /// Add operation object /// /// Operation object /// Object type Public void addressobj (Object obj, type objtype) {m_actionobjht.add (obj, objtype);

///

/// Set an enabled status of an action while setting the control over an Enabled status of an Action /// public void setActionenabled () {if (this.dsrights.tables [0] .rows.count > 0) {if (this.dsrights.tables [0] .Rows [0] ["ActionName"]. TOSTRING () == "allright") // Set all permissions {setAllactionNableNableD (); return;} for (int); i = 0; i

Private void setALLACTIONENABLED () {for (int i = 0; i /// Setting the control enabled /// private void setActionObjenabled () {for (int i = 0; i

转载请注明原文地址:https://www.9cbs.com/read-99356.html

New Post(0)