private void btnAdd_Click(object sender, EventArgs e) { try { itemBLL = new ItemBLL(); string iditem = txtIditem.Text; iditem = iditem.ToUpper().ToString(); if (!itemBLL.verifyitem(iditem)) { MessageBox.Show(this, "Wrong item ID", "ERROR!"); txtIditem.Focus(); txtIditem.SelectAll(); } else { if (!receiptBLL.verifyreceiptdetail(iditem)) { MessageBox.Show(this, "This item is already exists!", "ERROR!"); txtIditem.Focus(); txtIditem.SelectAll(); } else { lbMaxquantity.Text = "/ " + itemBLL.getmaxquantity().ToString(); txtQuantity.Maximum = itemBLL.getmaxquantity(); enablequantity(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "ERROR"); } }