本文整理匯總了C#中gov.va.medora.mdo.dao.AbstractConnection.authorizedConnect方法的典型用法代碼示例。如果您正苦於以下問題:C# AbstractConnection.authorizedConnect方法的具體用法?C# AbstractConnection.authorizedConnect怎麽用?C# AbstractConnection.authorizedConnect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gov.va.medora.mdo.dao.AbstractConnection
的用法示例。
在下文中一共展示了AbstractConnection.authorizedConnect方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: doTheVisit
// This is the core visit method the others are using. The permission must have been set before
// getting here.
internal User doTheVisit(string sitecode, AbstractCredentials credentials, AbstractPermission permission)
{
Site site = mySession.SiteTable.getSite(sitecode);
DataSource src = site.getDataSourceByModality("HIS");
if (src == null)
{
throw new Exception("No HIS data source at site " + sitecode);
}
AbstractDaoFactory factory = AbstractDaoFactory.getDaoFactory(AbstractDaoFactory.getConstant(src.Protocol));
myCxn = factory.getConnection(src);
myCxn.Account.AuthenticationMethod = mySession.DefaultVisitMethod;
if (!MdwsUtils.isValidCredentials(myCxn.Account.AuthenticationMethod, credentials, permission))
{
throw new Exception("Invalid credentials");
}
object result = null;
if (myCxn.Account.AuthenticationMethod == VistaConstants.BSE_CREDENTIALS_V2WEB)
{
result = myCxn.authorizedConnect(credentials, permission,
new DataSource() { ConnectionString = mySession.MdwsConfiguration.BseValidatorConnectionString });
}
else
{
result = myCxn.authorizedConnect(credentials, permission, null);
}
if (result.GetType().Name.EndsWith("Exception"))
{
throw (Exception)result;
}
else
{
return (User)result;
}
}