Esempio n. 1
0
        public override int IsOnLine(string szUserGuid, string szRoleName, string szIpAddress, string szUrl, string szSessionID, bool IsLogined, bool IsWebAccess, bool IsHijackLogin, bool IsSelfService)
        {
            string Cmd = "";

            int    rt        = 0;
            RisDAL oKodakDAL = new RisDAL();

            try
            {
                if (IsWebAccess == false)
                {
                    oKodakDAL.Parameters.Clear();
                    oKodakDAL.Parameters.AddChar("UserID", szUserGuid);
                    oKodakDAL.Parameters.AddChar("UserRoleName", szRoleName);
                    oKodakDAL.Parameters.AddChar("Url", szUrl);
                    oKodakDAL.Parameters.AddChar("IpAddress", szIpAddress);
                    oKodakDAL.Parameters.AddChar("Session", szSessionID);
                    oKodakDAL.Parameters.AddInt("IsLogined", IsLogined == true ? 1 : 0);
                    oKodakDAL.Parameters.Add("ReturnValue", DbType.Int32);
                    oKodakDAL.Parameters["UserID"].Direction       = ParameterDirection.Input;
                    oKodakDAL.Parameters["UserRoleName"].Direction = ParameterDirection.Input;
                    oKodakDAL.Parameters["Url"].Direction          = ParameterDirection.Input;
                    oKodakDAL.Parameters["IpAddress"].Direction    = ParameterDirection.Input;
                    oKodakDAL.Parameters["Session"].Direction      = ParameterDirection.Input;
                    oKodakDAL.Parameters["IsLogined"].Direction    = ParameterDirection.Input;
                    oKodakDAL.Parameters["ReturnValue"].Direction  = ParameterDirection.Output;
                    oKodakDAL.ExecuteNonQuerySP("checkonline");
                    rt = Convert.ToInt32(oKodakDAL.Parameters["ReturnValue"].Value);
                    //rt = Convert.ToInt32(oKodakDAL.ExecuteScalarSP("checkonline"));
                }
                else
                {
                    oKodakDAL.Parameters.Clear();
                    oKodakDAL.Parameters.AddChar("UserID", szUserGuid);
                    oKodakDAL.Parameters.AddChar("UserRoleName", szRoleName);
                    oKodakDAL.Parameters.AddChar("Url", szUrl);
                    oKodakDAL.Parameters.AddChar("IpAddress", szIpAddress);
                    oKodakDAL.Parameters.AddChar("Session", szSessionID);
                    oKodakDAL.Parameters.Add("ReturnValue", DbType.Int32);
                    oKodakDAL.Parameters["UserID"].Direction       = ParameterDirection.Input;
                    oKodakDAL.Parameters["UserRoleName"].Direction = ParameterDirection.Input;
                    oKodakDAL.Parameters["Url"].Direction          = ParameterDirection.Input;
                    oKodakDAL.Parameters["IpAddress"].Direction    = ParameterDirection.Input;
                    oKodakDAL.Parameters["Session"].Direction      = ParameterDirection.Input;
                    oKodakDAL.Parameters["ReturnValue"].Direction  = ParameterDirection.Output;
                    oKodakDAL.ExecuteNonQuerySP("CHECKWEBONLINE");
                    rt = Convert.ToInt32(oKodakDAL.Parameters["ReturnValue"].Value);
                }
            }
            catch (Exception Ex)
            {
                logger.Error((long)ModuleEnum.Framework_Client, ModuleInstanceName.Framework, 1, Ex.Message,
                             string.Empty, (new System.Diagnostics.StackFrame(true)).GetFileName(),
                             (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
            }
            finally
            {
                if (oKodakDAL != null)
                {
                    oKodakDAL.Dispose();
                }
            }
            return(rt);
        }