Exemplo n.º 1
0
        public bool IsUserRegistered(int userID)
        {
            var isUserRegistered = false;

            using (var db = new DBAMPContext())
            {
                try
                {
                    List <ApiSiteSelectByUserIdReturnModel> rtnData;
                    rtnData = db.ApiSiteSelectByUserId(userID);
                    if (rtnData.Count > 0)
                    {
                        List <ApiSiteSelectByUserIdReturnModel> rtnfiltered = rtnData.Where(x => x.RoleID != 7).ToList();
                        if (rtnfiltered.Count > 0)
                        {
                            isUserRegistered = true;
                        }
                    }
                }
                catch (Exception ex)
                {
                    string sqlParam   = "ApiSiteSelectByUserId(" + userID + ")";
                    string methodName = "JCRAPI/Business/GuestUserServices/IsUserRegistered";
                    exceptionLog.ExceptionLogInsert(ex.Message.ToString(), "", methodName, userID, null, sqlParam, string.Empty);

                    return(false);
                }
            }
            return(isUserRegistered);
        }