private void button2_Click(object sender, EventArgs e) { try { if (cmb_days.SelectedValue == null) { MessageBox.Show("Please select a day to continue", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (MessageBox.Show("Do you want to End this Day?. " + Environment.NewLine + "Bfore you continue please check all the pumpers details are properly entered to system" + Environment.NewLine + "And All the Nozzels are Close Properly." , Messaging.MessageCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { int x = CustomeRepository.ClosePump(commonFunctions.ToInt(cmb_days.SelectedValue.ToString())); if (x > 0) { MessageBox.Show("Successfully End the day", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBox.Show("Error Has found in program. Please forword following details to technical" + Environment.NewLine + "[" + ex.Message + Environment.NewLine + ex.Source + "]", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); } }