private void shpDelete_Click(object sender, EventArgs e) { if (this.shpIdTxt.Text == "" || this.shpProTxt.Text == "" || this.comboBox2.Text == "") { MessageBox.Show("Insert the data"); } else { int shipId = Convert.ToInt32(this.shpIdTxt.Text); ShipmentRepository sr = new ShipmentRepository(); if (sr.Delete(shipId)) { List <ShipmentR> iList = sr.GetAllShipment(); this.dataGrid3.DataSource = iList; this.shpIdTxt.Text = ""; this.shpProTxt.Text = ""; this.comboBox2.Text = ""; } else { MessageBox.Show("Can Not Delete Shipment", "Delete Error"); } } }