/// <summary> /// the Form Permissions will be captured and Set the Button Action Modes /// </summary> /// <param name="e">OnLoad Even Args</param> protected override void OnLoad(EventArgs e) { try { ////Check for default value if (this.parentFormId == 0) { this.parentFormId = Convert.ToInt32(this.Tag); } this.ParentForm.FormClosing += new FormClosingEventHandler(this.ParentForm_FormClosing); this.ParentForm.Resize += new EventHandler(this.ParentForm_Resize); this.permissionFields = this.GetFormPermissions(this.parentFormId); this.permissionEdit = this.permissionFields.editPermission; this.Size = this.ParentForm.Size; this.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)))); base.OnLoad(e); if (!this.flagSliceForm) { this.ParentForm.MinimumSize = this.MinimumSize; } this.SetFormPermissions(this.permissionFields); if (this.NullRecords) { this.SetButtons(TerraScanCommon.ButtonActionMode.NullRecordMode); } else if (this.DisableAllControls) { this.SetButtons(TerraScanCommon.ButtonActionMode.DisableAllContorlsMode); } else { this.SetButtons(TerraScanCommon.ButtonActionMode.CancelMode); } } catch { } }
/// <summary> /// Method will set the Permissions for the SmartPart /// </summary> /// <param name="permissionField">PermissionField Struct</param> public void SetFormPermissions(PermissionFields permissionField) { this.SetPermissions(this, new DataEventArgs <PermissionFields>(permissionField)); }