private void button3_Click(object sender, EventArgs e) { try { if (commonFunctions.ToInt(cmb_pumperForcashcol.SelectedValue.ToString()) >= 0) { if (MessageBox.Show("Do you want to Save this record?", Messaging.MessageCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { CustomeRepository.InsertTotalCashCollection( commonFunctions.ToInt(cmb_pumperForcashcol.SelectedValue.ToString()), commonFunctions.ToInt(cmb_pumperForcashcol.SelectedValue.ToString()), commonFunctions.ToDecimal(lbl_currentCashTot.Text.Trim()), num_cardtotal.Value, num_VoucherTotal.Value, num_expensetotal.Value ); MessageBox.Show("Successfully Saved the record", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBox.Show("Error inserting the record..", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); } }