/// <summary>
        ///  load the current Purchase by getting the Primary key
        /// Pass a boolean to determine is the User Permission is read only for later use
        /// </summary>
        /// <param name="pLongID"></param>
        /// <param name="pBlnReadOnly"></param>
        public FrmSupplierPurchase(long pLongID, Boolean pBlnReadOnly)
        {
            InitializeComponent();
            _supplierPurchase = new SupplierPurchase(pLongID); // make an new instance of Supplier Purchase
          
            populateSupplierCombo(); // populate supplier combo box
            populateRawIngredientsCombo(); // populate raw ingredient combo box
            populateBranchCombo(); // populate branch combo box

            dgvPurchaseLines.DataSource = _supplierPurchase.getSupplierLinesTable(); // get the supplier Purchase lines table
            dgvPurchaseLines.Columns[0].Visible = false; // set the columns to invisible
            dgvPurchaseLines.Columns["RawIngredientsID"].Visible = false;
            dgvPurchaseLines.Columns["PurchaseID"].Visible = false;
            dgvPurchaseLines.Columns["IngredientName"].HeaderText = "IngCode";

            displayRecord();  // display the current record


            _lngPKID = pLongID; // pass the parameter value of the Primary Key to the global Variable
            _blnReadOnly = pBlnReadOnly; // give the global boolean value the value of the parameter value
             

            organizeFormForReadOnly(); // organize the form fields after we get the read only value
            mnuDeletePurchase.Enabled = true;
        } 
        ErrorCollection _errorCollection; // create an instance of the error collection class;
        #endregion

        #region Constructor 
        /// <summary>
        /// Create a new supplier Purchase 
        /// </summary>
        public FrmSupplierPurchase()
        {
            InitializeComponent();
            _supplierPurchase = new SupplierPurchase(); // new instance of supplier purchase 

            populateSupplierCombo(); // populate supplier combo box
            populateRawIngredientsCombo(); // populate raw ingredient combo box
            populateBranchCombo(); // populate branch combo box

            dgvPurchaseLines.DataSource = _supplierPurchase.getSupplierLinesTable(); // get the supplier Purchase lines table
            dgvPurchaseLines.Columns[0].Visible = false; // set the columns to invisible
            dgvPurchaseLines.Columns["RawIngredientsID"].Visible = false;
            dgvPurchaseLines.Columns["PurchaseID"].Visible = false;
            dgvPurchaseLines.Columns["IngredientName"].HeaderText = "IngCode";
        }