private void btnRun_Click(object sender, EventArgs e) { try { this.IsPaused = false; if (connectionMQ == null) { connectionMQ = RabbitMQCreator.CreateConnection(); } string queueLog = txtQueueLog.Text; string companyFixName = textBox1.Text; this.threadRun = new Thread(() => StartTrack(queueLog, companyFixName)); threadRun.Start(); this.button1.Visible = true; } catch (Exception ex) { MessageBox.Show(ex.Message); SetStateRun(); } }
private void button2_Click(object sender, EventArgs e) { try { IConnection conection = RabbitMQCreator.CreateConnection(); var model = conection.CreateModel(); if (this.gridControl1.DataSource != null) { DataTable tbl = this.gridControl1.DataSource as DataTable; foreach (DataRow row in tbl.Rows) { string queueName = row[0].ToString().Trim(); uint i = model.QueueDelete(queueName); } } conection.Close(); MessageBox.Show("Đã xóa"); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }