private List <KeyValue> LoadList() { if (DataSourceType == "KeyValue") { list = this.ownerPage.GetAllKeyValueByKeyTypeIntCode(KeyTypeIntCode).OrderBy(e => e.Name).ToList(); if (this.AddingDefaultValue) { SMCDropDownList.AddDefaultValue(list, this.UseShortDefaultValue); } if (OrderBy != null) { list = BaseClassBL <KeyValue> .Sort(list, this.OrderBy, this.OrderDirection != null?this.OrderDirection : "asc").ToList(); } } return(list); }
private void SelectEKATEsData(SMCDropDownList ddlCountry, SMCDropDownList ddlMun, string countryId, int?municipalityId, SMCAutoCompleteTextBox acCity, int?cityId) { ddlCountry.SelectedValue = countryId; ddlMun.AdditionalParam = "idCountry=" + countryId; ddlMun.UserControlLoad(); if (municipalityId.HasValue && municipalityId != Constants.INVALID_ID_NULLABLE) { ddlMun.SelectedValue = municipalityId.Value.ToString(); acCity.AdditionalWhereParam = "idMunicipality=" + municipalityId.Value.ToString(); acCity.UserControlLoad(); if (cityId.HasValue && cityId != Constants.INVALID_ID_NULLABLE) { var location = this.ownerPage.AdminClientRef.GetLocationById(cityId.Value.ToString()); acCity.SelectedValue = cityId.ToString(); acCity.Text = (location != null ? location.LocationName : string.Empty); } } }
private void SelectEKATEsData(SMCDropDownList ddlCountry, SMCDropDownList ddlMun, string countryId, int? municipalityId, SMCAutoCompleteTextBox acCity, int? cityId) { ddlCountry.SelectedValue = countryId; ddlMun.AdditionalParam = "idCountry=" + countryId; ddlMun.UserControlLoad(); if (municipalityId.HasValue && municipalityId != Constants.INVALID_ID_NULLABLE) { ddlMun.SelectedValue = municipalityId.Value.ToString(); acCity.AdditionalWhereParam = "idMunicipality=" + municipalityId.Value.ToString(); acCity.UserControlLoad(); if (cityId.HasValue && cityId != Constants.INVALID_ID_NULLABLE) { var location = this.ownerPage.AdminClientRef.GetLocationById(cityId.Value.ToString()); acCity.SelectedValue = cityId.ToString(); acCity.Text = (location != null ? location.LocationName : string.Empty); } } }
private void AddDefaultValue(List <KeyValue> list) { SMCDropDownList.AddDefaultValue(list, false); }
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(); }