/// <summary> /// 通过协同userid,systemkey=1来转化成 单点登入统一唯一标识; /// </summary> /// <param name="erp_userid">协同userid</param> /// <param name="systemkey">协同系统标识,暂为1</param> /// <returns>返回单点登录的唯一用户表示</returns> private static string getUserKey(string erp_userid, string systemkey) { object userKey; SqlConnection sqlConnection = (SqlConnection)DatabaseConn.Connection("wechat"); using (LiLanzDALForXLM dal = new LiLanzDALForXLM(sqlConnection.ConnectionString)) { sqlConnection.Close(); sqlConnection.Dispose(); string str_sql = @"select a.userid from wx_t_appauthorized a where a.systemid=@systemkey and a.systemkey=@userid"; List <SqlParameter> para = new List <SqlParameter>(); para.Add(new SqlParameter("@userid", erp_userid)); para.Add(new SqlParameter("@systemkey", systemkey)); if (dal.ExecuteQueryFastSecurity(str_sql, para, out userKey) == "") { return(userKey.ToString()); } else { return(""); } } }