private void CreateShipmentButton_Click(object sender, EventArgs e) { try { SqlShipmentRepository shipments = new SqlShipmentRepository(connectionString); Shipment createShipment = shipments.CreateShipment(Convert.ToDateTime(ShipmentDateTextbox.Text), ShipmentAddressTextbox.Text); list.Add(createShipment); ShipmentsData sd = new ShipmentsData(); sd.dataGridView1.DataSource = list; } catch (Exception ex) { MessageBox.Show("There cannot be any empty or incorrectly entered parameters. Check submission."); } }
private void ShipmentsButton_Click(object sender, EventArgs e) { ShipmentsData ed = new ShipmentsData(); ed.ShowDialog(); }