using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ctrls_links : System.Web.UI.UserControl
{
	private int _top = 10;
	public int Top
	{
		get{ return _top; }
		set{ _top = value;}
	}

	private int _repeat;
	public int Repeat
	{
		get{ return _repeat; }
		set{ 
			_repeat = value;

			this.data_links_type_1.RepeatColumns = _repeat;
			this.data_links_type_2.RepeatColumns = _repeat;
		}
	}

	private int _titleLength;
	public int TitleLength
	{
		get{ return _titleLength; }
		set{ _titleLength = value;}
	}

	private int _type = 1;
	public int Type
	{
		get{ return _type; }
		set{ _type = value;}
	}

	private int width = 88;
	public int Width
	{
		get{ return width; }
		set{ width = value;}
	}

	private int height = 31;
	public int Height
	{
		get{ return height; }
		set{ height = value;}
	}

    protected void Page_Load(object sender, EventArgs e)
    {
		
        Ycbw.Data.OleDbClient R = new Ycbw.Data.OleDbClient();
		
		switch( _type )
		{
			default:
			case 1:
		        R.BindList( "Select top "+ _top +" * from [b_links] where l_logo = '' order by id desc", "data_links", data_links_type_1 );   
				break;

			case 2:
		        R.BindList( "Select top "+ _top +" * from [b_links] where l_logo <> '' order by id desc", "data_links", data_links_type_2 );   
				break;
		} 
		
		R.Dispose();
	}
}
