Exemplo n.º 1
0
        private void BindObjektInfo()
        {
            model = controller.GetTouristUnit(id);
            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;


            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;
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            int          MobilehomeSize  = LayoutObjektInfo.GetNestedControlValueByFieldName("MobilehomeSize") == null ? 0 : int.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("MobilehomeSize").ToString());
            int          DoubleBeds      = LayoutObjektInfo.GetNestedControlValueByFieldName("DoubleBeds") == null ? 0 : int.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("DoubleBeds").ToString());
            int          SingleBeds      = LayoutObjektInfo.GetNestedControlValueByFieldName("SingleBeds") == null ? 0 : int.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("SingleBeds").ToString());
            bool         AirConditioning = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("AirConditioning").ToString());
            int          Bedrooms        = LayoutObjektInfo.GetNestedControlValueByFieldName("Bedrooms") == null ? 0 : int.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("Bedrooms").ToString());
            int          BunkBeds        = LayoutObjektInfo.GetNestedControlValueByFieldName("BunkBeds") == null ? 0 : int.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("BunkBeds").ToString());
            int          ExtraBeds       = LayoutObjektInfo.GetNestedControlValueByFieldName("ExtraBeds") == null ? 0 : int.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("ExtraBeds").ToString());
            int          Bathrooms       = LayoutObjektInfo.GetNestedControlValueByFieldName("Bathrooms") == null ? 0 : int.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("Bathrooms").ToString());
            int          WC                    = LayoutObjektInfo.GetNestedControlValueByFieldName("WC") == null ? 0 : int.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("WC").ToString());
            bool         Coffeemachine         = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("Coffeemachine").ToString());
            bool         Fridge                = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("Fridge").ToString());
            bool         Childbed              = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("Childbed").ToString());
            bool         DVDPlayer             = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("DVDPlayer").ToString());
            ASPxComboBox comboboxType          = (ASPxComboBox)LayoutObjektInfo.FindNestedControlByFieldName("TerraceType");
            string       TerraceType           = comboboxType.SelectedItem == null ? string.Empty : comboboxType.SelectedItem.Text;
            int          ParcelSize            = LayoutObjektInfo.GetNestedControlValueByFieldName("ParcelSize") == null ? 0 : int.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("ParcelSize").ToString());
            bool         Sunshade              = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("Sunshade").ToString());
            bool         SolarShower           = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("SolarShower").ToString());
            int          TerraceSize           = LayoutObjektInfo.GetNestedControlValueByFieldName("TerraceSize") == null ? 0 : int.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("TerraceSize").ToString());
            bool         Sunloungers           = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("Sunloungers").ToString());
            bool         WoodenFurniture       = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("WoodenFurniture").ToString());
            bool         Kettle                = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("Kettle").ToString());
            bool         Towel                 = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("Towel").ToString());
            bool         BedWashing            = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("Parkinglot").ToString());
            bool         Parkinglot            = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("BedWashing").ToString());
            bool         FinishCleaning        = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("FinishCleaning").ToString());
            bool         WiFiInternetPriceFree = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("WiFiInternetPriceFree").ToString());
            bool         WiFiInternet          = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("WiFiInternet").ToString());
            bool         Pool                  = Boolean.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("Pool").ToString());
            int          BeachDistanceFrom     = LayoutObjektInfo.GetNestedControlValueByFieldName("BeachDistanceFrom") == null ? 0 : int.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("BeachDistanceFrom").ToString());
            ASPxComboBox comboboxSite          = (ASPxComboBox)LayoutObjektInfo.FindNestedControlByFieldName("LocationSite");
            string       LocationSite          = comboboxSite.SelectedItem == null ? string.Empty : comboboxSite.SelectedItem.Text;
            int          BeachDistanceTo       = LayoutObjektInfo.GetNestedControlValueByFieldName("BeachDistanceTo") == null ? 0 : int.Parse(LayoutObjektInfo.GetNestedControlValueByFieldName("BeachDistanceTo").ToString());
            ASPxComboBox comboboxSea           = (ASPxComboBox)LayoutObjektInfo.FindNestedControlByFieldName("LocationSea");
            string       LocationSea           = comboboxSea.SelectedItem == null ? string.Empty : comboboxSea.SelectedItem.Text;


            model.MobilehomeSize  = MobilehomeSize;
            model.DoubleBeds      = DoubleBeds;
            model.SingleBeds      = SingleBeds;
            model.AirConditioning = AirConditioning;
            model.Bedrooms        = Bedrooms;
            model.BunkBeds        = BunkBeds;
            model.ExtraBeds       = ExtraBeds;
            model.Bathrooms       = Bathrooms;
            model.WC                    = WC;
            model.Coffeemachine         = Coffeemachine;
            model.Fridge                = Fridge;
            model.Childbed              = Childbed;
            model.DVDPlayer             = DVDPlayer;
            model.TerraceType           = TerraceType;
            model.ParcelSize            = ParcelSize;
            model.Sunshade              = Sunshade;
            model.SolarShower           = SolarShower;
            model.TerraceSize           = TerraceSize;
            model.Sunloungers           = Sunloungers;
            model.WoodenFurniture       = WoodenFurniture;
            model.Kettle                = Kettle;
            model.Towel                 = Towel;
            model.BedWashing            = BedWashing;
            model.Parkinglot            = Parkinglot;
            model.FinishCleaning        = FinishCleaning;
            model.WiFiInternetPriceFree = WiFiInternetPriceFree;
            model.WiFiInternet          = WiFiInternet;
            model.Pool                  = Pool;
            model.BeachDistanceFrom     = BeachDistanceFrom;
            model.LocationSite          = LocationSite;
            model.BeachDistanceTo       = BeachDistanceTo;
            model.LocationSea           = LocationSea;

            model.MaxPersons = int.Parse(txtMaxBelegung.Text);
            model.MaxAdults  = int.Parse(txtErwachsene.Text);
            if (comboHaustier.SelectedItem != null)
            {
                model.Pets = int.Parse(comboHaustier.SelectedItem.Value.ToString());
            }

            controller.UpdateTouristUnit(model);

            BindObjektInfo();
        }