internal static DateTime GetLastImportDate()
        {
            DateTime toReturn = new DateTime(1999, 1, 1);

            try
            {
                user      u  = new user();
                DataTable dt = u.Search("SELECT last_import_date FROM system_options WHERE id = 1");

                toReturn = System.Convert.ToDateTime(dt.Rows[0][0]);
            }
            catch { }

            return(toReturn);
        }
        /// <summary>
        /// Retrieves a user with information matching the current login info on the form. If no user
        /// is found, returns null.
        /// </summary>
        /// <returns></returns>
        private user ValidateLogin()
        {
            user      u       = new user();
            DataTable matches = u.Search("SELECT * FROM USERS WHERE username = '******' AND password = '******'");

            if (matches.Rows.Count > 0)
            {
                u.Load(matches.Rows[0]);
                return(u);
            }
            else
            {
                return(null);
            }
        }
        private static int GetIntColumn(string colToGet)
        {
            int       toReturn = -1;
            user      u        = new user();
            DataTable dt       = u.Search("SELECT " + colToGet + " FROM system_options");


            try
            {
                toReturn = Convert.ToInt32(dt.Rows[0][0]);
            }
            catch
            {
                // let it slide and just return -1
            }
            return(toReturn);
        }
Beispiel #4
0
        private static string GetStringColumn(string colToGet)
        {
            string    toReturn = "";
            user      u        = new user();
            DataTable dt       = u.Search("SELECT " + colToGet + " FROM system_options");


            try
            {
                toReturn = dt.Rows[0][0].ToString();
            }
            catch
            {
                // let it slide and return ""
            }
            return(toReturn);
        }