コード例 #1
0
        /// <summary>
        /// Logon to zfit via a call to FanServiceConsumer, save the connected Fan and FanToken to HttpSessionState.
        /// </summary>
        /// <param name="aHttpSessionState">An HttpSessionState from the calling page.</param>
        /// <param name="aFan">A zfit.Fan.</param>
        public static void Logon(HttpSessionState aHttpSessionState, Fan aFan)
        {
            //
            // Create a FanToken, populate with logon and Settings values
            //
            FanToken vFanToken = new FanToken()
            {
                FanID    = aFan.FanUserID,
                Password = aFan.FanPassword,
                Url      = "http://localhost/zfitsoap/zfitService.asmx"
            };

            //
            // Get a Fan by ID
            //
            FanServiceConsumer.GetFanByID(vFanToken, aFan);
            // Fully populate the FanToken and save it to Session
            vFanToken.Context = ConnectionContext.Browse;
            vFanToken.Version = "web";
            aHttpSessionState[sessionFanToken] = vFanToken;
            //
            // Save the Fan to the Session
            //
            aHttpSessionState[sessionFan] = aFan;
        }