示例#1
0
        protected void btnSaveKeyValue_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.hdnRowSlaveKey.Value))
            {
                this.currentKeyValue = new ETEMModel.Models.KeyValue();
            }
            else
            {
                this.currentKeyValue = this.ownerPage.AdminClientRef.GetKeyValueByKeyValueID(this.hdnRowSlaveKey.Value);

                if (this.currentKeyValue == null)
                {
                    this.lbResultContext.Text = String.Format(BaseHelper.GetCaptionString("Entity_KeyValue_Not_Found_By_ID"), this.hdnRowSlaveKey.Value);
                    this.ownerPage.FormLoad();
                    return;
                }
            }


            currentKeyValue.Name            = this.tbxKeyValueNameBG.Text.Trim();
            currentKeyValue.NameEN          = this.tbxKeyValueNameEN.Text.Trim();
            currentKeyValue.KeyValueIntCode = this.tbxKeyValueIntCode.Text.Trim();
            currentKeyValue.Description     = this.tbxKeyValueDescription.Text;
            currentKeyValue.V_Order         = BaseHelper.ConvertToInt(this.tbxKeyValueOrder.Text.Trim());

            currentKeyValue.DefaultValue1 = this.tbxDefaultValue1.Text.Trim();
            currentKeyValue.DefaultValue2 = this.tbxDefaultValue2.Text.Trim();
            currentKeyValue.DefaultValue3 = this.tbxDefaultValue3.Text.Trim();
            currentKeyValue.DefaultValue4 = this.tbxDefaultValue4.Text.Trim();
            currentKeyValue.DefaultValue5 = this.tbxDefaultValue5.Text.Trim();
            currentKeyValue.DefaultValue6 = this.tbxDefaultValue6.Text.Trim();
            //currentKeyValue.CodeAdminUNI = this.tbxCodeAdminUNI.Text.Trim();


            currentKeyValue.idKeyType = Int32.Parse(this.hdnRowMasterKey.Value);

            ETEMModel.Helpers.CallContext resultContext = this.ownerPage.AdminClientRef.KeyValueSave(currentKeyValue);

            this.lbResultKeyValueContext.Text = resultContext.Message;
            this.hdnRowSlaveKey.Value         = resultContext.EntityID;


            LoadKeyValues(currentKeyValue.idKeyType.ToString());



            currentCallerDropDownList = this.ownerPage.FindControl(this.hdnCurrentCallerDropDownListUniqueID.Value) as SMCDropDownList;

            if (this.currentCallerDropDownList != null)
            {
                currentCallerDropDownList.UserControlLoad();
                currentCallerDropDownList.SelectedValue = resultContext.EntityID;
            }

            this.ownerPage.ReloadKeyValueInApplication();
        }