Exemplo n.º 1
0
    /// <summary>
    /// 判断用用户名是否存在
    /// </summary>
    /// <param name="loginName">登录名</param>
    /// <returns></returns>
    public static Operator GetOperatorByLoginName(string loginName)
    {
        Operator op = null;

        foreach (Operator item in operators)
        {
            if (item.LoginName == loginName)
            {
                op = item;
            }
        }
        if (op != null)
        {
            return(op);
        }
        else
        {
            op = null;
            op = Provider.GetOperatorByLoginName(loginName);
            if (op != null)
            {
                operators.Add(op);
                return(op);
            }
            else
            {
                return(null);
            }
        }
    }