Esempio n. 1
0
        public int GetUserIdByLogonId(string userLogin)
        {
            using (var db = new DBAMPContext())
            {
                ApiSelectUserIdByUserLogonIdReturnModel user;

                try
                {
                    user = db.ApiSelectUserIdByUserLogonId(userLogin).FirstOrDefault();

                    if (user != null)
                    {
                        return(user.UserID);
                    }
                    else
                    {
                        return(0);
                    }
                }
                catch (Exception ex)
                {
                    string sqlParam   = "ApiSelectUserIdByUserLogonId(" + userLogin + ")";
                    string methodName = "JCRAPI/Business/UserServices/GetUserIdByLogonId";
                    exceptionLog.ExceptionLogInsert(ex.Message.ToString(), "", methodName, null, null, sqlParam, string.Empty);

                    return(0);
                }
            }
        }