Esempio n. 1
0
        protected void lstFeatureList_SelectedIndexChanged(object sender, EventArgs e)
        {
            lstFeatureList.Attributes.Add("onClick", "javascript:alert('" + Localization.GetString("LstDisabled.Text", this.LocalResourceFile) + "');");

            // Determine new Id
            FeatureListId = Convert.ToInt32(lstFeatureList.SelectedValue);
            if (FeatureListId == -1)
            {
                EditState                     = "new";
                lngFeatureLists.Langs         = new List <ILanguageEditorInfo>();
                pnlFeatureListDetails.Visible = true;
                lblFLDetails.Text             = Localization.GetString("NewFeatureList.Text", this.LocalResourceFile);
            }


            // Enabling / Disabling Edit Controls
            pnlFeatureLists.Visible = false;

            bool pnlVisible = (FeatureListId > -1 || EditState == "new");

            pnlFeatureListDetails.Visible = pnlVisible;
            cmdUpdate.Visible             = pnlVisible;
            cmdCancel.Visible             = true;
            cmdDelete.Visible             = (EditState != "new");
            imgEditItems.Visible          = (EditState != "new");

            if (FeatureListId > 0)
            {
                FeatureList = Controller.GetFeatureListById(FeatureListId, CurrentLanguage);
            }

            if (FeatureList != null)
            {
                // Fill in the Language information
                List <ILanguageEditorInfo> dbLangs = new List <ILanguageEditorInfo>();
                foreach (FeatureListLangInfo featureListLang in Controller.GetFeatureListLangs(FeatureList.FeatureListId))
                {
                    dbLangs.Add(featureListLang);
                }
                lngFeatureLists.Langs = dbLangs;
            }

            lblFLDetails.Text           = String.Format("{0} (ID:{1})", lstFeatureList.SelectedItem.Text, FeatureListId);
            lblFLDetails.Visible        = true;
            lblFLDetailsCaption.Visible = true;
            UpdateList(CurrentLanguage);
        }