public IList <EmployeeCategoryDTO> GetEmployeeCategoryDTO() { //DataTable dt = ADODatabase.GetDataTable("Get_All_Categorys", (int)ADODatabase.SqlType.StoredProcedure); DataTable dt = ADODatabase.GetDataTable("SELECT * FROM ListEmployeeCategory"); return(MakeEmployeeCategoryDTO(dt)); }
public EmployeeCategoryDTO GetEmployeeCategoryDTO(int employeeCategoryID) { SqlParameter[] sqlParameter = { new SqlParameter("@CategoryId", SqlDbType.Int) }; sqlParameter[0].Value = employeeCategoryID; //DataTable dataTable = ADODatabase.GetDataTable("SELECT * FROM ListEmployeeCategory WHERE EmployeeCategoryID = ?", sqlParameter); DataTable dataTable = ADODatabase.GetDataTable("SELECT * FROM ListEmployeeCategory WHERE EmployeeCategoryID = " + employeeCategoryID.ToString()); return(MakeEmployeeCategoryDTO(dataTable.Rows[0])); }
public static DataTable GetDataTable(string commandText, CommandType commandType) { SqlCommand sqlCommand = new SqlCommand(commandText, ADODatabase.Connection()); sqlCommand.CommandType = commandType; using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCommand)) { DataTable dataTable = new DataTable(); adapter.Fill(dataTable); return(dataTable); } }
public static bool CreateFunction(string functionName, string sqlQuery) { DataTable dataTable = ADODatabase.GetDataTable("SELECT name FROM sysobjects WHERE name = '" + functionName + "' AND (type = 'FN' OR type = 'TF') "); if (dataTable.Rows.Count > 0) { ADODatabase.ExecuteNonQuery("DROP FUNCTION " + functionName); } ADODatabase.ExecuteNonQuery("CREATE FUNCTION " + functionName + char.ConvertFromUtf32(13) + sqlQuery); return(true); }
public static DataTable GetDataTable(string query) { return(ADODatabase.GetDataTable(query, CommandType.Text)); }
public static int ExecuteTransaction(string commandText) { return(ADODatabase.ExecuteTransaction(commandText, CommandType.Text)); }
public static int ExecuteNonQuery(string commandText, string connectionString) { return(ADODatabase.ExecuteNonQuery(commandText, CommandType.Text, connectionString)); }
public static int ExecuteNonQuery(string commandText, CommandType commandType) { return(ADODatabase.ExecuteNonQuery(commandText, commandType, GlobalMsADO.ConnectionString())); }
//BELOW IS OK STATEMENT ---------------------------------------------- public static int ExecuteNonQuery(string commandText) { return(ADODatabase.ExecuteNonQuery(commandText, CommandType.Text)); }