コード例 #1
0
        /// <summary>
        /// 判断浏览状态
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public static string GetVisitSessionStatusText(VisitSessionStatus s)
        {
            string status;

            switch (s)
            {
            case VisitSessionStatus.Visiting:
                status = "浏览中";
                break;

            case VisitSessionStatus.ChatRequesting:
                status = "请求对话中";
                break;

            case VisitSessionStatus.Chatting:
                status = "对话中";
                break;

            case VisitSessionStatus.Leave:
                status = "离开";
                break;

            default:
                status = "离开";
                break;
            }
            return(status);
        }
コード例 #2
0
    /// <summary>
    /// 更改VisitSession的状态
    /// </summary>
    /// <param name="sessionId"></param>
    /// <param name="visitSessionStatus"></param>
    public static void SetSessionStatus(string sessionId, VisitSessionStatus visitSessionStatus)
    {
        VisitSession s = GetSessionById(sessionId);

        if (s == null)
        {
            throw new BLLInternalException("VisitSession not found: SessionId=" + sessionId);
        }
        s.Status = visitSessionStatus;
    }
コード例 #3
0
ファイル: TestFixture.cs プロジェクト: honj51/ideacode
        private VisitSessionStatus getNextVisitSessionStatus(VisitSessionStatus visitSessionStatus)
        {
            switch (visitSessionStatus)
            {
                case VisitSessionStatus.Visiting:
                    return VisitSessionStatus.ChatRequesting;
                case VisitSessionStatus.ChatRequesting:
                    return VisitSessionStatus.Chatting;
                case VisitSessionStatus.Chatting:
                    return VisitSessionStatus.Leave;
                case VisitSessionStatus.Leave:
                    return VisitSessionStatus.Visiting;

                default:
                    return VisitSessionStatus.Visiting;
            }
        }
コード例 #4
0
ファイル: VisitSession.cs プロジェクト: honj51/ideacode
 public VisitSession(SqlDataReader data)
 {
     if (!Convert.IsDBNull(data["SessionId"])) this.sessionId = (string)data["SessionId"];
     if (!Convert.IsDBNull(data["VisitorId"])) visitorId = (string)data["VisitorId"];
     if (!Convert.IsDBNull(data["IP"])) iP = (string)data["IP"];
     if (!Convert.IsDBNull(data["Browser"])) browser = (string)data["Browser"];
     if (!Convert.IsDBNull(data["Status"])) status = (VisitSessionStatus)Enum.Parse(typeof(VisitSessionStatus), (string)data["Status"]);
     if (!Convert.IsDBNull(data["Location"])) location = (string)data["Location"];
     if (!Convert.IsDBNull(data["Operator"])) operators = (int)data["Operator"];
     if (!Convert.IsDBNull(data["VisitingTime"])) visitingTime = (DateTime)data["VisitingTime"];
     if (!Convert.IsDBNull(data["LeaveTime"])) leaveTime = (DateTime)data["LeaveTime"];
     if (!Convert.IsDBNull(data["RequestTime"])) chatRequestTime = (DateTime)data["RequestTime"];
     if (!Convert.IsDBNull(data["ChatingTime"])) chatingTime = (DateTime)data["ChatingTime"];
     if (!Convert.IsDBNull(data["WaitingDuring"])) waitingDuring = (DateTime)data["WaitingDuring"];
     if (!Convert.IsDBNull(data["ChattingDuring"])) chattingDuring = (DateTime)data["ChattingDuring"];
     if (!Convert.IsDBNull(data["PageRequestCount"])) PageRequestCount = (int)data["PageRequestCount"];
     if (!Convert.IsDBNull(data["DomainRequested"])) this.domainRequested = (string)data["DomainRequested"];
     if (!Convert.IsDBNull(data["PageRequested"])) this.pageRequested = (string)data["PageRequested"];
     if (!Convert.IsDBNull(data["Referrer"])) this.referrer = (string)data["Referrer"];
 }
