Exemple #1
0
        public GuestUserInfo CreateTracersGuestUser(string userLogonId, string firstName, string lastName, int?siteId)
        {
            ApiCreateTracersGuestUserReturnModel rtnData;
            GuestUserInfo returnUser;
            int           roleId = (int)Enums.RoleType.GuestUser;

            using (var db = new DBAMPContext())
            {
                try
                {
                    rtnData = db.ApiCreateTracersGuestUser(userLogonId, firstName, lastName, siteId, roleId);

                    returnUser = ParseResultforNewGuestUser(rtnData);
                    if (returnUser.UserSiteInfo.SiteID > 0)
                    {
                        returnUser.UserSiteInfo.SiteName = GetSiteFullName(returnUser.UserSiteInfo.SiteID);
                    }
                }
                catch (Exception ex)
                {
                    string sqlParam   = "ApiCreateTracersGuestUser(" + userLogonId + "," + firstName + "," + lastName + "," + siteId + "," + roleId + ")";
                    string methodName = "JCRAPI/Business/GuestUserServices/CreateTracersGuestUser";
                    exceptionLog.ExceptionLogInsert(ex.Message.ToString(), "", methodName, null, siteId, sqlParam, string.Empty);

                    return(null);
                }
            }

            return(returnUser);
        }