Esempio n. 1
0
        private void OnClickListener(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
        {
            dynamicColumnName = pVal.ColUID;
            try
            {
                int index = Grid0.GetDataTableRowIndex(pVal.Row);                    //get the row number on click
                SecondPar = Grid0.DataTable.GetValue(pVal.ColUID, index).ToString(); //get the specified col/row value
                String PurchasePar = Grid0.DataTable.GetValue(1, index).ToString();
                if (ComboBox0.Selected.Description == "5")
                {
                    SqlExecutor.fillSecondGridPurchase(Grid1, SecondPar);
                }

                else if (ComboBox0.Selected.Description == "6")
                {
                    SqlExecutor.fillSecondGridWitchChemicalDetails(Grid1, SecondPar);
                }

                else if (ComboBox0.Selected.Description == "7")
                {
                    SqlExecutor.fillSecondGridWitchChemicalStocks(Grid1, SecondPar);
                    //  Application.SBO_Application.MessageBox(SecondPar);
                }

                else if (ComboBox0.Selected.Description == "8")
                {
                    SqlExecutor.fillSecondGridWithOrderDetailsForCommoners(Grid1, PurchasePar);
                }

                else if (ComboBox0.Selected.Description == "9")
                {
                    SqlExecutor.sqaSecondGrid(Grid1, SecondPar, par3, par4);
                }

                else if (ComboBox0.Selected.Description == "10")
                {
                    SqlExecutor.fillSecondGridWithOrderDetailsForCommoners(Grid1, SecondPar);
                }


                else
                {
                    SqlExecutor.fillSecondGridDefault(Grid1, SecondPar);
                }
            }

            catch (Exception)
            {
            }
        }
        private void Grid0_ComboSelectAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
        {
            if ((pVal.ColUID == "CODSUPRA"))
            {
                int dtRow = Grid0.GetDataTableRowIndex(pVal.Row);
                SAPbouiCOM.ComboBoxColumn oCBC = (SAPbouiCOM.ComboBoxColumn)Grid0.Columns.Item("CODSUPRA");

                string ValSelec = oCBC.GetSelectedValue(pVal.Row).Value;       // Selecciona El Valor (U_CodigoSS)
                string DesSelec = oCBC.GetSelectedValue(pVal.Row).Description; // Selecciona la Descripcion (U_NombreSS)
                //mostrar la descripción en el combobox
                //  oCBC.DisplayType = (SAPbouiCOM.BoComboDisplayType.cdt_Description);
                // Para Asignar el Valor a una celda del grid se puede asi:
                Grid0.DataTable.SetValue("SUPRA-SECCIÓN", dtRow, DesSelec);


                //O tambien asi
                //Grid0.DataTable.Columns.Item("CODSUPRA").Cells(pVal.Row).value = ValSelec;
            }
        }
Esempio n. 3
0
        void _grid_Trans_DoubleClickAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
        {
            //SAPbouiCOM.ProgressBar oProgressBar = null;
            try
            {
                if (pVal.Row == -1 && pVal.Modifiers == SAPbouiCOM.BoModifiersEnum.mt_CTRL)
                {
                    return;
                }

                if (pVal.ColUID == "Checked" && pVal.Row == -1)
                {
                    checkAllGrid(_grid_Trans);
                }

                else if (pVal.ColUID == "Checked" && pVal.Row > -1)
                {
                    // if it is collaspeable
                    if (!_grid_Trans.Rows.IsLeaf(pVal.Row))
                    {
                        //in case there are more branch and not leafs, loop to the last branch
                        int _Leaf = 0;
                        for (int i = 1; ; i++)
                        {
                            if (_grid_Trans.Rows.IsLeaf(pVal.Row + i))
                            {
                                _Leaf = i;
                                break;
                            }
                        }

                        //use GetDataTableRowIndex when grid is collapse to get true row
                        String objType = _grid_Trans.DataTable.GetValue("ObjType", _grid_Trans.GetDataTableRowIndex(pVal.Row + _Leaf)).ToString();
                        String check   = _grid_Trans.DataTable.GetValue("Checked", _grid_Trans.GetDataTableRowIndex(pVal.Row + _Leaf)).ToString();

                        if (check == "Y")
                        {
                            check = "N";
                        }
                        else
                        {
                            check = "Y";
                        }

                        _oForm.Freeze(true);

                        /*
                         * try
                         * {
                         *  if (oProgressBar==null)
                         *  oProgressBar = eCommon.SBO_Application.StatusBar.CreateProgressBar("Export in progress", 100, false);
                         * }
                         * catch { }
                         */

                        // get all the rows with this objType
                        int[] Rows = eCommon.DataTableIndexOf(_dt_grid_Trans, "ObjType", objType);

                        /* int _progress = 0;
                         *
                         * if (oProgressBar != null)
                         * {
                         *  oProgressBar.Text = "Export in progress...";
                         *  oProgressBar.Maximum = Rows.Length;
                         * }
                         */
                        foreach (int Row in Rows)
                        {
                            _grid_Trans.DataTable.SetValue("Checked", Row, check);

                            /*
                             * _progress += 1;
                             *
                             * if (oProgressBar != null)
                             *  oProgressBar.Value = _progress;
                             */
                        }

                        // Set this objType to checked/uncheck and call populate grid again
                        //branchCheckDict[objType] = check;
                        //populateGrid();
                        _oForm.Freeze(false);
                    }
                }
            }
            catch (Exception ex) { eCommon.SBO_Application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); }
            finally
            {
                /*
                 * if (oProgressBar != null)
                 * {
                 *  oProgressBar.Stop();
                 *  oProgressBar = null;
                 * }
                 */
            }
        }