コード例 #1
0
        public override void UserControlLoad()
        {
            if (this.ownerPage == null)
            {
                throw new UMSException("Current Page is null or is not inheritor of BasicPage.");
            }

            loadInitControls();

            this.pnlFormData.Visible = true;
            this.currentEntity = this.ownerPage.AdminClientRef.GetPermittedActionByID(this.CurrentEntityMasterID);

            if (currentEntity != null)
            {

                this.tbxFrendlyName.Text = currentEntity.FrendlyName;
                this.tbxDescription.Text = currentEntity.Description;
                this.ddlModule.SelectedValue = (currentEntity.idModule.HasValue) ? currentEntity.idModule.ToString() : Constants.INVALID_ID_STRING;

                this.hdnRowMasterKey.Value = currentEntity.EntityID.ToString();
                ClearResultContext(this.lbResultContext);

            }
            else
            {
                this.lbResultContext.Text = "";
                this.tbxFrendlyName.Text = string.Empty;
                this.tbxDescription.Text = string.Empty;

                this.hdnRowMasterKey.Value = string.Empty;
            }


        }
コード例 #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.hdnRowMasterKey.Value))
            {
                this.currentEntity = new PermittedAction();
            }
            else
            {
                this.currentEntity = this.ownerPage.AdminClientRef.GetPermittedActionByID(this.hdnRowMasterKey.Value);

                if (this.currentEntity == null)
                {
                    this.lbResultContext.Text = String.Format(BaseHelper.GetCaptionString("Entity_Role_Not_Found_By_ID"), this.hdnRowMasterKey.Value);
                    this.ownerPage.FormLoad();
                    return;
                }

            }


            currentEntity.FrendlyName = this.tbxFrendlyName.Text;
            currentEntity.Description = this.tbxDescription.Text;
            currentEntity.idModule = this.ddlModule.SelectedValueINT;



            CallContext resultContext = new CallContext();

            resultContext.CurrentConsumerID = this.ownerPage.UserProps.IdUser;

            resultContext = this.ownerPage.AdminClientRef.PermittedActionSave(currentEntity, resultContext);

            this.lbResultContext.Text = resultContext.Message;
            this.hdnRowMasterKey.Value = resultContext.EntityID;

            this.ownerPage.ReloadSettingApplication();

            this.ownerPage.FormLoad();
        }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the PermittedActions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPermittedActions(PermittedAction permittedAction)
 {
     base.AddObject("PermittedActions", permittedAction);
 }
コード例 #4
0
 /// <summary>
 /// Create a new PermittedAction object.
 /// </summary>
 /// <param name="idPermittedAction">Initial value of the idPermittedAction property.</param>
 /// <param name="frendlyName">Initial value of the FrendlyName property.</param>
 /// <param name="description">Initial value of the Description property.</param>
 public static PermittedAction CreatePermittedAction(global::System.Int32 idPermittedAction, global::System.String frendlyName, global::System.String description)
 {
     PermittedAction permittedAction = new PermittedAction();
     permittedAction.idPermittedAction = idPermittedAction;
     permittedAction.FrendlyName = frendlyName;
     permittedAction.Description = description;
     return permittedAction;
 }