/// <summary> /// Hàm gọi form và truyền SEC vào form /// </summary> /// <param name="_ParentForm">Form Cha</param> /// <param name="_Form">Form muốn gọi</param> /// <param name="_FunctionName">Tên chức năng</param> /// <param name="_IsMDI">MDI parent ?</param> static public void CallForm(Form _ParentForm, _Forms _Form, string _FunctionName, bool _IsMDI, bool _IsDialog) { _Form.Permission = GetPermissionInfo(_FunctionName); if (_Form.Permission[0] == true) { if (_IsMDI == true) { _Form.MdiParent = _ParentForm; _Form.BringToFront(); } if (_IsDialog == false) { _Form.Show(); _Form.BringToFront(); } else { _Form.ShowDialog(); _Form.BringToFront(); } } else { MessageBox.Show("You have not permission !", "Message"); _Form.Dispose(); } }
/// <summary> /// Load permission lên form /// </summary> /// <param name="_Form">_Forms</param> /// <param name="_FunctionName">Tên chức năng hoặc form</param> static public void LoadSecurity(_Forms _Form, string _FunctionName) { _Form.Permission = GetPermissionInfo(_FunctionName); }