Exemplo n.º 1
0
    /// <summary>
    /// 获取一条Client类信息
    /// </summary>
    /// <param name="ClientID">登录编号</param>
    /// <returns>一条Client类记录</returns>
    public Client GetClient(string ClientID)
    {
        Client       client = new Client();
        string       strSQL = "SELECT Top 1 * FROM Sys_Client WHERE ClientID = '" + ClientID + "'";
        ClassInfoMgr cMgr   = new ClassInfoMgr();
        SpecMgr      sMgr   = new SpecMgr();

        DataTable dt = CMMgr.GetDataTable(strSQL);

        if (dt.Rows.Count > 0)
        {
            DataRow row = dt.Rows[0];
            client.ClientID   = row["ClientID"].ToString();
            client.ClientName = row["ClientName"].ToString();
            client.Password   = row["Password"].ToString();
            client.Sex        = row["Sex"].ToString();
            client.ClassInfo  = cMgr.GetClassInfo(row["ClassInfoID"].ToString());
            client.Spec       = sMgr.GetSpec(row["SpecID"].ToString());
            client.Tel        = row["Tel"].ToString();
            client.Mail       = row["Mail"].ToString();
            client.QQ         = row["QQ"].ToString();

            return(client);
        }
        else
        {
            return(client);
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 获取一条Person类信息
    /// </summary>
    /// <param name="PersonID">登录编号</param>
    /// <returns>一条Person类记录</returns>
    public Person GetPerson(string PersonID)
    {
        Person       person = new Person();
        string       strSQL = "SELECT Top 1 * FROM Sys_Person WHERE PersonID = '" + PersonID + "'";
        DataTable    dt     = CMMgr.GetDataTable(strSQL);
        ClassInfoMgr cMgr   = new ClassInfoMgr();
        SpecMgr      sMgr   = new SpecMgr();

        if (dt.Rows.Count > 0)
        {
            DataRow row = dt.Rows[0];
            person.PersonID   = row["PersonID"].ToString();
            person.PersonName = row["PersonName"].ToString();
            person.Password   = row["Password"].ToString();
            person.Sex        = row["Sex"].ToString();
            person.Birthday   = row["Birthday"].ToString();
            person.ClassInfo  = cMgr.GetClassInfo(row["ClassInfoID"].ToString());
            person.Spec       = sMgr.GetSpec(row["SpecID"].ToString());

            return(person);
        }
        else
        {
            return(person);
        }
    }
Exemplo n.º 3
0
    private void initList()
    {
        SpecMgr sMgr = new SpecMgr();

        this.lstSpecID.DataSource     = sMgr.GetSpecList();
        this.lstSpecID.DataTextField  = "SpecName";
        this.lstSpecID.DataValueField = "SpecID";
        this.lstSpecID.DataBind();
    }