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); }
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); }