using System;
using System.Data;
using System.Configuration;
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;

/// <summary>
/// ColSelect 的摘要说明
/// </summary>
public class ColSelect
{
	    private DataSet1 ds = new DataSet1();
    private DataSet1.HomeCountDataTable dt = new DataSet1.HomeCountDataTable();
    private DataSet1TableAdapters.HomeCountTableAdapter da = new DataSet1TableAdapters.HomeCountTableAdapter();

    public ColSelect()
    {
        //
        // TODO: 在此处添加构造函数逻辑
        //
    }
    public int ForSelect(string id)
    {
        this.da.Fill(this.dt);
        string Id = id;
        int college=0;
        for (int i = 0; i < this.dt.Rows.Count; i++)
        {           
            string s = (string)dt.Rows[i]["bloger_name"];
            if (IsPerfec(Id, s))
            {
                int temp = 0;

                temp = int.Parse(this.dt.Rows[i]["college_id"].ToString());
                college = temp;
            }
            else
            {
 
            }

        }
        return college;
    }

    public bool IsPerfec(string s1, string s2)
    {
        string ob1 = s1;
        string ob2 = s2;
        if (ob1.Length == ob2.Length)
        {
            for (int i = 0; i < ob1.Length; i++)
            {
                if (ob1[i] != ob2[i])
                {
                    return false;
                   
                }
            }
        }
        else
        {
            return false;
        }
        
        return true;
    }
}
