Ejemplo n.º 1
0
    public static Customer GetCustomerByUserPwd(string pwd)//根据密码查找用户
    {
        List <Customer> list = CustomerFactory.GetCustomersList();
        Customer        r    = new Customer();

        foreach (var p in list)
        {
            if (p.UserPwd.Equals(pwd))
            {
                return(p);
            }
        }
        return(r);
    }
Ejemplo n.º 2
0
    public static Customer GetCustomerByName(string name)//根据用户名查找用户
    {
        List <Customer> list = CustomerFactory.GetCustomersList();
        Customer        r    = new Customer();

        foreach (var p in list)
        {
            if (p.UserName.Equals(name))
            {
                return(p);
            }
        }
        return(r);
    }