Exemplo n.º 1
0
 public static DateTime GetServerDateTime(this System.Data.Linq.DataContext dc)
 {
     Njit.Sql.ServerHelper serverHelper;
     if ((dc.Connection.State & ConnectionState.Open) == ConnectionState.Open && dc.Transaction != null)
     {
         serverHelper = new Njit.Sql.ServerHelper(dc.Connection, dc.Transaction);
     }
     else
     {
         serverHelper = new Njit.Sql.ServerHelper(dc.Connection.ConnectionString);
     }
     return(serverHelper.GetServerDateTime());
 }
Exemplo n.º 2
0
 public static string GetServerTime(this System.Data.Linq.DataContext dc)
 {
     Njit.Sql.ServerHelper serverHelper;
     if ((dc.Connection.State & ConnectionState.Open) == ConnectionState.Open && dc.Transaction != null)
     {
         serverHelper = new Njit.Sql.ServerHelper(dc.Connection, dc.Transaction);
     }
     else
     {
         serverHelper = new Njit.Sql.ServerHelper(dc.Connection.ConnectionString);
     }
     return(Njit.Common.PersianCalendar.GetTime(serverHelper.GetServerDateTime(), ":", true));
 }
Exemplo n.º 3
0
 public static DateTime GetServerDateTime(this IDbConnection connection)
 {
     Njit.Sql.ServerHelper serverHelper = new Njit.Sql.ServerHelper(connection.ConnectionString);
     return(serverHelper.GetServerDateTime());
 }
Exemplo n.º 4
0
 public static string GetServerTime(this IDbConnection connection)
 {
     Njit.Sql.ServerHelper serverHelper = new Njit.Sql.ServerHelper(connection.ConnectionString);
     return(Njit.Common.PersianCalendar.GetTime(serverHelper.GetServerDateTime(), ":", true));
 }
Exemplo n.º 5
0
 public static string GetServerIpAddress(this IDbConnection connection)
 {
     Njit.Sql.ServerHelper serverHelper = new Njit.Sql.ServerHelper(connection.ConnectionString);
     return(serverHelper.GetServerIpAddress());
 }
Exemplo n.º 6
0
 public static bool ServerIsLocal(this IDbConnection connection)
 {
     Njit.Sql.ServerHelper serverHelper = new Njit.Sql.ServerHelper(connection.ConnectionString);
     return(serverHelper.ServerIsLocal());
 }