コード例 #1
0
        public static void Remove_ActiveSession(string userName)
        {
            using (SessionsDataDataContext dc = new SessionsDataDataContext(SessionMannager.SessionsConnectionString))
            {
                ActiveSession a = dc.ActiveSessions.Where(s => s.UserName.Equals(userName)).FirstOrDefault <ActiveSession>();
                if (a != null)
                {
                    SessionHistory wSessionHistory = new SessionHistory();

                    wSessionHistory.UserName   = a.UserName;
                    wSessionHistory.SessionID  = a.SessionID;
                    wSessionHistory.StatusDate = a.LoggedInDate;
                    wSessionHistory.Status     = "Log_In";

                    dc.SessionHistories.InsertOnSubmit(wSessionHistory);


                    wSessionHistory = new SessionHistory();

                    wSessionHistory.UserName   = a.UserName;
                    wSessionHistory.SessionID  = a.SessionID;
                    wSessionHistory.StatusDate = DateTime.Now;
                    wSessionHistory.Status     = "Log_Out";

                    dc.SessionHistories.InsertOnSubmit(wSessionHistory);

                    dc.ActiveSessions.DeleteOnSubmit(a);

                    dc.SubmitChanges();
                }
            }
        }
コード例 #2
0
 public  static void Reg_ActiveSession(string sessionId, string userName)
  {
      using (SessionsDataDataContext dc = new SessionsDataDataContext(SessionMannager.SessionsConnectionString))
      {
          ActiveSession a = new ActiveSession();
          a.UserName = userName;
          a.SessionID = sessionId;
          a.LoggedInDate = DateTime.Now;
          dc.ActiveSessions.InsertOnSubmit(a);
          dc.SubmitChanges();
      }
  }
コード例 #3
0
 public static void Reg_ActiveSession(string sessionId, string userName)
 {
     using (SessionsDataDataContext dc = new SessionsDataDataContext(SessionMannager.SessionsConnectionString))
     {
         ActiveSession a = new ActiveSession();
         a.UserName     = userName;
         a.SessionID    = sessionId;
         a.LoggedInDate = DateTime.Now;
         dc.ActiveSessions.InsertOnSubmit(a);
         dc.SubmitChanges();
     }
 }
コード例 #4
0
 partial void DeleteActiveSession(ActiveSession instance);
コード例 #5
0
 partial void UpdateActiveSession(ActiveSession instance);
コード例 #6
0
 partial void InsertActiveSession(ActiveSession instance);
コード例 #7
0
 partial void DeleteActiveSession(ActiveSession instance);
コード例 #8
0
 partial void UpdateActiveSession(ActiveSession instance);
コード例 #9
0
 partial void InsertActiveSession(ActiveSession instance);