private void commandOk_Execute(object sender, Ifs.Fnd.Windows.Forms.FndCommandExecuteEventArgs e)
        {
            // Dialog class have AcceptButton set to run this logic if the user ends the dialog using the Return button.
            // PPJ dialog close trough Sal.EndDialog so we set DialogResult to prevent the dialog from closing premature.
            DialogResult = DialogResult.None;
            SalBoolean bOK  = false;
            SalString  stmt = "";

            stmt = @"&AO.Exm_Inventory_Product_API.Add_prudct(
                                                                    :i_hWndFrame.dlgReceiveItem.dfnInventoryLocationId   IN,
                                                                    :i_hWndFrame.dlgReceiveItem.dfnInventoryId           IN,
                                                                    :i_hWndFrame.dlgReceiveItem.dfnPartId                IN,
                                                                    :i_hWndFrame.dlgReceiveItem.dfnAddQty                IN)";
            bOK  = DbPLSQLTransaction(cSessionManager.c_hSql, stmt);

            Sal.EndDialog(this, Sys.IDOK);
        }
        private void dfnPartId_OnPM_DataItemValidate(object sender, WindowActionsEventArgs e)
        {
            e.Handled = true;
            SalNumber  nReturn;
            SalBoolean bOK  = false;
            SalString  stmt = "";

            //Run framework valdation first, proceed if it succeeds, if set sendmessage it will be a nevr ending loop
            nReturn = Sal.SendClassMessage(Const.PM_DataItemValidate, e.WParam, e.LParam);
            if (nReturn == Sys.VALIDATE_Ok)
            {
                //call the DB function and assign the Quantity to appropriate data fied

                if (!this.dfnInventoryId.IsEmpty() && !this.dfnInventoryLocationId.IsEmpty() && !this.dfnPartId.IsEmpty())
                {
                    stmt = @":i_hWndFrame.dlgReceiveItem.dfnQtyAvailable := nvl(&AO.Exm_Inventory_Product_API.Get_Quantity(
                                                                                            :i_hWndFrame.dlgReceiveItem.dfnInventoryLocationId  IN,
                                                                                            :i_hWndFrame.dlgReceiveItem.dfnInventoryId          IN,
                                                                                            :i_hWndFrame.dlgReceiveItem.dfnPartId               IN), 0)";

                    bOK = DbPLSQLBlock(cSessionManager.c_hSql, stmt);
                    if (bOK)
                    {
                        e.Return = Sys.VALIDATE_Ok;
                    }
                    else
                    {
                        e.Return = Sys.VALIDATE_Cancel;
                    }
                }
            }
            else
            {
                e.Return = nReturn;
            }
        }