/// <summary> /// Process employees. Some come, some go. /// </summary> /// <param name="connection">DB Connection</param> private Boolean ProcessEmployees(SqlConnection connection, Random r, TextBox txtResults, String description, int amount) { txtResults.AppendText(Environment.NewLine + description); SqlDataReader reader = null; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Select * from vStoresNotClosedForever"; cmd.CommandType = CommandType.Text; cmd.Connection = connection; int storeID; // Add a random employee for each store that is not closed forever try { reader = cmd.ExecuteReader(); while (reader.Read()) { storeID = Convert.ToInt32(reader.GetValue(0)); Empl.AddRandomEmpl(storeID, r, connection); } reader.Close(); Empl.RandomizeWorkStatusForAllEmployees(connection, r, Write); } catch (Exception ex) { Console.WriteLine("AddTransactions.ProcessEmployees(): " + ex.Message); } finally { try { reader.Close(); } catch (Exception ex) { Utils.Log(ex.Message); } } return(true); }