當前位置: 首頁>>代碼示例>>C#>>正文


C# AbstractConnection.authorizedConnect方法代碼示例

本文整理匯總了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;
            }
        }
開發者ID:OSEHRA,項目名稱:mdws,代碼行數:39,代碼來源:AccountLib.cs


注:本文中的gov.va.medora.mdo.dao.AbstractConnection.authorizedConnect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。