private void btnFinish_Click(object sender, EventArgs e) { try { if (!receiptBLL.isreceiptdetailnull()) { MessageBox.Show("Details must not null!", "ERROR"); } else { receiptBLL.finishreceipt(float.Parse(txtTotal.Text)); this.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "ERROR"); } }