public static new ASearchItem loadInto(Page page, ASearchItemDto dto)
        {
            SearchItem_Between searchItem = page.LoadControl(SearchItem_Between.VirtualUrl) as SearchItem_Between;
            searchItem.Dto = dto;

            ListItem[] temp = new ListItem[3];
            temp[0] = new ListItem(Track.Property.Bpm.ToString(), ((int)Track.Property.Bpm).ToString());
            temp[1] = new ListItem(Track.Property.Laenge.ToString(), ((int)Track.Property.Laenge).ToString());
            temp[2] = new ListItem(Track.Property.Year.ToString(), ((int)Track.Property.Year).ToString());
            searchItem.ddlSearchCategory.Items.AddRange(temp);
            searchItem.ddlSearchCategory.SelectedIndex =
                searchItem.ddlSearchCategory.Items.IndexOf(searchItem.ddlSearchCategory.Items.FindByValue(((int)dto.TrackProperty).ToString()));
            searchItem.tbSearchPhrase2.Text = dto.SearchPhrase[1];

            return searchItem;
        }
        /// <summary>
        /// Statische Methode ueberschreibt die identische Signatur der Baseklasse! Compiler schreit nach 'new'!
        /// Darum kriegt der das auch...
        /// </summary>
        /// <param name="page"></param>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static new ASearchItem loadInto(Page page, ASearchItemDto dto)
        {
            SearchItem_Like searchItem = page.LoadControl(SearchItem_Like.VirtualUrl) as SearchItem_Like;
            searchItem.Dto = dto;

            ListItem[] temp = new ListItem[7];
            temp[0] = new ListItem(Track.Property.Interpret.ToString(), ((int)Track.Property.Interpret).ToString());
            temp[1] = new ListItem(Track.Property.Titel.ToString(), ((int)Track.Property.Titel).ToString());
            temp[2] = new ListItem(Track.Property.Autor.ToString(), ((int)Track.Property.Autor).ToString());
            temp[3] = new ListItem(Track.Property.Code.ToString(), ((int)Track.Property.Code).ToString());
            temp[4] = new ListItem(Track.Property.Ending.ToString(), ((int)Track.Property.Ending).ToString());
            temp[5] = new ListItem(Track.Property.Label.ToString(), ((int)Track.Property.Label).ToString());
            temp[6] = new ListItem(Track.Property.Verlag.ToString(), ((int)Track.Property.Verlag).ToString());
            searchItem.ddlSearchCategory.Items.AddRange(temp);
            searchItem.ddlSearchCategory.SelectedIndex =
                searchItem.ddlSearchCategory.Items.IndexOf(searchItem.ddlSearchCategory.Items.FindByValue(((int)dto.TrackProperty).ToString()));
            return searchItem;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Das schien mal eine gute Idee, customized controls in eine Page zu laden...
        /// </summary>
        /// <param name="page"></param>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static ASearchItem loadInto(Page page, ASearchItemDto dto)
        {
            ASearchItem searchItem;
            if(dto is SearchItem_Like_Dto)
                searchItem = SearchItem_Like.loadInto(page, dto);
            else
                searchItem = SearchItem_Between.loadInto(page, dto);

            ListItem[] temp = new ListItem[2];
            temp[0] = new ListItem("=", ((int)Relator.Unary.IS).ToString());
            temp[1] = new ListItem("&ne;", ((int)Relator.Unary.NOT).ToString());
            searchItem.UnaryRelator.Items.AddRange(temp);
            searchItem.UnaryRelator.SelectedIndex =
                searchItem.UnaryRelator.Items.IndexOf(searchItem.UnaryRelator.Items.FindByValue(((int)dto.UnaryRelator).ToString()));

            searchItem.SearchPhrase.Text = dto.SearchPhrase[0];

            return searchItem;
        }