private void btnEditOrder_Click(object sender, EventArgs e)
        {
            if (BLL.Settings.UseNewUserManagement && !this.HasPermission("Edit-Order"))
            {
                return;
            }

            if (gridOrderView.GetFocusedDataRow() != null && !Convert.ToBoolean(gridOrderView.GetFocusedDataRow()["IsElectronic"]))
            {
                int OrderID = Convert.ToInt32(gridOrderView.GetFocusedDataRow()["ID"]);

                var po = new PO();
                po.LoadByPrimaryKey(OrderID);

                if (po.ReceiveStarted)
                {
                    MessageBox.Show("Editing is not allowed because this order has already been received.", "Edit Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                var dialog = new PODialog(OrderID);
                if (dialog.ShowDialog(this) == DialogResult.Yes)
                {
                    // Reload the PO Grid.
                    RefeshPOGrid();
                }
            }
        }
        private void btnPO_Click(object sender, EventArgs e)
        {
            BLL.Receipt GRV = new BLL.Receipt();
            GRV.LoadByPrimaryKey(ReceiptID);
            ReceiptInvoice invoice = new ReceiptInvoice();

            invoice.LoadByPrimaryKey(GRV.ReceiptInvoiceID);
            PODialog InvoiceDialog = new PODialog(invoice.POID);

            InvoiceDialog.ShowDialog();
            LoadSelectedGRVDetailForCostBuildUp(ReceiptID);
        }
 private void btnPO_Click(object sender, EventArgs e)
 {
     BLL.Receipt GRV = new BLL.Receipt();
     GRV.LoadByPrimaryKey(ReceiptID);
     ReceiptInvoice invoice = new ReceiptInvoice();
     invoice.LoadByPrimaryKey(GRV.ReceiptInvoiceID);
     PODialog InvoiceDialog = new PODialog(invoice.POID);
     InvoiceDialog.ShowDialog();
     LoadSelectedGRVDetailForCostBuildUp(ReceiptID);
 }
        private void btnEditOrder_Click(object sender, EventArgs e)
        {
            if (BLL.Settings.UseNewUserManagement && !this.HasPermission("Edit-Order"))
            {
                return;
            }

            if (gridOrderView.GetFocusedDataRow() != null && !Convert.ToBoolean(gridOrderView.GetFocusedDataRow()["IsElectronic"]))
            {
                int OrderID = Convert.ToInt32(gridOrderView.GetFocusedDataRow()["ID"]);

                var po = new PO();
                po.LoadByPrimaryKey(OrderID);

                if (po.ReceiveStarted)
                {
                    MessageBox.Show("Editing is not allowed because this order has already been received.", "Edit Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                var dialog = new PODialog(OrderID);
                if (dialog.ShowDialog(this) == DialogResult.Yes)
                {
                    // Reload the PO Grid.
                    RefeshPOGrid();
                }
            }
        }