Ejemplo n.º 1
0
        private int GetCompanyCodeID(Guid userID)
        {
            if (UserInfo != null)
            {
                if (UserInfo.UserKey == userID)
                {
                    return(UserInfo.CurrentFranchise.FranchiseID);
                }
            }

            var context800   = new EightHundredEntities();
            var useridstring = userID.ToString();

            if (context800.tbl_Employee.Any(item => item.UserKey == useridstring))
            {
                var usert = userID.ToString();
                return(context800.tbl_Employee.First(item => item.UserKey == usert).FranchiseID);
            }

            var context = new MembershipEntities();

            return(context.UserFranchise.Any(item => item.UserId == userID)
                       ? context.UserFranchise.First(item => item.UserId == userID).FranchiseID
                       : 51);

            //return 51;
        }
        public string GetCallTalkerNameByUserId(Guid UserId)
        {
            try
            {
                try
                {
                    var context1 = new MembershipEntities();

                    return(context1.aspnet_Users.First(q => q.UserId == UserId).UserName);
                }
                catch (Exception)
                {
                    return("N/A");
                }
            }
            catch (Exception)
            {
                return("N/A");
            }
        }
        public string GetCallTalkerName(string phone)
        {
            try
            {
                var context = new IncomingCallsQAEntities();

                var uid = context.StatisticTracks.First(q => q.CalledNumber == phone).UserId;

                try
                {
                    var context1 = new MembershipEntities();

                    return(context1.aspnet_Users.First(q => q.UserId == uid).UserName);
                }
                catch (Exception)
                {
                    return("N/A");
                }
            }
            catch (Exception)
            {
                return("N/A");
            }
        }