private void OpenSOPDocumentInquiry(SOPTransaction sopTrx)
        {
            if (string.IsNullOrEmpty(sopTrx.CustomerID) || string.IsNullOrEmpty(sopTrx.DocNum) || sopTrx.Status == 0 || sopTrx.DocType == 0)
            {
                return;
            }

            OpenSOPTransactionInquiry(sopTrx);
        }
        private void ViewTransaction()
        {
            //If View Transaction was clicked or row was double clicked
            try
            {
                if (dataGrid.Rows.Count > 0)
                {
                    string fieldName = Controller.Instance.Model.RMCustomerLabel + "ID";

                    string docNumber = dataGrid.Rows[dataGrid.SelectedRows[0].Index].Cells["DocNum"].Value.ToString();
                    short  docType   = Convert.ToInt16(dataGrid.Rows[dataGrid.SelectedRows[0].Index].Cells["SOPTYPE"].Value);
                    string masterID  = dataGrid.Rows[dataGrid.SelectedRows[0].Index].Cells[fieldName].Value.ToString();
                    string origin    = dataGrid.Rows[dataGrid.SelectedRows[0].Index].Cells["Origin"].Value.ToString();

                    short status = 0;
                    if (origin.ToUpper() == "WORK")
                    {
                        status = 1;
                    }
                    else  //HIST
                    {
                        status = 2;
                    }

                    SOPTransaction sopTrx = new SOPTransaction(status, docType, docNumber, masterID);

                    if (!string.IsNullOrEmpty(docNumber) && docType > 0 && !string.IsNullOrEmpty(masterID))
                    {
                        OpenSOPDocumentInquiry(sopTrx);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("An error occurred in ViewTransaction: " + ex.Message, "Error", MessageBoxButtons.OK);
            }
        }
 private void OpenSOPTransactionInquiry(SOPTransaction sopTrx)
 {
     Controller.Instance.Model.SOPSearchFocus = true;
     Dynamics.Forms.SopInquiry.Procedures.Open.Invoke(sopTrx.DocType, sopTrx.DocNum, sopTrx.Status, 11, 1, 10806);    //11 = SOP
 }