private void BindDaten() { model = controller.GetTouristUnit(id); var layoutdaten = controller.GetLayoutDaten(model); LayoutDaten.DataSource = layoutdaten; LayoutDaten.DataBind(); }
protected void btnUpdates_Click(object sender, EventArgs e) { int MaxPersons = LayoutDaten.GetNestedControlValueByFieldName("MaxPersons") == null ? 0 : int.Parse(LayoutDaten.GetNestedControlValueByFieldName("MaxPersons").ToString()); int MaxAdults = LayoutDaten.GetNestedControlValueByFieldName("MaxAdults") == null ? 0 : int.Parse(LayoutDaten.GetNestedControlValueByFieldName("MaxAdults").ToString()); DateTime OpenDate = LayoutDaten.GetNestedControlValueByFieldName("OpenDate") == null ? DateTime.Now : DateTime.Parse(LayoutDaten.GetNestedControlValueByFieldName("OpenDate").ToString()); DateTime CloseDate = LayoutDaten.GetNestedControlValueByFieldName("CloseDate") == null ? DateTime.Now : DateTime.Parse(LayoutDaten.GetNestedControlValueByFieldName("CloseDate").ToString()); model.OpenDate = OpenDate; model.CloseDate = CloseDate; controller.UpdateTouristUnit(model); BindDaten(); }
private void Bind() { lblSite.Text = model.SiteName; lblUnit.Text = model.UnitTitel; lblSiteCode.Text = sitecode; lblUnitCode.Text = unitcode; if (txtMaxBelegung.Text != null) { txtMaxBelegung.Text = model.MaxPersons.ToString(); } if (txtErwachsene.Text != null) { txtErwachsene.Text = model.MaxAdults.ToString(); } comboHaustier.DataSource = DataManager.GetPets(); comboHaustier.DataBind(); int index = controller.GetPet(model); comboHaustier.SelectedIndex = index; comboboxLanguage.DataSource = DataManager.GetLanguages(); comboboxLanguage.DataBind(); comboboxLanguage.SelectedIndex = 0; comboboxLanguageKurz.DataSource = DataManager.GetLanguages(); comboboxLanguageKurz.DataBind(); comboboxLanguageKurz.SelectedIndex = 0; HtmlEditorKurzBeschreibung.Html = model.ShortDescription; HtmlEditorPageBeschreibung.Html = model.Description; lblKurz.Text = GetText().Length.ToString(); var layoutinfo = controller.GetLayoutInfo(model); LayoutObjektInfo.DataSource = layoutinfo; LayoutObjektInfo.DataBind(); ASPxComboBox comboboxType = (ASPxComboBox)LayoutObjektInfo.FindNestedControlByFieldName("TerraceType"); comboboxType.DataSource = DataManager.GetTerraceTypes(); comboboxType.DataBind(); index = controller.GetTerraceType(model); comboboxTerasseTyp.SelectedIndex = index; ASPxComboBox comboboxSea = (ASPxComboBox)LayoutObjektInfo.FindNestedControlByFieldName("LocationSea"); comboboxSea.DataSource = DataManager.GetDistances(); comboboxSea.DataBind(); index = controller.GetSeaLocation(model); comboboxSea.SelectedIndex = index; ASPxComboBox comboboxSite = (ASPxComboBox)LayoutObjektInfo.FindNestedControlByFieldName("LocationSite"); comboboxSite.DataSource = DataManager.GetPositions(); comboboxSite.DataBind(); index = controller.GetSiteLocation(model); comboboxSite.SelectedIndex = index; var layoutdaten = controller.GetLayoutDaten(model); LayoutDaten.DataSource = layoutdaten; LayoutDaten.DataBind(); var offers = offercontroller.GetUnitOfferByCode(sitecode, unitcode); GridUnitOfferView.DataSource = offers; GridUnitOfferView.DataBind(); }