예제 #1
0
        protected void btnSave_Click(object sender, ImageClickEventArgs e)
        {
            AWAPI_Data.Data.awEnvironment env = new AWAPI_Data.Data.awEnvironment();
            Int64 id = 0;

            try
            {
                env.userId      = App_Code.SessionInfo.CurrentUser.userId;
                env.title       = _title.Text;
                env.description = _description.Text;
                env.serviceUrl  = _serviceUrl.Text;
                env.publicKey   = _publicKey.Text;

                if (_id.Text.Trim() == "")  //add new
                {
                    id = _environmentLib.Add(SiteId, env.userId, env.title, env.description, env.serviceUrl, env.publicKey);
                }
                else  //Update
                {
                    id = Convert.ToInt64(_id.Text);
                    _environmentLib.Update(id, env.userId, env.title, env.description, env.serviceUrl, env.publicKey);
                }
                _id.Text = id.ToString();

                PopulateList();
                ShowHideControls(true);

                App_Code.Misc.WriteMessage(_msg, "Environment has been saved.");
            }
            catch (Exception ex)
            {
                App_Code.Misc.WriteMessage(App_Code.Misc.MessageType.ERROR, _msg, ex.Message);
            }
        }
예제 #2
0
        void Populate(long environmentId)
        {
            ResetControls();

            AWAPI_Data.Data.awEnvironment env = _envLib.Get(environmentId);
            if (env == null)
            {
                return;
            }

            _serviceUrl.Text = env.serviceUrl;
        }
예제 #3
0
        void Populate(long EnvironmentId)
        {
            ResetControls();
            AWAPI_Data.Data.awEnvironment env = _environmentLib.Get(EnvironmentId);
            if (env == null)
            {
                return;
            }

            _id.Text          = EnvironmentId.ToString();
            _title.Text       = env.title;
            _description.Text = env.description;
            _serviceUrl.Text  = env.serviceUrl;
            _publicKey.Text   = env.publicKey;

            ShowHideControls(true);
        }