private void btnRemoveLevel_Click(object sender, EventArgs e)
        {
            if (XtraMessageBox.Show("Are you sure you want to delete this Package Level?", "Confirmation", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
            {
                BLL.ItemManufacturer imf = new BLL.ItemManufacturer();
                DataRowView          drv = (DataRowView)lstLevel.SelectedItems[0];
                String SelectedID        = drv["ID"].ToString();

                imf.LoadByPrimaryKey(Convert.ToInt32(SelectedID));

                if (imf.HasDependants())
                {
                    XtraMessageBox.Show("This Item Manufacturer cannot be deleted because there are other box levels that depend on it.", "Deleting is not allowed.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                if (imf.HasReceives())
                {
                    XtraMessageBox.Show("This Item Manufacturer Cannot be Deleted because there are items that were received with this manufacturer item composition.", "Deleting is not allowed.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                imf.MarkAsDeleted();

                imf.Save();

                //refresh the window
                imf.LoadManufacturersFor(this._itemID);
                lstManufacturers.DataSource = imf.DefaultView;

                lstManufacturers_SelectedIndexChanged(null, null);
            }
        }
        private void btnRemoveLevel_Click(object sender, EventArgs e)
        {
            if (XtraMessageBox.Show("Are you sure you want to delete this Package Level?", "Confirmation", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
            {

                BLL.ItemManufacturer imf = new BLL.ItemManufacturer();
                DataRowView drv = (DataRowView)lstLevel.SelectedItems[0];
                String SelectedID = drv["ID"].ToString();

                imf.LoadByPrimaryKey(Convert.ToInt32(SelectedID));

                if (imf.HasDependants())
                {
                    XtraMessageBox.Show("This Item Manufacturer cannot be deleted because there are other box levels that depend on it.", "Deleting is not allowed.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                if (imf.HasReceives())
                {
                    XtraMessageBox.Show("This Item Manufacturer Cannot be Deleted because there are items that were received with this manufacturer item composition.", "Deleting is not allowed.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                imf.MarkAsDeleted();

                imf.Save();

                //refresh the window
                imf.LoadManufacturersFor(this._itemID);
                lstManufacturers.DataSource = imf.DefaultView;

                lstManufacturers_SelectedIndexChanged(null, null);
            }
        }