コード例 #5
0
ファイル: TestFixture.cs プロジェクト: uwitec/ideacode
        private VisitSessionStatus getNextVisitSessionStatus(VisitSessionStatus visitSessionStatus)
        {
            switch (visitSessionStatus)
            {
            case VisitSessionStatus.Visiting:
                return(VisitSessionStatus.ChatRequesting);

            case VisitSessionStatus.ChatRequesting:
                return(VisitSessionStatus.Chatting);

            case VisitSessionStatus.Chatting:
                return(VisitSessionStatus.Leave);

            case VisitSessionStatus.Leave:
                return(VisitSessionStatus.Visiting);

            default:
                return(VisitSessionStatus.Visiting);
            }
        }
コード例 #6
0
 /// <summary>
 /// 更改VisitSession的状态
 /// </summary>
 /// <param name="sessionId"></param>
 /// <param name="visitSessionStatus"></param>
 public static void SetSessionStatus(string sessionId, VisitSessionStatus visitSessionStatus)
 {
     VisitSession s = GetSessionById(sessionId);
     if (s == null)
     {
         throw new BLLInternalException("VisitSession not found: SessionId=" + sessionId);
     }
     s.Status = visitSessionStatus;
 }
コード例 #7
0
 public VisitSession(SqlDataReader data)
 {
     if (!Convert.IsDBNull(data["SessionId"]))
     {
         this.sessionId = (string)data["SessionId"];
     }
     if (!Convert.IsDBNull(data["VisitorId"]))
     {
         visitorId = (string)data["VisitorId"];
     }
     if (!Convert.IsDBNull(data["IP"]))
     {
         iP = (string)data["IP"];
     }
     if (!Convert.IsDBNull(data["Browser"]))
     {
         browser = (string)data["Browser"];
     }
     if (!Convert.IsDBNull(data["Status"]))
     {
         status = (VisitSessionStatus)Enum.Parse(typeof(VisitSessionStatus), (string)data["Status"]);
     }
     if (!Convert.IsDBNull(data["Location"]))
     {
         location = (string)data["Location"];
     }
     if (!Convert.IsDBNull(data["Operator"]))
     {
         operators = (int)data["Operator"];
     }
     if (!Convert.IsDBNull(data["VisitingTime"]))
     {
         visitingTime = (DateTime)data["VisitingTime"];
     }
     if (!Convert.IsDBNull(data["LeaveTime"]))
     {
         leaveTime = (DateTime)data["LeaveTime"];
     }
     if (!Convert.IsDBNull(data["RequestTime"]))
     {
         chatRequestTime = (DateTime)data["RequestTime"];
     }
     if (!Convert.IsDBNull(data["ChatingTime"]))
     {
         chatingTime = (DateTime)data["ChatingTime"];
     }
     if (!Convert.IsDBNull(data["WaitingDuring"]))
     {
         waitingDuring = (DateTime)data["WaitingDuring"];
     }
     if (!Convert.IsDBNull(data["ChattingDuring"]))
     {
         chattingDuring = (DateTime)data["ChattingDuring"];
     }
     if (!Convert.IsDBNull(data["PageRequestCount"]))
     {
         PageRequestCount = (int)data["PageRequestCount"];
     }
     if (!Convert.IsDBNull(data["DomainRequested"]))
     {
         this.domainRequested = (string)data["DomainRequested"];
     }
     if (!Convert.IsDBNull(data["PageRequested"]))
     {
         this.pageRequested = (string)data["PageRequested"];
     }
     if (!Convert.IsDBNull(data["Referrer"]))
     {
         this.referrer = (string)data["Referrer"];
     }
 }
コード例 #8
0
ファイル: Common.cs プロジェクト: honj51/ideacode
 /// <summary>
 /// 判断浏览状态
 /// </summary>
 /// <param name="s"></param>
 /// <returns></returns>
 public static string GetVisitSessionStatusText(VisitSessionStatus s)
 {
     string status;
     switch (s)
     {
         case VisitSessionStatus.Visiting:
             status = "浏览中";
             break;
         case VisitSessionStatus.ChatRequesting:
             status = "请求对话中";
             break;
         case VisitSessionStatus.Chatting:
             status = "对话中";
             break;
         case VisitSessionStatus.Leave:
             status = "离开";
             break;
         default:
             status = "离开";
             break;
     }
     return status;
 }