public static DataSet RunDataSet(String sql, params Object[] parameters) { if (UnitTestDetector.IsInUnitTest) { SqlCommand cmd = TestConnection.CreateCommand(); cmd.CommandText = sql; cmd.Transaction = TestTransaction; return(ExecuteDataSet(cmd, parameters)); } DataSupport ds = new DataSupport(); return(ds.ExecuteDataSet(sql, parameters)); }
public static Boolean IsCorrectUsernameAndPassword(String username, String password) { Boolean result = true; try { username = username.EscapeString(); password = password.EscapeString(); String sql = String.Format("SELECT employee_id FROM Employees WHERE employee_id = '{0}' AND password = '******' ", username, SecuritySupport.GetSHA1Digest(password)); DataTable dt = DataSupport.RunDataSet(sql).Tables[0]; if (dt.Rows.Count == 0) { throw new Exception(); } } catch (Exception) { result = false; } return(result); }
public static Object RunScalar(String sql, Dictionary <String, Object> parameters) { DataSupport ds = new DataSupport(); return(ds.ExecuteScalar(sql, parameters)); }
public static Object RunScalar(String sql, params Object[] parameters) { DataSupport ds = new DataSupport(); return(ds.ExecuteScalar(sql, Utils.ToDict(parameters))); }
public static Object RunScalar(String sql) { DataSupport ds = new DataSupport(); return(ds.ExecuteScalar(sql)); }
public static DataSet RunDataSet(String sql, Dictionary <String, Object> parameters) { DataSupport ds = new DataSupport(); return(ds.ExecuteDataSet(sql, parameters)); }
public static int RunNonQuery(String sql, IsolationLevel level, Dictionary <String, Object> parameters) { DataSupport ds = new DataSupport(); return(ds.ExecuteNonQuery(sql, level, parameters)); }
public static int RunNonQuery(String sql, params Object[] parameters) { DataSupport ds = new DataSupport(); return(ds.ExecuteNonQuery(sql, parameters)); }
/// <summary> /// Runs a SQL from you database whatever /// </summary> /// <param name="sql">adsfasdf</param> /// <returns></returns> public static int RunNonQuery(String sql) { DataSupport ds = new DataSupport(); return(ds.ExecuteNonQuery(sql)); }