예제 #1
0
        public static DateTime GetDateNow()
        {
            DateTime result;

            try
            {
                DataTable dataTable = ManageBase.ExcuteSelect("Select getdate()");
                string    s         = dataTable.Rows[0][0].ToString();
                result = DateTime.Parse(s);
            }
            catch (Exception)
            {
                result = DateTime.Now;
            }
            return(result);
        }
예제 #2
0
        public static long GetRootId()
        {
            long result = 0L;

            try
            {
                DataTable dataTable = ManageBase.ExcuteSelect("SELECT NEXT VALUE FOR dbo.GetRootId as number");
                bool      flag      = dataTable != null && dataTable.Rows.Count > 0;
                if (flag)
                {
                    result = (long)dataTable.Rows[0]["number"];
                }
            }
            catch (Exception ex)
            {
            }
            return(result);
        }