Esempio n. 1
0
        public static WebChatSession GetOne(long webChatSessionNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <WebChatSession>(MethodBase.GetCurrentMethod(), webChatSessionNum));
            }
            WebChatSession session = null;

            WebChatMisc.DbAction(delegate() {
                session = Crud.WebChatSessionCrud.SelectOne(webChatSessionNum);
            });
            return(session);
        }
Esempio n. 2
0
 ///<summary>Also sets primary key and DateTcreated.</summary>
 public static long Insert(WebChatSession webChatSession)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         webChatSession.WebChatSessionNum = Meth.GetLong(MethodBase.GetCurrentMethod(), webChatSession);
         return(webChatSession.WebChatSessionNum);
     }
     WebChatMisc.DbAction(delegate() {
         Crud.WebChatSessionCrud.Insert(webChatSession);
     });
     WebChatMisc.DbAction(delegate() {
         Signalods.SetInvalid(InvalidType.WebChatSessions);                //Signal OD HQ to refresh sessions.
     }, false);
     return(webChatSession.WebChatSessionNum);
 }
Esempio n. 3
0
        public static WebChatSession GetActiveSessionsForEmployee(string techName)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <WebChatSession>(MethodBase.GetCurrentMethod(), techName));
            }
            WebChatSession webChatSession = null;

            WebChatMisc.DbAction(() => {
                string command = "SELECT * FROM webchatsession WHERE DateTend < " + POut.DateT(new DateTime(1880, 1, 1))
                                 + " AND webchatsession.TechName = '" + POut.String(techName) + "'"
                                 + " ORDER BY webchatsession.DateTcreated ";
                webChatSession = Crud.WebChatSessionCrud.SelectOne(command);
            });
            return(webChatSession);
        }
Esempio n. 4
0
 public static void Update(WebChatSession webChatSession, WebChatSession oldWebChatSession, bool hasSignal = true)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), webChatSession, oldWebChatSession, hasSignal);
         return;
     }
     WebChatMisc.DbAction(delegate() {
         Crud.WebChatSessionCrud.Update(webChatSession, oldWebChatSession);
     });
     if (hasSignal)
     {
         WebChatMisc.DbAction(delegate() {
             Signalods.SetInvalid(InvalidType.WebChatSessions);                    //Signal OD HQ to refresh sessions.
         }, false);
     }
 }