Ejemplo n.º 1
0
        public override void UserControlLoad()
        {
            if (this.ownerPage == null)
            {
                throw new UMSException("Current Page is null or is not inheritor of BasicPage.");
            }


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

            if (currentEntity != null)
            {

                this.tbxIP.Text = currentEntity.IP;
                this.tbxCommnet.Text = currentEntity.Commnet;
                this.chbxAllow.Checked = currentEntity.Allow;

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

            }
            else
            {
                this.lbResultContext.Text = "";

                this.tbxIP.Text = string.Empty;
                this.tbxCommnet.Text = string.Empty;
                this.chbxAllow.Checked = false;


                this.hdnRowMasterKey.Value = string.Empty;
            }


        }
Ejemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.hdnRowMasterKey.Value))
            {
                this.currentEntity = new AllowIP();
            }
            else
            {
                this.currentEntity = this.ownerPage.AdminClientRef.GetAllowIPByID(this.hdnRowMasterKey.Value);

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

            }


            currentEntity.IP = this.tbxIP.Text;
            currentEntity.Commnet = this.tbxCommnet.Text;
            currentEntity.Allow = this.chbxAllow.Checked;

            CallContext resultContext = new CallContext();

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

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

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


            this.ownerPage.FormLoad();

        }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a new AllowIP object.
 /// </summary>
 /// <param name="idAllowIP">Initial value of the idAllowIP property.</param>
 /// <param name="iP">Initial value of the IP property.</param>
 /// <param name="allow">Initial value of the Allow property.</param>
 public static AllowIP CreateAllowIP(global::System.Int32 idAllowIP, global::System.String iP, global::System.Boolean allow)
 {
     AllowIP allowIP = new AllowIP();
     allowIP.idAllowIP = idAllowIP;
     allowIP.IP = iP;
     allowIP.Allow = allow;
     return allowIP;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the AllowIPs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAllowIPs(AllowIP allowIP)
 {
     base.AddObject("AllowIPs", allowIP);
 }