Example #1
0
        private void GetStatusBarDetails()
        {
            Users user = new Users();

            STATUS_BAR_USER_NAME.Text       = "You are logged in as : " + SessionParameters.UserName;
            STATUS_BAR_LAST_LOGIN_DATE.Text = "Last login : " + user.GetLastLastLoginDate(SessionParameters.UserID);
            STATUS_BAR_CURRENT_DATE.Text    = DataFormat.DateToDisp(System.DateTime.Now.ToShortDateString());
        }
Example #2
0
        private void SetStatusBarDetails()
        {
            Users user = new Users();

            toolStripStatusLabel3.Text = "You are logged in as : " + SessionParameters.UserName;
            toolStripStatusLabel2.Text = "Last login : " + user.GetLastLastLoginDate(SessionParameters.UserID);
            toolStripStatusLabel1.Text = DataFormat.DateToDisp(System.DateTime.Now.ToShortDateString());
        }
        private void GetStatusBarDetails()
        {
            Users     user = new Users();
            DataTable dataTableUserProfile = user.GetUserProfile(SessionParameters.UserID);

            toolStripStatusLabelUserName.Text  = "Logged in as: " + DataFormat.GetString(dataTableUserProfile.Rows[0]["FirstName"]);
            toolStripStatusLabelLoginDate.Text = "Last login: " + user.GetLastLastLoginDate(SessionParameters.UserID);
            toolStripStatusLabelDate.Text      = DataFormat.DateToDisp(System.DateTime.Now.ToShortDateString());
        }
Example #4
0
        /// <summary>
        /// Gets last login date for the specified user id
        /// </summary>
        /// <param name="userID">User Id</param>
        /// <returns>Last login date as string.</returns>
        public string GetLastLastLoginDate(int userID)
        {
            string Query = "SELECT Last_Login_Date from User_Info WHERE User_Id=" + userID.ToString();
            string date  = string.Empty;

            if (_dbHelper.ExecuteScalar(Query) != null)
            {
                date = _dbHelper.ExecuteScalar(Query).ToString();

                if (date.Equals(string.Empty))
                {
                    return("N\\A");
                }
                else
                {
                    string[] strDate = date.Split(Convert.ToChar(" "));
                    return(DataFormat.DateToDisp(strDate[0]) + " " + strDate[1] + " " + strDate[2]);
                }
            }
            else
            {
                return("N\\A");
            }
        }