using System;
using System.Data;
using System.Data.SqlClient;

namespace LJLib.DAL.SQL
{
    internal sealed class SqlServerEngine : SqlEngine<SqlCommand>
    {
        protected override DateTime GetServerTimeInternal(SqlCommand cmd)
        {
            cmd.CommandText = "SELECT GETDATE()";
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Clear();
            return Convert.ToDateTime(cmd.ExecuteScalar());
        }

        protected override void AddWithValueInternal(SqlCommand cmd, string name, object value)
        {
            cmd.Parameters.AddWithValue(name, value);
        }
    }
}
