コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            //criar um formulário com dois matrix
            this.oForm         = UIHelper.CriarForm(this.oApplication, SAPbouiCOM.BoFormBorderStyle.fbs_Sizable, "TypeFrmMatrix", "UidFrmGrid", 200, 600, true, 0, "Matrix e Celulas", 250, 740, 44, 366);
            this.oButtonOK     = UIHelper.AddBotaoAoFormulario(this.oForm, "1", 5, 65, 170, 19, "Ok", false);
            this.oButtonCancel = UIHelper.AddBotaoAoFormulario(this.oForm, "2", 75, 65, 170, 19, "Cancel", false);
            AddDataSources();

            this.oMatrix1 = UIHelper.AddMatrixAoFormulario(this.oForm, "Matrix1", 360, 361, 5, 150, SAPbouiCOM.BoMatrixSelect.ms_Auto);
            this.AddColunasMatrix1(this.oMatrix1);
            this.setMatrix(ref this.oMatrix1);

            this.oMatrix2 = UIHelper.AddMatrixAoFormulario(this.oForm, "Matrix2", 5, 361, 5, 150, SAPbouiCOM.BoMatrixSelect.ms_Auto);
            this.AddColunasMatrix1(this.oMatrix2);
            this.setMatrix(ref this.oMatrix2);


            this.oForm.Settings.Enabled = true;

            this.oForm.Visible = true;



            this.btnMudarGrid.Enabled = true;
            this.btnMatrix.Enabled    = false;
        }
コード例 #2
0
        private void AddColunasMatrix1(SAPbouiCOM.Matrix pMatrix1)
        {
            SAPbouiCOM.Column       oColumn;
            SAPbouiCOM.LinkedButton oLinkedButton;



            //add primeira coluna de seleção
            oColumn = pMatrix1.Columns.Add("col0", SAPbouiCOM.BoFormItemTypes.it_EDIT);
            oColumn.TitleObject.Caption = "#";
            oColumn.Editable            = false;
            //add coluna link
            oColumn       = pMatrix1.Columns.Add("col1", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON);
            oColumn.Width = 100;
            oColumn.TitleObject.Caption = "Seleção do Link";
            oColumn.BackColor           = HelperB1.Colors.ColorToInt(Brushes.Green);
            oColumn.ForeColor           = HelperB1.Colors.ColorToInt(Brushes.Purple);
            oColumn.TextStyle           = 8;

            oLinkedButton = (SAPbouiCOM.LinkedButton)oColumn.ExtendedObject;
            oLinkedButton.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_BusinessPartner;

            //add coluna combo
            oColumn       = pMatrix1.Columns.Add("col2", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX);
            oColumn.Width = 100;
            oColumn.DataBind.SetBound(true, "", "ComboDS");
            oColumn.TitleObject.Caption = "Combo";
            oColumn.ForeColor           = HelperB1.Colors.ColorToInt(Brushes.Green); //olha no final se a cor está correta!!!!!!!!!
            oColumn.BackColor           = HelperB1.Colors.ColorToInt(Brushes.Purple);
            for (int i = 0; i <= 3; i++)
            {
                oColumn.ValidValues.Add("val" + i.ToString(), "Descrição" + i.ToString());
            }
            oColumn.DisplayDesc = true;

            //Add coluna checkbox
            oColumn       = pMatrix1.Columns.Add("col3", SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX);
            oColumn.Width = 50;
            oColumn.DataBind.SetBound(true, "", "CheckDS");
            if (pMatrix1.Item.UniqueID.Equals("Matrix1"))
            {
                oColumn.TitleObject.Caption = "Check 1";
            }
            else if (pMatrix1.Item.UniqueID.Equals("Matrix2"))
            {
                oColumn.TitleObject.Caption = "Check 2";
            }
            oColumn.BackColor = HelperB1.Colors.ColorToInt(Brushes.Green);
            oColumn.ForeColor = HelperB1.Colors.ColorToInt(Brushes.Purple);


            //add Picture Box
            oColumn          = pMatrix1.Columns.Add("col4", SAPbouiCOM.BoFormItemTypes.it_PICTURE);
            oColumn.Editable = false;
            oColumn.Width    = 60;
            oColumn.DataBind.SetBound(true, "", "PicDS");
            oColumn.TitleObject.Caption = "Picture";
            oColumn.ForeColor           = HelperB1.Colors.ColorToInt(Brushes.Green);
            oColumn.BackColor           = HelperB1.Colors.ColorToInt(Brushes.Purple);
        }
コード例 #3
0
        private void Button0_ClickBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            SAPbouiCOM.EditText oEdit = (SAPbouiCOM.EditText)oForm.Items.Item("Item_2").Specific;

            if (oForm.Mode == SAPbouiCOM.BoFormMode.fm_ADD_MODE)
            {
                if (oEdit.Value.Trim().Length == 0)
                {
                    Application.SBO_Application.StatusBar.SetText("Debe Seleccionar el Empleado que Recibe", SAPbouiCOM.BoMessageTime.bmt_Medium, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    BubbleEvent = false;
                }
                else
                {
                    if (EditText1.Value.Trim().Length > 0)
                    {
                        if (!DT_SQL.IsEmpty)
                        {
                            string  nOrden = "";
                            string  nLinea = "";
                            decimal nCant  = 0;

                            SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("13").Specific;

                            for (int i = 0; i < oMatrix.RowCount - 1; i++)
                            {
                                nOrden = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("231000074").Cells.Item(i).Specific).Value;
                                nLinea = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("24").Cells.Item(i).Specific).Value;
                                nCant  = Convert.ToDecimal(((SAPbouiCOM.EditText)oMatrix.Columns.Item("1").Cells.Item(i).Specific).Value);
                            }
                        }
                    }
                }
            }
        }
コード例 #4
0
        private bool IsMatrixCellsNotEmpty(SAPbouiCOM.Matrix mtxControl, params string[] fields)
        {
            List <string> ValuesList = new List <string>();

            for (int i = 1; i <= mtxControl.RowCount; i++)
            {
                foreach (var v in fields)
                {
                    ValuesList.Add(mtxControl.GetCellValue(v, i).ToString());
                }
            }
            var emptyValues = ValuesList.Where(x => x.Equals(string.Empty) || x.Equals("0.0")).ToList();

            if (emptyValues.Count == 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
            //bool isValid = true;
            //for (int i = 1; i <= mtxItems.RowCount; i++)
            //{
            //    if (mtxItems.GetCellValue("to_Item", i) == string.Empty || mtxItems.GetCellValue("rec_Item", i) == string.Empty || mtxItems.GetCellValue("FromWhs", i) == string.Empty
            //        || mtxItems.GetCellValue("ToWhs", i) == string.Empty || mtxItems.GetCellValue("Quantity", i) == string.Empty || mtxItems.GetCellValue("AvgPrice", i) == string.Empty || mtxItems.GetCellValue("AddAmount", i) == string.Empty || mtxItems.GetCellValue("AddAmount", i) == "0.0")
            //    {
            //        isValid = false;
            //        break;
            //    }
            //}
            //return isValid;
        }
コード例 #5
0
        /// <summary>
        /// Injects the comission button in the form
        /// </summary>
        private void AddComissionButton()
        {
            string lStrMatrixId = "38";
            string lStrTotalId  = "29";

            try
            {
                mObjForm.Freeze(true);
                if (mItmBtnCard == null)
                {
                    mItmBtnCard          = mObjForm.Items.Add("btnBnk", SAPbouiCOM.BoFormItemTypes.it_BUTTON);
                    mItmBtnCard.Top      = mObjForm.Items.Item(lStrMatrixId).Top + 168;
                    mItmBtnCard.Left     = mObjForm.Items.Item(lStrMatrixId).Left;
                    mItmBtnCard.FromPane = 1;
                    mItmBtnCard.ToPane   = 1;
                    mItmBtnCard.Width    = 145;
                    (mItmBtnCard.Specific as SAPbouiCOM.Button).Caption      = "Comisión por pago con tarjeta";
                    (mItmBtnCard.Specific as SAPbouiCOM.Button).ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.mItmBtnCard_ClickBefore);
                }
                mEdtTotal = (mObjForm.Items.Item(lStrTotalId).Specific as SAPbouiCOM.EditText);
                mMtxLines = (mObjForm.Items.Item(lStrMatrixId).Specific as SAPbouiCOM.Matrix);
            }
            finally
            {
                mObjForm.Freeze(false);
            }
        }
コード例 #6
0
ファイル: modalCharges.cs プロジェクト: xavl369/UGRS
        private void initSysMatrix()
        {
            UIApplication.GetApplication().ActivateMenuItem("2053");

            SAPbouiCOM.Form lObjForm = UIApplication.GetApplication().Forms.GetFormByTypeAndCount(133, -1);
            mtxItems = (SAPbouiCOM.Matrix)lObjForm.Items.Item("38").Specific;
        }
コード例 #7
0
        private void desenharCampos()
        {
            oItem = oForm.Items.Item("7");

            oNewItem          = oForm.Items.Add("Ver_Amb", SAPbouiCOM.BoFormItemTypes.it_MATRIX);
            oNewItem.Left     = 25;
            oNewItem.Width    = 880;
            oNewItem.Top      = oItem.Top + 205;
            oNewItem.Height   = 120;
            oNewItem.FromPane = 11;
            oNewItem.ToPane   = 11;

            oMatrix  = ((SAPbouiCOM.Matrix)(oNewItem.Specific));
            oColumns = oMatrix.Columns;

            oColumn = oColumns.Add("Ver_#", SAPbouiCOM.BoFormItemTypes.it_EDIT);
            oColumn.TitleObject.Caption = "#";
            oColumn.Width    = 30;
            oColumn.Editable = false;

            oColumn = oColumns.Add("Ver_Amb_C0", SAPbouiCOM.BoFormItemTypes.it_EDIT);
            oColumn.TitleObject.Caption = "Ambiente";
            oColumn.Width    = 80;
            oColumn.Editable = false;

            oColumn = oColumns.Add("Ver_Amb_C1", SAPbouiCOM.BoFormItemTypes.it_EDIT);
            oColumn.TitleObject.Caption = "Data Verificação";
            oColumn.Width    = 80;
            oColumn.Editable = true;

            /*oColumn = oColumns.Add("Ver_Amb_C2", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX);
             * oColumn.TitleObject.Caption = "Verificado por";
             * oColumn.Width = 100;
             * oColumn.Editable = true;
             * oColumn.DataBind.SetBound(true, "OPR4", "U_FLX_FB_ENT_PENDENC");*/

            oColumn = oColumns.Add("Ver_Amb_C2", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX);
            oColumn.TitleObject.Caption = "Verificado por";
            oColumn.Width    = 100;
            oColumn.Editable = true;

            oColumn = oColumns.Add("Ver_Amb_C3", SAPbouiCOM.BoFormItemTypes.it_EDIT);
            oColumn.TitleObject.Caption = "Observações";
            oColumn.Width    = 470;
            oColumn.Editable = true;

            oForm.DataSources.DataTables.Item("oMatrixDT").ExecuteQuery("SELECT T1.[Num], T1.[Descript], T0.* FROM OPR4 T0 INNER JOIN OOIN T1 ON T1.Num = T0.IntId WHERE T0.[OprId] = '1'");

            oColumn = oColumns.Item("Ver_Amb_C0");
            oColumn.DataBind.Bind("oMatrixDT", "Descript");

            oColumn = oColumns.Item("Ver_Amb_C1");
            oColumn.DataBind.Bind("oMatrixDT", "U_FLX_FB_VRF_DATEVER");

            oColumn = oColumns.Item("Ver_Amb_C2");
            oColumn.DataBind.Bind("oMatrixDT", "U_FLX_FB_VRF_VERIFPO");

            oColumn = oColumns.Item("Ver_Amb_C3");
            oColumn.DataBind.Bind("oMatrixDT", "U_FLX_FB_VRF_OBS");
        }
コード例 #8
0
        public void instanciarObjetosUI()
        {
            deletedEntries = new List <string>();

            dsTipoUsuario = mForm.DataSources.DBDataSources.Item(TB_TIPOUSR_APP);
            oMatrix       = mForm.Items.Item(MATRIZ_PRINCIPAL).Specific;
        }
コード例 #9
0
        /// <summary>
        /// Checkea y descheckea todas las columnas de la matrix variedades
        /// </summary>
        public static void EjecutarChecking(SAPbouiCOM.Form oForm)
        {
            SAPbouiCOM.Button oButton    = oForm.Items.Item("bt_chk").Specific;
            SAPbouiCOM.Matrix oMatrix    = oForm.Items.Item("matrixVar").Specific;
            SAPbouiCOM.Matrix oMatrixCrt = oForm.Items.Item("matrixCrt").Specific;

            oForm.Freeze(true);

            // Check
            if (oButton.Caption.Equals("check"))
            {
                for (int i = 1; i <= oMatrix.RowCount; i++)
                {
                    SAPbouiCOM.CheckBox chk = (SAPbouiCOM.CheckBox)oMatrix.Columns.Item("co_Chk").Cells.Item(i).Specific;
                    chk.Checked = true;
                }
                DataBindCuarteles(oForm);
                oButton.Caption = "uncheck";
            }
            // Uncheck
            else
            {
                for (int i = 1; i <= oMatrix.RowCount; i++)
                {
                    SAPbouiCOM.CheckBox chk = (SAPbouiCOM.CheckBox)oMatrix.Columns.Item("co_Chk").Cells.Item(i).Specific;
                    chk.Checked = false;
                }
                oMatrixCrt.Clear();
                oButton.Caption = "check";
            }

            oForm.Freeze(false);
        }
コード例 #10
0
        // toggle all checkbox in matrix
        private void checkAllMat(SAPbouiCOM.Matrix theMatrix)
        {
            try
            {
                _oForm.Freeze(true);
                if (!toggleGridCheckBox)
                {
                    for (int i = 0; i < _dt_VendorMatrix.Rows.Count; i++)
                    {
                        _dt_VendorMatrix.SetValue("Check", i, "Y");
                    }

                    theMatrix.LoadFromDataSource();

                    toggleGridCheckBox = true;
                }
                else
                {
                    for (int i = 0; i < _dt_VendorMatrix.Rows.Count; i++)
                    {
                        _dt_VendorMatrix.SetValue("Check", i, "N");
                    }

                    theMatrix.LoadFromDataSource();

                    toggleGridCheckBox = false;
                }
            }
            catch (Exception ex) { eCommon.SBO_Application.MessageBox(ex.Message); }

            _oForm.Freeze(false);
        }
コード例 #11
0
        /// <summary>
        /// Revisa el estado de la matrix cuarteles para dar valor correcto al boton check cuarteles
        /// </summary>
        public static void SetButtonCheckCuarteles(SAPbouiCOM.Form oForm)
        {
            SAPbouiCOM.Matrix oMatrix = oForm.Items.Item("matrixCrt").Specific;
            SAPbouiCOM.Button oButton = oForm.Items.Item("bt_chkC").Specific;
            bool Chekeados            = false;

            // Recorremos la matrix de cuarteles para saber si hay chekeados
            for (int i = 1; i <= oMatrix.RowCount; i++)
            {
                SAPbouiCOM.CheckBox chk = (SAPbouiCOM.CheckBox)oMatrix.Columns.Item("co_Chk").Cells.Item(i).Specific;
                if (chk.Checked)
                {
                    Chekeados = true;
                    break;
                }
            }

            // si hay valores chekeados cambiar button
            if (Chekeados)
            {
                oButton.Caption = "uncheck";
            }
            else
            {
                oButton.Caption = "check";
            }
        }
コード例 #12
0
        /// <summary>
        /// Valida los datos del formulario ingreso múltiple
        /// Retorna True si los datos son validos y se puede asignar
        /// Retorna False si faltan datos y no se puede asignar
        /// </summary>
        public static ResultMessage ValidarDatosAsignados(SAPbouiCOM.Form oForm)
        {
            ResultMessage rslt = new ResultMessage();

            SAPbouiCOM.Matrix oMatrix = null;
            string            Valor   = string.Empty;
            bool check = false;

            try
            {
                // Validar Seleccion de Matrix Variedades
                oMatrix = oForm.Items.Item("matrixVar").Specific;
                check   = false;

                for (int i = 1; i <= oMatrix.RowCount; i++)
                {
                    check = ((SAPbouiCOM.CheckBox)oMatrix.Columns.Item("co_Chk").Cells.Item(i).Specific).Checked;
                    if (check == true)
                    {
                        break;
                    }
                }

                if (check == false)
                {
                    rslt.Success = false;
                    rslt.Mensaje = "Seleccione una variedad a asignar.";
                    return(rslt);
                }

                // Validar Seleccion de Matrix Cuarteles
                oMatrix = oForm.Items.Item("matrixCrt").Specific;
                check   = false;

                for (int i = 1; i <= oMatrix.RowCount; i++)
                {
                    check = ((SAPbouiCOM.CheckBox)oMatrix.Columns.Item("co_Chk").Cells.Item(i).Specific).Checked;
                    if (check == true)
                    {
                        break;
                    }
                }

                if (check == false)
                {
                    rslt.Success = false;
                    rslt.Mensaje = "Seleccione un cuartel a asignar.";
                    return(rslt);
                }

                rslt.Success = true;
                return(rslt);
            }
            catch (Exception ex)
            {
                rslt.Success = false;
                rslt.Mensaje = ex.Message;
                return(rslt);
            }
        }
コード例 #13
0
 /// <summary>
 /// Initialize components. Called by framework after form created.
 /// </summary>
 public override void OnInitializeComponent()
 {
     this.Button0 = ((SAPbouiCOM.Button)(this.GetItem("Item_0").Specific));
     this.Button0.ChooseFromListAfter += new SAPbouiCOM._IButtonEvents_ChooseFromListAfterEventHandler(this.Button0_ChooseFromListAfter);
     this.grMatrix = ((SAPbouiCOM.Matrix)(this.GetItem("13").Specific));
     this.OnCustomInitialize();
 }
コード例 #14
0
    private void PostBP(Customer oCustomer, int i, SAPbouiCOM.Matrix oMatx)
    {
        String EbizKey = "";

        try
        {
            CustomerResponse resp = ebiz.AddCustomer(getToken(), oCustomer);
            if (resp.ErrorCode == 2 && resp.Error.Equals("Record already exists") && resp.Status.Equals("Failed"))
            {
                Customer OldCustomer = ebiz.GetCustomer(getToken(), oCustomer.CustomerId, "");
                UpdateEbizChargeKey("OCRD", OldCustomer.CustomerInternalId, oCustomer.CustomerId);
                EbizKey = OldCustomer.CustomerInternalId;
                ShowSystemLog(String.Format("Bussiness Partner:{0} Updated successfully", oCustomer.CustomerId));
            }
            else if (resp.ErrorCode == 0 && resp.Error.Equals("") && resp.Status.Equals("Success"))
            {
                UpdateEbizChargeKey("OCRD", resp.CustomerInternalId, oCustomer.CustomerId);
                EbizKey = resp.CustomerInternalId;
                ShowSystemLog(String.Format("Bussiness Partner:{0} Added successfully", oCustomer.CustomerId));
            }

            SAPbouiCOM.EditText oEdit;
            //SAPbouiCOM.EditText oEdit = (SAPbouiCOM.EditText)oMatx.Columns.Item("clEbizkey").Cells.Item(i + 1).Specific;
            //oEdit.Value = EbizKey;
            oEdit       = (SAPbouiCOM.EditText)oMatx.Columns.Item("clSync").Cells.Item(i + 1).Specific;
            oEdit.Value = "True";
        }
        catch (Exception ex)
        {
            errorLog(ex);
        }
    }
コード例 #15
0
 /// <summary>
 /// Initialize components. Called by framework after form created.
 /// </summary>
 public override void OnInitializeComponent()
 {
     this.mtxItems                       = ((SAPbouiCOM.Matrix)(this.GetItem("mtxItems").Specific));
     this.txtDocNo                       = ((SAPbouiCOM.EditText)(this.GetItem("txtDocNo").Specific));
     this.dtTransferItemLines            = this.UIAPIRawForm.DataSources.DBDataSources.Item(string.Format("@{0}", TableNames.TransferItemsLines));
     this.dpDocDate                      = ((SAPbouiCOM.EditText)(this.GetItem("dpDocDate").Specific));
     this.mtxItems.ChooseFromListBefore += new SAPbouiCOM._IMatrixEvents_ChooseFromListBeforeEventHandler(this.mtxItems_ChooseFromListBefore);
     this.mtxItems.ChooseFromListAfter  += new SAPbouiCOM._IMatrixEvents_ChooseFromListAfterEventHandler(this.mtxItems_ChooseFromListAfter);
     this.mtxItems.ClickBefore          += new SAPbouiCOM._IMatrixEvents_ClickBeforeEventHandler(this.mtxItems_ClickBefore);
     this.btnSave                      = ((SAPbouiCOM.Button)(this.GetItem("1").Specific));
     this.btnSave.ClickBefore         += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.btnSave_ClickBefore);
     this.btnSave.PressedBefore       += new SAPbouiCOM._IButtonEvents_PressedBeforeEventHandler(this.btnSave_PressedBefore);
     this.btnCancel                    = ((SAPbouiCOM.Button)(this.GetItem("2").Specific));
     this.fldrItems                    = ((SAPbouiCOM.Folder)(this.GetItem("Item_5").Specific));
     this.fldrCosts                    = ((SAPbouiCOM.Folder)(this.GetItem("Item_6").Specific));
     this.mtxCost                      = ((SAPbouiCOM.Matrix)(this.GetItem("Item_7").Specific));
     this.mtxCost.ChooseFromListAfter += new SAPbouiCOM._IMatrixEvents_ChooseFromListAfterEventHandler(this.mtxCost_ChooseFromListAfter);
     this.mtxCost.ClickBefore         += new SAPbouiCOM._IMatrixEvents_ClickBeforeEventHandler(this.mtxCost_ClickBefore);
     //this.btnCalculate = ((SAPbouiCOM.Button)(this.GetItem("btnClc").Specific));
     //this.btnCalculate.ClickAfter += new SAPbouiCOM._IButtonEvents_ClickAfterEventHandler(this.btnCalculate_ClickAfter);
     //this.btnCalculate.ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.btnCalculate_ClickBefore);
     this.btnAddRow                = ((SAPbouiCOM.Button)(this.GetItem("btnAddRow").Specific));
     this.btnAddRow.ClickBefore   += btnAddRow_ClickBefore;
     this.btnAddRow.ClickAfter    += btnAddRow_ClickAfter;
     this.mtxItems.ValidateBefore += mtxItems_ValidateBefore;
     this.OnCustomInitialize();
 }
コード例 #16
0
    private void HandleExportSOSelectAll(SAPbouiCOM.Form form, String MatxStr, SAPbouiCOM.DataTable oDataTable)
    {
        bool flgChange = false;

        try
        {
            if (form.Items.Item(MatxStr) == null)
            {
                return;
            }

            form.Items.Item(MatxStr).AffectsFormMode = false;
            SAPbouiCOM.Matrix OMatrix = (SAPbouiCOM.Matrix)form.Items.Item(MatxStr).Specific;
            int RowCount = oDataTable.Rows.Count;
            form.Freeze(true);
            if (RowCount > 0)
            {
                ShowMsgCustom("Selecting ...!");
                for (int i = 0; i < oDataTable.Rows.Count; i++)
                {
                    var chk = (SAPbouiCOM.CheckBox)OMatrix.Columns.Item("clSel").Cells.Item(i + 1).Specific;
                    if (flStateExportSO)
                    {
                        if (chk.Checked)
                        {
                        }
                        else
                        {
                            flgChange = true;
                            OMatrix.Columns.Item("clSel").Cells.Item(i + 1).Click(SAPbouiCOM.BoCellClickType.ct_Regular);
                        }
                    }
                    else
                    {
                        if (chk.Checked)
                        {
                            flgChange = true;
                            OMatrix.Columns.Item("clSel").Cells.Item(i + 1).Click(SAPbouiCOM.BoCellClickType.ct_Regular);
                        }
                        else
                        {
                        }
                    }
                }
            }
            form.Freeze(false);
            form.Update();
            if (flgChange)
            {
                flStateExportSO = !flStateExportSO;

                //    oMatrixBpExport.FlushToDataSource();
            }
        }
        catch (Exception ex)
        {
            errorLog(ex.Message);
        }
    }
コード例 #17
0
    public void BatchPreauth(SAPbouiCOM.Form form)
    {
        try {
            if (cfgBatchPreauth != "Y")
            {
                return;
            }
            if (SBO_Application.MessageBox("Run pre-auth on selected orders?", 1, "Yes", "No") != 1)
            {
                return;
            }

            SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix)form.Items.Item("10").Specific;
            for (int i = 1; i <= oMatrix.RowCount; i++)
            {
                SAPbouiCOM.CheckBox check = (SAPbouiCOM.CheckBox)oMatrix.Columns.Item("1").Cells.Item(i).Specific;
                if (check.Checked)
                {
                    string docnum             = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("11").Cells.Item(i).Specific).Value;
                    string customerid         = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("10").Cells.Item(i).Specific).Value;
                    int    docentry           = getDocEntry("17", docnum, customerid);
                    SAPbobsCOM.Documents oDoc = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders);
                    if (oDoc.GetByKey(docentry))
                    {
                        if (oDoc.DocumentStatus == SAPbobsCOM.BoStatus.bost_Close)
                        {
                            SBO_Application.SetStatusBarMessage("eBizCharge Batch pre-auth sales order : " + docnum + " is closed.", SAPbouiCOM.BoMessageTime.bmt_Medium, true);
                        }
                        else
                        {
                            SAPCust sapcust = getCustomerByID(customerid, "");
                            if (sapcust == null)
                            {
                                SBO_Application.SetStatusBarMessage("eBizCharge Batch pre-auth sales order : " + docnum + " error customer: " + customerid + " has no payment method.", SAPbouiCOM.BoMessageTime.bmt_Medium, true);
                            }
                            else
                            {
                                if (isOrderPreauthed(docentry.ToString()))
                                {
                                    SBO_Application.SetStatusBarMessage("eBizCharge Batch pre-auth sales order : " + docnum + " order already pre-authed", SAPbouiCOM.BoMessageTime.bmt_Medium, true);
                                }
                                else
                                {
                                    BatchPreauth_PreAuthCustomer(oDoc, sapcust);
                                }
                            }
                        }
                    }
                    else
                    {
                        SBO_Application.SetStatusBarMessage("eBizCharge Batch pre-auth can not retrieve sales order : " + docnum + ". " + oCompany.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, true);
                    }
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
コード例 #18
0
ファイル: GoodsReceive.b1f.cs プロジェクト: pbetkowski/Addon
 public override void OnInitializeComponent()
 {
     this.CountButton              = ((SAPbouiCOM.Button)(this.GetItem("Item_0").Specific));
     this.CountButton.ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.CountButton_ClickBefore);
     this.EditText0 = ((SAPbouiCOM.EditText)(this.GetItem("Item_1").Specific));
     this.Matrix0   = ((SAPbouiCOM.Matrix)(this.GetItem("38").Specific));
     this.OnCustomInitialize();
 }
コード例 #19
0
 private void ClearMatrix(string pStrDTName, SAPbouiCOM.Matrix pObjMatrix)
 {
     if (!this.UIAPIRawForm.DataSources.DataTables.Item(pStrDTName).IsEmpty)
     {
         this.UIAPIRawForm.DataSources.DataTables.Item(pStrDTName).Rows.Clear();
         pObjMatrix.Clear();
     }
 }
コード例 #20
0
ファイル: MFormCertificates.cs プロジェクト: xavl369/UGRS
 private void setItems()
 {
     lObjMatrix = ((SAPbouiCOM.Matrix)lObjModalForm.Items.Item("MtxCert").Specific);
     lObjBtnOk  = ((SAPbouiCOM.Button)lObjModalForm.Items.Item("btnOk").Specific);
     lObjBtnCan = ((SAPbouiCOM.Button)lObjModalForm.Items.Item("btnCan").Specific);
     lObjMatrix.AutoResizeColumns();
     initMatrix();
 }
コード例 #21
0
ファイル: frm_MRPD.cs プロジェクト: ubaidmughal/SAP
        private void InitiallizeForm()
        {
            isForLoading = true;
            oForm.Freeze(true);

            tab1 = (SAPbouiCOM.Folder)oForm.Items.Item("21").Specific;
            tab3 = (SAPbouiCOM.Folder)oForm.Items.Item("19").Specific;
            tab4 = (SAPbouiCOM.Folder)oForm.Items.Item("35").Specific;

            dtHead  = oForm.DataSources.DataTables.Item("dtHead");
            Animals = oForm.DataSources.DataTables.Item("Animals");
            DTRpt   = oForm.DataSources.DataTables.Item("DTRpt");
            dtPro   = oForm.DataSources.DataTables.Item("dtPro");
            dtReqT  = oForm.DataSources.DataTables.Item("dtReqT");
            dtTypeS = oForm.DataSources.DataTables.Item("dtTypeS");


            ocflCard = (SAPbouiCOM.ChooseFromList)oForm.ChooseFromLists.Item("cflCard");
            cflcardcode(ocflCard, "cflCard");


            mtAnimals = (SAPbouiCOM.Matrix)oForm.Items.Item("mtAnimals").Specific;
            mtReqT    = (SAPbouiCOM.Matrix)oForm.Items.Item("mtReqT").Specific;

            mtRpt     = (SAPbouiCOM.Matrix)oForm.Items.Item("mtRpt").Specific;
            mtProd    = (SAPbouiCOM.Matrix)oForm.Items.Item("mtProd").Specific;
            mtTypePRO = (SAPbouiCOM.Matrix)oForm.Items.Item("mtTypePRO").Specific;


            cbAT = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbAT").Specific;
            cbAC = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbAC").Specific;


            txQtyT     = (SAPbouiCOM.EditText)oForm.Items.Item("29").Specific;
            txSupplier = (SAPbouiCOM.EditText)oForm.Items.Item("47").Specific;

            chSO  = (SAPbouiCOM.CheckBox)oForm.Items.Item("chSO").Specific;
            chPRO = (SAPbouiCOM.CheckBox)oForm.Items.Item("crRPRO").Specific;

            dtHead.Rows.Add(1);
            dtHead.SetValue("DocDate", 0, DateTime.Now);
            dtHead.SetValue("PoDate", 0, DateTime.Now);

            dtHead.SetValue("stDate", 0, DateTime.Now.AddDays(1));
            dtHead.SetValue("eDate", 0, DateTime.Now.AddDays(4));
            oForm.Freeze(false);
            fillCB();

            txQtyT.Item.Enabled = false;
            oForm.PaneLevel     = 4;
            tab4.Select();
            isForLoading = false;
            fillPO();
            mtProd.Item.Visible = false;
            fillAThash();
            RefreshForm();
        }
コード例 #22
0
ファイル: mfrmCFL.cs プロジェクト: radtek/UGRS_Full
        private void SetItems()
        {
            pObjBtnSelect = ((SAPbouiCOM.Button)lObjCFLModalForm.Items.Item("btnSelect").Specific);
            lObjBtnCancel = ((SAPbouiCOM.Button)lObjCFLModalForm.Items.Item("btnCancel").Specific);
            pObjMtxCFL    = ((SAPbouiCOM.Matrix)lObjCFLModalForm.Items.Item("mtxItems").Specific);
            lObjBtnSearch = ((SAPbouiCOM.Button)lObjCFLModalForm.Items.Item("btnSrch").Specific);
            lObjTxtSearch = ((SAPbouiCOM.EditText)lObjCFLModalForm.Items.Item("txtSrch").Specific);

            lObjCFLModalForm.DataSources.DataTables.Add("DsItems");
        }
コード例 #23
0
        public static void Refresh(ref SAPbouiCOM.Matrix matrix)
        {
            // User datasource only
            //matrix.LoadFromDataSourceEx();
            //matrix.FlushToDataSource();
            matrix.Item.Update();

            //matrix.LoadFromDataSource();
            //matrix.LoadFromDataSourceEx(true);
        }
コード例 #24
0
ファイル: modalCharges.cs プロジェクト: xavl369/UGRS
        private void initItems()
        {
            lObjMatrix = ((SAPbouiCOM.Matrix)lObjFormChargesXml.Items.Item("Item_0").Specific);
            lObjMatrix.AutoResizeColumns();
            lStrArticletoCost = lObjChargesDAO.GetArticleToInvoice();
            lDbPrice          = lObjChargesDAO.GetPrice(lStrArticletoCost, lObjChargesDAO.GetWhs(lIntUserSign));

            initSysMatrix();
            ListCorrals();
        }
コード例 #25
0
    private void populateRBillingMatrix(string orderBy = "", string where = "")
    {
        string sql = "";

        try
        {
            if (oRBillingForm == null)
            {
                return;
            }
            SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix)oRBillingForm.Items.Item(matrixRBilling).Specific;
            oMatrix.Clear();
            //oMatrix.AutoResizeColumns();
            SAPbouiCOM.DataTable oDts = getRBillingMatrixDataTable();
            sql = string.Format("select \"DocEntry\" as jobID, \r\n" +
                                "(select \"DocEntry\" from ORDR where CAST(\"DocEntry\" AS VARCHAR) = \"U_OrderID\") as OrderID,  \r\n" +
                                "\"U_Description\",  \r\n" +
                                "\"U_Result\",  \r\n" +
                                "\"U_CustomerID\",  \r\n" +
                                "\"U_Frequency\", \r\n" +
                                "\"U_StartDate\", \r\n" +
                                "\"U_EndDate\", \r\n" +
                                "\"U_NextRunDate\",  \r\n" +
                                "\"U_LastRunDate\", \r\n" +
                                "\"U_CancelledDate\",  \r\n" +
                                "\"U_Amount\",  \r\n" +
                                "(select \"CardName\" from OCRD where \"CardCode\" = \"U_CustomerID\") as CustomerName,  \r\n" +
                                "(select \"DocEntry\" from OINV where \"CardCode\" = \"U_CustomerID\" and CAST(\"DocNum\" as VARCHAR) = \"U_InvoiceID\") as InvDocNum  \r\n" +
                                "from \"@CCJOB\"  \r\n" +
                                "where (\"U_Cancelled\"<>'Y' OR \"U_Cancelled\" is NULL)  {0}  order By  {1} \"U_NextRunDate\" ", where, orderBy);

            //trace(sql);
            oDts.ExecuteQuery(sql);
            BindMatrix(oMatrix, "jobID", "jobID", dtRBilling);
            BindMatrix(oMatrix, "CustName", "CustomerName", dtRBilling);
            BindMatrix(oMatrix, "InvID", "InvDocNum", dtRBilling);
            BindMatrix(oMatrix, "CustomerID", "U_CustomerID", dtRBilling);
            BindMatrix(oMatrix, "Desc", "U_Description", dtRBilling);
            BindMatrix(oMatrix, "Frequency", "U_Frequency", dtRBilling);
            BindMatrix(oMatrix, "StartDate", "U_StartDate", dtRBilling);
            BindMatrix(oMatrix, "EndDate", "U_EndDate", dtRBilling);
            BindMatrix(oMatrix, "NextRun", "U_NextRunDate", dtRBilling);
            BindMatrix(oMatrix, "LastRun", "U_LastRunDate", dtRBilling);
            BindMatrix(oMatrix, "Result", "U_Result", dtRBilling);
            //BindMatrix(oMatrix, "CancelDate", "CancelledDate", dtRBilling);
            BindMatrix(oMatrix, "OrderID", "OrderID", dtRBilling);
            BindMatrix(oMatrix, "Amount", "U_Amount", dtRBilling);
            oMatrix.LoadFromDataSource();
        }
        catch (Exception ex)
        {
            errorLog(ex);
            errorLog(sql);
        }
    }
コード例 #26
0
ファイル: frm_ProdList.cs プロジェクト: ubaidmughal/SAP
        private void InitiallizeForm()
        {
            oForm.Freeze(true);

            initiallizing = true;


            dtRpt   = oForm.DataSources.DataTables.Item("dtRpt");
            dtHeads = oForm.DataSources.DataTables.Item("dtHeads");
            dtHeads.Rows.Add(1);
            mtReport = (SAPbouiCOM.Matrix)oForm.Items.Item("mtReport").Specific;
            btAct    = (SAPbouiCOM.ButtonCombo)oForm.Items.Item("btAct").Specific;
            btPL     = (SAPbouiCOM.ButtonCombo)oForm.Items.Item("btPL").Specific;

            btAct.ValidValues.Add("01", "Released");
            btAct.ValidValues.Add("02", "Canceled");


            opALL = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opAO").Specific;
            opREL = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opREL").Specific;
            opPL  = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opPL").Specific;

            opOd = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opOd").Specific;
            opDd = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opDd").Specific;

            opFirst = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opFirst").Specific;
            opLast  = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opLast").Specific;
            opX     = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opX").Specific;


            opREL.GroupWith("opAO");
            opPL.GroupWith("opAO");
            opDd.GroupWith("opOd");

            opLast.GroupWith("opFirst");
            opX.GroupWith("opFirst");
            // opLast.Selected = true;


            txProduct = (SAPbouiCOM.EditText)oForm.Items.Item("txProduct").Specific;
            txFrom    = (SAPbouiCOM.EditText)oForm.Items.Item("txFrom").Specific;
            txTo      = (SAPbouiCOM.EditText)oForm.Items.Item("txTo").Specific;

            cbFilter = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbFilter").Specific;
            cbPL     = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbPL").Specific;
            cbPL.ValidValues.Add("0", "All");
            fillCbs();
            //  fillReport();
            oForm.Freeze(false);

            opALL.Selected  = true;
            opOd.Selected   = true;
            opLast.Selected = true;
            initiallizing   = false;
        }
コード例 #27
0
    private void PostPendEmail(String TemplateID, int i, SAPbouiCOM.Matrix oMatx, SAPbouiCOM.Form Oform)
    {
        String EbizKey    = "";
        bool   PostStatus = false;

        try
        {
            var             Menu = GetComboValue(Oform, cmbMenuString);
            PaymentResponse oPaymentResponse;

            if (Menu.Equals("Delete"))
            {
                oPaymentResponse = ebiz.DeleteEbizWebFormPayment(getToken(), TemplateID);
                if (oPaymentResponse.Status.Equals("Success"))
                {
                    PostStatus = true;
                }
                else
                {
                    PostStatus = false;
                }
            }
            else if (Menu.Equals("Send Email Reminder"))
            {//Delete
                var ReminderResp = ebiz.ResendEbizWebFormEmail(getToken(), TemplateID);
                if (ReminderResp.Equals("1"))
                {
                    PostStatus = true;
                }
                else
                {
                    PostStatus = false;
                }
            }

            if (PostStatus)
            {
                //SAPbouiCOM.EditText oEdit = (SAPbouiCOM.EditText)oMatx.Columns.Item("clEbizkey").Cells.Item(i + 1).Specific;
                //oEdit.Value = EbizKey;
                SAPbouiCOM.EditText oEdit = (SAPbouiCOM.EditText)oMatx.Columns.Item("clSync").Cells.Item(i + 1).Specific;
                oEdit.Value = "True";
                ShowSystemLog(String.Format("Done: Pending Email Row:{0} Selected Menu:{1}", i + 1, Menu));
            }
            else
            {
                SAPbouiCOM.EditText oEdit = (SAPbouiCOM.EditText)oMatx.Columns.Item("clSync").Cells.Item(i + 1).Specific;
                oEdit.Value = "False";
                ShowSystemLog(String.Format("Issue: Pending Email Row:{0} Selected Menu:{1}", i + 1, Menu));
            }
        }
        catch (Exception ex)
        {
            errorLog(ex);
        }
    }
コード例 #28
0
 public static void SetCellValue(this SAPbouiCOM.Matrix control, object column, object row, object newValue)
 {
     try
     {
         control.Columns.Item(column).Cells.Item(row).Click();
         ((dynamic)control.Columns.Item(column).Cells.Item(row).Specific).Value = newValue;
     }
     catch (Exception ex)
     {
     }
 }
コード例 #29
0
        private static void LoadInfo(SAPbouiCOM.Form oForm)
        {
            SAPbobsCOM.Recordset oRecordset = null;
            SAPbouiCOM.Matrix    oMatrix    = null;
            SAPbouiCOM.Matrix    oMatrixMm  = null;

            try
            {
                oForm.Freeze(true);
                oRecordset = Conexion_SBO.m_oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
                oMatrixMm  = oForm.Items.Item("Mtx_Mn").Specific;
                oRecordset.DoQuery("SELECT \"DocNum\" FROM \"@SEI_SETVALH\" ");
                if (oRecordset.RecordCount > 0)
                {
                    SAPbouiCOM.EditText oedit = null;
                    oForm.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE;
                    String docNUM = Convert.ToString(oRecordset.Fields.Item(0).Value);
                    oedit       = oForm.Items.Item("DocNum").Specific;
                    oedit.Value = docNUM;
                    oForm.EnableMenu("1281", false); // 1281 --> Buscar
                    oForm.EnableMenu("1282", false); // 1282 --> Crear
                    oForm.Items.Item("1").Click(SAPbouiCOM.BoCellClickType.ct_Regular);
                    oForm.Items.Item("DocNum").Enabled = false;
                    oForm.Items.Item("DocNum").Visible = false;
                    oMatrixMm.AddRow();
                }
                else
                {
                    oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE;
                    //oForm.Items.Item("DocNum").Enabled = false;
                    oForm.Items.Item("DocNum").Visible = false;
                    //oMatrix.AddRow(2);
                    ////lines
                    //((SAPbouiCOM.EditText)(oMatrix.Columns.Item("Col_0").Cells.Item(1).Specific)).Value = "Entrada de mercancias";
                    //((SAPbouiCOM.CheckBox)(oMatrix.Columns.Item("Col_1").Cells.Item(1).Specific)).Checked = true;
                    //((SAPbouiCOM.EditText)(oMatrix.Columns.Item("Col_2").Cells.Item(1).Specific)).Value = "1";
                    //((SAPbouiCOM.EditText)(oMatrix.Columns.Item("Col_0").Cells.Item(2).Specific)).Value = "Oferta de compra";
                    //((SAPbouiCOM.CheckBox)(oMatrix.Columns.Item("Col_1").Cells.Item(2).Specific)).Checked = true;
                    //((SAPbouiCOM.EditText)(oMatrix.Columns.Item("Col_2").Cells.Item(1).Specific)).Value = "2";

                    //((SAPbouiCOM.CheckBox)(oForm.Items.Item("cbSentAcep").Specific)).Checked = true;

                    oMatrixMm.AddRow();
                    ((SAPbouiCOM.EditText)(oMatrixMm.Columns.Item("Col_0").Cells.Item(1).Specific)).Value = "0";
                    ((SAPbouiCOM.EditText)(oMatrixMm.Columns.Item("Col_1").Cells.Item(1).Specific)).Value = "0";
                }
                //oForm.Items.Item("Mtx1").Visible = false;
                oForm.Freeze(false);
            }
            catch (Exception ex)
            {
                oForm.Freeze(false);
            }
        }
コード例 #30
0
 public void instanciarObjetosUI()
 {
     try
     {
         dsEquipo     = mForm.DataSources.DBDataSources.Item("@" + Movil.getTabla().nombre);
         mtxPrincipal = mForm.Items.Item("Item_0").Specific;
     }
     catch (Exception ex)
     {
         StatusMessageError("instanciarObjetosUI() > " + ex.Message);
     }
 }
コード例 #31
0
        /// <summary>
        /// Initialize components. Called by framework after form created.
        /// </summary>
        public override void OnInitializeComponent()
        {
            this.btnOk = ((SAPbouiCOM.Button)(this.GetItem("1").Specific));
            this.btnAddRow = ((SAPbouiCOM.Button)(this.GetItem("AddRow").Specific));
            this.btnAddRow.ClickAfter += btnAddRow_ClickAfter;
            this.btnOk.ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.btnOk_ClickBefore);
            this.btnCancel = ((SAPbouiCOM.Button)(this.GetItem("2").Specific));
            this.mtxCost = ((SAPbouiCOM.Matrix)(this.GetItem("mtxCosts").Specific));
            this.mtxCost.ChooseFromListAfter += new SAPbouiCOM._IMatrixEvents_ChooseFromListAfterEventHandler(this.mtxCost_ChooseFromListAfter);
            this.mtxCost.ClickAfter += new SAPbouiCOM._IMatrixEvents_ClickAfterEventHandler(this.mtxCost_ClickAfter);
            this.mtxCost.ClickBefore += new SAPbouiCOM._IMatrixEvents_ClickBeforeEventHandler(this.mtxCost_ClickBefore);
            this.OnCustomInitialize();

        }
コード例 #32
0
 private void ContarLinhasIniciaisMatrixPendencias()
 {
     //Pendencias
     oNewItem = oForm.Items.Item("Pen_Amb");
     oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));
     countMatrixPendenciaAntes = oMatrix.RowCount;
     ListNomePendencias.Clear();
     for (int i = 1; i <= oMatrix.RowCount; i++)
     {
         ListNomePendencias.Add(((SAPbouiCOM.EditText)oMatrix.Columns.Item("Pen_Amb_C0").Cells.Item(i).Specific).String);
     }
 }
コード例 #33
0
        public void AddAnexoMedicao(int idOOPR)
        {
            try
            {
                SAPbobsCOM.SalesOpportunities oSalesOpportunities = null;
                oSalesOpportunities = checked((SAPbobsCOM.SalesOpportunities)conexao.getOCompany().GetBusinessObject(SAPbobsCOM.BoObjectTypes.oSalesOpportunities));
                string medAnexoLevantamento = null;
                string elbIniPrev = null;
                string elbTermPrev = null;
                string elbIniRealizado = null;
                string elbTermRealizado = null;
                string elbArqCad = null;
                string elbArqPRJ = null;
                string elbArqJPG = null;
                int elbProjetista = 0;
                string elbDatRevisao = null;
                string apsDetalhamento = null;
                string apvAprovadoPor = null;
                string apvDataApv = null;
                string apvAnexoPdf = null;
                string apvPranchaImagem = null;
                string apvMemorialDescritivo = null;
                string verData = null;
                string verObs = null;
                string verVerificadoPor = null;
                string pedData = null;
                string pedUrl = null;
                string pedNumero = null;
                string pedOrdemCompra = null;
                string pedValor = null;
                string pedSolicitante = null;
                string pedPrazEntrega = null;
                string pedAnexo = null;
                string detIniPrev = null;
                string detTermPrev = null;
                string detIniRealzidado = null;
                string detTermRealizado = null;
                string detAnexo = null;
                int detProjetista = 0;
                string fabExpedicao = null;
                string fabConferente = null;
                string fabRecebimento = null;
                string montResponsavel = null;
                string montDescricao = null;
                string montVstInt1 = null;
                string montVstInt2 = null;
                string montVstInt3 = null;
                string etgDatEntrega = null;
                string etgLaudoEntrega = null;
                string etgResponsavel = null;
                string etgDatSolucao = null;
                bool etgResolvido = false;

                oNewItem = oForm.Items.Item("Med_Amb");
                oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                oNewItem = oForm.Items.Item("Ela_Amb");
                SAPbouiCOM.Matrix matrixElaboracao;
                matrixElaboracao = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                oNewItem = oForm.Items.Item("Apr_Amb");
                SAPbouiCOM.Matrix matrixApresentacao;
                matrixApresentacao = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                oNewItem = oForm.Items.Item("Apv_Amb");
                SAPbouiCOM.Matrix matrixAprovacao;
                matrixAprovacao = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                oNewItem = oForm.Items.Item("Ver_Amb");
                SAPbouiCOM.Matrix matrixVerificacao;
                matrixVerificacao = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                oNewItem = oForm.Items.Item("Ped_Amb");
                SAPbouiCOM.Matrix matrixPedido;
                matrixPedido = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                oNewItem = oForm.Items.Item("Det_Amb");
                SAPbouiCOM.Matrix matrixDetalhamento;
                matrixDetalhamento = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                oNewItem = oForm.Items.Item("Fab_Amb");
                SAPbouiCOM.Matrix matrixFabrica;
                matrixFabrica = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                oNewItem = oForm.Items.Item("Mon_Amb");
                SAPbouiCOM.Matrix matrixMontagem;
                matrixMontagem = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                oNewItem = oForm.Items.Item("Etg_Amb");
                SAPbouiCOM.Matrix matrixEntrega;
                matrixEntrega = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                ArrayList idsAmbientes = ambiente.getIds();

                if (oSalesOpportunities.GetByKey(idOOPR) == true)
                {
                    for (int i = 0; i < oSalesOpportunities.Interests.Count; i++)
                    {
                        oSalesOpportunities.Interests.SetCurrentLine(i);
                        int id = Convert.ToInt32(idsAmbientes[i]);
                        if (oSalesOpportunities.Interests.RowNo == id)
                        {
                            //Instanciar a Grid de Ambientes
                            medAnexoLevantamento = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Med_Amb_C1").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_MED_LEVANTA").Value = medAnexoLevantamento;

                            //Instanciar a Grid de Elaboração

                            elbDatRevisao = ((SAPbouiCOM.EditText)matrixElaboracao.Columns.Item("Ela_Amb_C1").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ELB_REVISAO").Value = elbDatRevisao;

                            SAPbouiCOM.ComboBox combo;
                            //oItem = oForm.Items.Item("Ela_Amb_C2");
                            combo = (SAPbouiCOM.ComboBox)matrixElaboracao.Columns.Item("Ela_Amb_C2").Cells.Item(i + 1).Specific;
                            if (combo.Value != "")
                            {
                                elbProjetista = Convert.ToInt32(((SAPbouiCOM.ComboBox)matrixElaboracao.Columns.Item("Ela_Amb_C2").Cells.Item(i + 1).Specific).Value);
                                oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ELB_PROJETI").Value = elbProjetista;
                            }

                            elbIniPrev = ((SAPbouiCOM.EditText)matrixElaboracao.Columns.Item("Ela_Amb_C3").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ELB_INICIOP").Value = elbIniPrev;

                            elbTermPrev = ((SAPbouiCOM.EditText)matrixElaboracao.Columns.Item("Ela_Amb_C4").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ELB_TERMINP").Value = elbTermPrev;

                            elbIniRealizado = ((SAPbouiCOM.EditText)matrixElaboracao.Columns.Item("Ela_Amb_C5").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ELB_INICIOR").Value = elbIniRealizado;

                            elbTermRealizado = ((SAPbouiCOM.EditText)matrixElaboracao.Columns.Item("Ela_Amb_C6").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ELB_TERMINR").Value = elbTermRealizado;

                            elbArqCad = ((SAPbouiCOM.EditText)matrixElaboracao.Columns.Item("Ela_Amb_C7").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ELB_ARQCAD").Value = elbArqCad;

                            elbArqPRJ = ((SAPbouiCOM.EditText)matrixElaboracao.Columns.Item("Ela_Amb_C8").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ELB_ARQPRJ").Value = elbArqPRJ;

                            elbArqJPG = ((SAPbouiCOM.EditText)matrixElaboracao.Columns.Item("Ela_Amb_C9").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ELB_ARQJPG").Value = elbArqJPG;

                            //Instanciar a Grid de Verificação
                            verData = ((SAPbouiCOM.EditText)matrixVerificacao.Columns.Item("Ver_Amb_C1").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_VRF_DATEVER").Value = verData;

                            verVerificadoPor = ((SAPbouiCOM.ComboBox)matrixVerificacao.Columns.Item("Ver_Amb_C2").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_VRF_VERIFPO").Value = Convert.ToInt32(verVerificadoPor);

                            verObs = ((SAPbouiCOM.EditText)matrixVerificacao.Columns.Item("Ver_Amb_C3").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_VRF_OBS").Value = verObs;

                            //Instanciar a Grid de Apresentação
                            apsDetalhamento = ((SAPbouiCOM.EditText)matrixApresentacao.Columns.Item("Apr_Amb_C1").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ANC_DETALHA").Value = apsDetalhamento;

                            //Instanciar a Grid de Aprovação
                            apvAprovadoPor = ((SAPbouiCOM.ComboBox)matrixAprovacao.Columns.Item("Apv_Amb_C1").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_APR_APROVAD").Value = Convert.ToInt32(apvAprovadoPor);

                            apvDataApv = ((SAPbouiCOM.EditText)matrixAprovacao.Columns.Item("Apv_Amb_C2").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_APR_DATAAPR").Value = apvDataApv;

                            apvAnexoPdf = ((SAPbouiCOM.EditText)matrixAprovacao.Columns.Item("Apv_Amb_C3").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_APR_PDFCLIE").Value = apvAnexoPdf;

                            apvPranchaImagem = ((SAPbouiCOM.EditText)matrixAprovacao.Columns.Item("Apv_Amb_C4").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_APR_PRANIMG").Value = apvPranchaImagem;

                            apvMemorialDescritivo = ((SAPbouiCOM.EditText)matrixAprovacao.Columns.Item("Apv_Amb_C5").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_APR_MEMDESC").Value = apvMemorialDescritivo;

                            //Instanciar a Grid de Pedidos
                            pedData = ((SAPbouiCOM.EditText)matrixPedido.Columns.Item("Ped_Amb_C1").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_PED_DATE").Value = pedData;

                            pedNumero = ((SAPbouiCOM.EditText)matrixPedido.Columns.Item("Ped_Amb_C2").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_PED_NPEDIDO").Value = pedNumero;

                            pedOrdemCompra = ((SAPbouiCOM.EditText)matrixPedido.Columns.Item("Ped_Amb_C3").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_PED_ORDENDE").Value = pedOrdemCompra;

                            pedValor = ((SAPbouiCOM.EditText)matrixPedido.Columns.Item("Ped_Amb_C4").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_PED_VALOR").Value = pedValor;

                            pedSolicitante = ((SAPbouiCOM.ComboBox)matrixPedido.Columns.Item("Ped_Amb_C5").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_PED_SOLICIT").Value = Convert.ToInt32(pedSolicitante);

                            pedPrazEntrega = ((SAPbouiCOM.EditText)matrixPedido.Columns.Item("Ped_Amb_C6").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_PED_PRAZOEN").Value = pedPrazEntrega;

                            pedAnexo = ((SAPbouiCOM.EditText)matrixPedido.Columns.Item("Ped_Amb_C7").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_PED_ANEXOPE").Value = pedAnexo;

                            pedUrl = ((SAPbouiCOM.EditText)matrixPedido.Columns.Item("Ped_Amb_C8").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_PED_URL").Value = pedUrl;

                            //Instanciar a Grid de Detalhamento

                            combo = (SAPbouiCOM.ComboBox)matrixDetalhamento.Columns.Item("Det_Amb_C2").Cells.Item(i + 1).Specific;
                            if (combo.Value != "")
                            {
                                detProjetista = Convert.ToInt32(((SAPbouiCOM.ComboBox)matrixDetalhamento.Columns.Item("Det_Amb_C2").Cells.Item(i + 1).Specific).Value);
                                oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_DET_PROJETI").Value = detProjetista;
                            }

                            detIniPrev = ((SAPbouiCOM.EditText)matrixDetalhamento.Columns.Item("Det_Amb_C3").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_DET_INICIOP").Value = detIniPrev;

                            detTermPrev = ((SAPbouiCOM.EditText)matrixDetalhamento.Columns.Item("Det_Amb_C4").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_DET_TERMINP").Value = detTermPrev;

                            detIniRealzidado = ((SAPbouiCOM.EditText)matrixDetalhamento.Columns.Item("Det_Amb_C5").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_DET_INICIRE").Value = detIniRealzidado;

                            detTermRealizado = ((SAPbouiCOM.EditText)matrixDetalhamento.Columns.Item("Det_Amb_C6").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_DET_TERMINO").Value = detTermRealizado;

                            detAnexo = ((SAPbouiCOM.EditText)matrixDetalhamento.Columns.Item("Det_Amb_C7").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_DET_PDF").Value = detAnexo;

                            //Instanciar a Grid de Fábrica
                            fabExpedicao = ((SAPbouiCOM.EditText)matrixFabrica.Columns.Item("Fab_Amb_C1").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_FAB_EXPEDIC").Value = fabExpedicao;

                            fabRecebimento = ((SAPbouiCOM.EditText)matrixFabrica.Columns.Item("Fab_Amb_C2").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_FAB_RECEBIM").Value = fabRecebimento;

                            fabConferente = ((SAPbouiCOM.ComboBox)matrixFabrica.Columns.Item("Fab_Amb_C3").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_FAB_CONFERE").Value = Convert.ToInt32(fabConferente);

                            //Instanciar a Grid de Montagem
                            montResponsavel = ((SAPbouiCOM.ComboBox)matrixMontagem.Columns.Item("Mon_Amb_C1").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_MTG_RESPONS").Value = Convert.ToInt32(montResponsavel);

                            montDescricao = ((SAPbouiCOM.EditText)matrixMontagem.Columns.Item("Mon_Amb_C2").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_MTG_DESCRIC").Value = montDescricao;

                            montVstInt1 = ((SAPbouiCOM.EditText)matrixMontagem.Columns.Item("Mon_Amb_C3").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_MTG_VSTINT1").Value = montVstInt1;

                            montVstInt2 = ((SAPbouiCOM.EditText)matrixMontagem.Columns.Item("Mon_Amb_C4").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_MTG_VSTINT2").Value = montVstInt2;

                            montVstInt3 = ((SAPbouiCOM.EditText)matrixMontagem.Columns.Item("Mon_Amb_C5").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_MTG_VSTINT3").Value = montVstInt3;

                            //Instanciar a Grid de Entrega
                            etgDatEntrega = ((SAPbouiCOM.EditText)matrixEntrega.Columns.Item("Etg_Amb_C1").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ENT_ENTREGA").Value = etgDatEntrega;

                            etgResponsavel = ((SAPbouiCOM.ComboBox)matrixEntrega.Columns.Item("Etg_Amb_C2").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ENT_RESPONS").Value = Convert.ToInt32(etgResponsavel);

                            etgLaudoEntrega = ((SAPbouiCOM.EditText)matrixEntrega.Columns.Item("Etg_Amb_C3").Cells.Item(i + 1).Specific).Value;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ENT_LAUDO").Value = etgLaudoEntrega;

                            etgDatSolucao = ((SAPbouiCOM.EditText)matrixEntrega.Columns.Item("Etg_Amb_C4").Cells.Item(i + 1).Specific).String;
                            oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ENT_DATASOL").Value = etgDatSolucao;

                            etgResolvido = ((SAPbouiCOM.CheckBox)matrixEntrega.Columns.Item("Etg_Amb_C5").Cells.Item(i + 1).Specific).Checked;
                            if (etgResolvido)
                            {
                                oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ENT_RESOLVI").Value = 1;
                            }
                            else
                            {
                                oSalesOpportunities.Interests.UserFields.Fields.Item("U_FLX_FB_ENT_RESOLVI").Value = 0;
                            }

                            oSalesOpportunities.Update();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");
            }
        }
コード例 #34
0
        private void LoadAmbientesInMatrix()
        {
            string OpID = null;

            oForm.DataSources.DataTables.Item("oMatrixDT").Clear();
            oItem = oForm.Items.Item("74");
            oEditItem = ((SAPbouiCOM.EditText)(oItem.Specific));
            OpID = oEditItem.Value;
            oForm.DataSources.DataTables.Item("oMatrixDT").ExecuteQuery("SELECT T1.[Num], T1.[Descript], T0.* FROM OPR4 T0 INNER JOIN OOIN T1 ON T1.Num = T0.IntId WHERE T0.[OprId] = '" + OpID + "'");
            //oForm.DataSources.DataTables.Item("oMatrixDT").ExecuteQuery("SELECT T2.Name as elbProj, T3.Name as detProj, T1.[Num], T1.[Descript], T0.* FROM OPR4 T0 INNER JOIN OOIN T1 ON T1.Num = T0.IntId inner join [@FLX_FB_PRJ] T2 on T2.Code = T0.U_FLX_FB_ELB_PROJETI inner join [@FLX_FB_PRJ] T3 on T3.Code = T0.U_FLX_FB_DET_PROJETI WHERE T0.[OprId] = '" + OpID + "'");

            oItem = oForm.Items.Item("Med_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();
            iRowAmbienteMedicao = 1;
            iIdAmbienteMedicao = int.Parse(((SAPbouiCOM.EditText)oMatrix.Columns.Item("Med_Amb_C2").Cells.Item(iRowAmbienteMedicao).Specific).Value);

            oItem = oForm.Items.Item("Res_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();

            oItem = oForm.Items.Item("Ela_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();

            oItem = oForm.Items.Item("Ver_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();

            oItem = oForm.Items.Item("Apr_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();

            oItem = oForm.Items.Item("Apv_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();

            oItem = oForm.Items.Item("Ped_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();

            oItem = oForm.Items.Item("Det_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();

            oItem = oForm.Items.Item("Fab_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();

            oItem = oForm.Items.Item("Mon_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();

            oItem = oForm.Items.Item("Etg_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();
        }
コード例 #35
0
        private void LoadGridAnaliseCritica()
        {
            string OpID = null;

            oForm.DataSources.DataTables.Item("oDataTableAnalise").Clear();
            oItem = oForm.Items.Item("74");
            oEditItem = ((SAPbouiCOM.EditText)(oItem.Specific));
            OpID = oEditItem.Value;
            oForm.DataSources.DataTables.Item("oDataTableAnalise").ExecuteQuery("SELECT * FROM [@FLX_FB_ANLCRI] where U_FLX_FB_ANLCRI_ID = '" + OpID + "'" + "and U_FLX_FB_ANLCRI_AMBI = '" + idAmbiente + "'");

            oItem = oForm.Items.Item("Ans_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();
        }
コード例 #36
0
        private void LoadGridItensComplementares()
        {
            string OpID = null;

            oForm.DataSources.DataTables.Item("oDataTableItc").Clear();
            oItem = oForm.Items.Item("74");
            oEditItem = ((SAPbouiCOM.EditText)(oItem.Specific));
            OpID = oEditItem.Value;
            oForm.DataSources.DataTables.Item("oDataTableItc").ExecuteQuery("select T1.ItemCode, T1.ItemName, T1.OnHand, T0.U_FLX_FB_ITC_QTD, T2.CardCode, T2.CardName, T0.U_FLX_FB_ITC_OBS, T0.Code, T0.U_FLX_FB_ITC_PRZETG, T0.U_FLX_FB_ITC_SOLICI, T0.U_FLX_FB_ITC_RECEB from [@FLX_FB_ITC] T0 inner join OITM T1 on T1.ItemCode = T0.U_FLX_FB_ITC_IDOITM inner join OCRD T2 on T2.CardCode = T0.U_FLX_FB_ITC_IDOCRD where T0.U_FLX_FB_ITC_IDOOPR = '" + OpID + "'");

            oItem = oForm.Items.Item("Det_Cmp");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();

            oItem = oForm.Items.Item("Mon_Itc");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();
        }
コード例 #37
0
        private void LoadGridPendencias()
        {
            string OpID = null;

            oForm.DataSources.DataTables.Item("oDataTablePend").Clear();
            oItem = oForm.Items.Item("74");
            oEditItem = ((SAPbouiCOM.EditText)(oItem.Specific));
            OpID = oEditItem.Value;
            oForm.DataSources.DataTables.Item("oDataTablePend").ExecuteQuery("select * from [@FLX_FB_PEN] where U_FLX_FB_PEN_IDOOPR = '" + OpID + "'" + "and U_FLX_FB_PEN_IDAMB = '" + idAmbientePendencia + "'");

            oItem = oForm.Items.Item("Pen_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();
        }
コード例 #38
0
        private void SBO_Application_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
        {
            SAPbouiCOM.BoEventTypes EventEnum = 0;
            EventEnum = pVal.EventType;
            BubbleEvent = true;

            if (pVal.FormType == 320)
            {
                if ((pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) & (!pVal.Before_Action))
                {
                    //Laudo_Ini
                    if (pVal.ItemUID == "Laudo_Ini")
                    {
                        abrirRelatorio("Laudo inicial", oForm.Items.Item("74").Specific.Value);
                    }

                    //Ent_Imp
                    if (pVal.ItemUID == "Ent_Imp")
                    {
                        abrirRelatorio("Descricao dos ambientes", oForm.Items.Item("74").Specific.Value);
                    }

                    //Laudo_Int
                    if (pVal.ItemUID == "Laudo_Int")
                    {
                        abrirRelatorio("Laudo intermediario", oForm.Items.Item("74").Specific.Value);
                    }
                    //NvAnalise
                    if (pVal.ItemUID == "NvAnalise")
                    {
                        abrirRelatorio("Analise critica", oForm.Items.Item("74").Specific.Value);
                    }
                    //Laudo_ent
                    if (pVal.ItemUID == "Laudo_Ent")
                    {
                        abrirRelatorio("Laudo de entrega", oForm.Items.Item("74").Specific.Value);
                    }
                    //Pesquisa de satisfacao
                    if (pVal.ItemUID == "Etg_Pq")
                    {
                        abrirRelatorio("Pesquisa de satisfacao", oForm.Items.Item("74").Specific.Value);
                    }
                    //NvLev
                    if (pVal.ItemUID == "NvLev")
                    {
                        abrirRelatorio("Levantamento", "");
                    }
                    //Etg_Decl
                    if (pVal.ItemUID == "Etg_Decl")
                    {
                        abrirRelatorio("Declaracao de conformidade", oForm.Items.Item("74").Specific.Value);
                    }

                }

                // Ao mudar o ambiente
                if (pVal.Before_Action && (EventEnum == SAPbouiCOM.BoEventTypes.et_COMBO_SELECT) && pVal.ItemUID == "Ent_Amb" && pVal.ItemChanged)
                {
                    // Verifica a descricao de Ent_Det se mudou e captura
                    oEditItem = ((SAPbouiCOM.EditText)oForm.Items.Item("Ent_Det").Specific);
                    string sEnt_Det = oEditItem.String;
                    try
                    {
                        if (sEnt_Det != sDescricaoOriginalAmbiente)
                        {
                            int idOOPR = int.Parse(((SAPbouiCOM.EditText)oForm.Items.Item("74").Specific).Value);
                            string selectedValue = ((SAPbouiCOM.ComboBox)oForm.Items.Item("Ent_Amb").Specific).Value;
                            int iSelectedValue;
                            if (selectedValue != "")
                            {
                                iSelectedValue = int.Parse(selectedValue);
                                // Atualiza a Descrição na Oportunidade de Vendas
                                AddOportunidadeVendas(idOOPR, "0", "0", "0", iSelectedValue, sEnt_Det);
                            }
                        }
                    }
                    catch
                    {
                    }
                }

                if (!pVal.Before_Action && (EventEnum == SAPbouiCOM.BoEventTypes.et_COMBO_SELECT) && pVal.ItemUID == "Ent_Amb" && pVal.ItemChanged)
                {
                    oEditItem = ((SAPbouiCOM.EditText)oForm.Items.Item("Ent_Det").Specific);

                    string idOOPR = ((SAPbouiCOM.EditText)oForm.Items.Item("74").Specific).Value;
                    string selectedValue = ((SAPbouiCOM.ComboBox)oForm.Items.Item("Ent_Amb").Specific).Value;

                    ambiente = new Ambiente(idOOPR);
                    oEditItem.Value = ambiente.getDescricaoEntrevista(selectedValue);
                }

                //Evento da Drop.

                if (!pVal.Before_Action && (EventEnum == SAPbouiCOM.BoEventTypes.et_COMBO_SELECT) & pVal.ItemChanged & (pVal.ItemUID == "Ela_Amb"))
                {
                    string coluna2 = pVal.ColUID;
                    if (coluna2 == "Ela_Amb_C2")
                    {
                        string linha = pVal.Row.ToString();
                    }
                }

                if (!pVal.Before_Action && (EventEnum == SAPbouiCOM.BoEventTypes.et_COMBO_SELECT) & pVal.ItemChanged & (pVal.ItemUID == "Ent_Proj"))
                {
                    upProjEnt = true;
                    //SBO_Application.MessageBox("Mudou Proj Entrevista.");
                }
                if (!pVal.Before_Action && (EventEnum == SAPbouiCOM.BoEventTypes.et_COMBO_SELECT) & pVal.ItemChanged & (pVal.ItemUID == "Med_Proj"))
                {
                    upProjMed = true;
                    //SBO_Application.MessageBox("Mudou Proj Medição.");
                }
                if (!pVal.Before_Action && (EventEnum == SAPbouiCOM.BoEventTypes.et_COMBO_SELECT) & pVal.ItemChanged & (pVal.ItemUID == "Apr_Proj"))
                {
                    upProjAps = true;
                    //SBO_Application.MessageBox("Mudou Proj Apresentação.");
                }
                if (!pVal.Before_Action && (EventEnum == SAPbouiCOM.BoEventTypes.et_COMBO_SELECT) & pVal.ItemChanged & (pVal.ItemUID == "Ent_Amb"))
                {
                    upEtvAmb = true;
                    //SBO_Application.MessageBox("Mudou Combo de Ambiente");
                }

                //Abre tela de Atividades.
                if (((pVal.ItemUID == "Ent_Age") & (pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) & (pVal.Before_Action == false)))
                {
                    bBotaoAgendarFoiClicado = true;
                    SBO_Application.ActivateMenuItem("2563");
                }

                //Abre tela de Atividades.
                if (((pVal.ItemUID == "Med_Age") & (pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) & (pVal.Before_Action == false)))
                {
                    bBotaoAgendarFoiClicado = true;
                    SBO_Application.ActivateMenuItem("2563");
                }

                //Clique do Botão Atualizar
                if (((pVal.ItemUID == "1") & (pVal.FormMode == 1) & (pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) & (pVal.Before_Action == false)))
                {
                    if (ambiente.possuiAmbientesCadastrados())
                    {
                       Atualizar();
                    }
                }

                //Criar os campos do formulario.
                if (pVal.Before_Action && pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD)
                {
                    oForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);

                    AddItemsToForm();

                    oForm.Resize(300, 130);// (132, 100);

                    resumo = new Resumo(oForm);
                    fases = new Fases(oForm);
                }

                //Evento do Clique da aba Resumo.
                if (pVal.ItemUID == "Projeto1" & (pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED || pVal.EventType == SAPbouiCOM.BoEventTypes.et_CLICK) & pVal.Before_Action)
                {
                    resumo.disableCampos();
                    oForm.PaneLevel = 8;
                }

                //Evento do Clique da aba Fases.
                if (pVal.ItemUID == "Projeto2" & (pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED || pVal.EventType == SAPbouiCOM.BoEventTypes.et_CLICK) & pVal.Before_Action)
                {
                    oForm.PaneLevel = 9;
                }

                int panel = 9;
                if (pVal.ItemUID.StartsWith("Folder") & (pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED || pVal.EventType == SAPbouiCOM.BoEventTypes.et_CLICK) & pVal.Before_Action)
                {
                    switch (pVal.ItemUID)
                    {
                        case "Folder1": panel = 9;
                            break;
                        case "Folder2": panel = 10;
                            break;
                        case "Folder3": panel = 11;
                            break;
                        case "Folder4": panel = 12;
                            break;
                        case "Folder5": panel = 13;
                            break;
                        case "Folder6": panel = 14;
                            break;
                        case "Folder7": panel = 15;
                            break;
                        case "Folder8": panel = 16;
                            break;
                        case "Folder9": panel = 17;
                            break;
                    }

                    oForm.PaneLevel = panel;
                }

                if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST)
                {
                    SAPbouiCOM.IChooseFromListEvent oCFLEvento = ((SAPbouiCOM.IChooseFromListEvent)(pVal));
                    string sCFL_ID = oCFLEvento.ChooseFromListUID;
                    SAPbouiCOM.Form oForm = SBO_Application.Forms.Item(FormUID);
                    SAPbouiCOM.ChooseFromList oCFL = oForm.ChooseFromLists.Item(sCFL_ID);

                    if (oCFLEvento.BeforeAction == false && sCFL_ID == "CFL1")
                    {
                        SAPbouiCOM.DataTable oDataTable = oCFLEvento.SelectedObjects;
                        string valItemName = null;
                        string valItemCode = null;
                        try
                        {
                            valItemCode = System.Convert.ToString(oDataTable.GetValue(0, 0));
                            valItemName = System.Convert.ToString(oDataTable.GetValue(1, 0));

                            string qtdEstoque = GetQtdEmEstoque(valItemCode);
                            ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C4").Cells.Item(pVal.Row).Specific).Value = qtdEstoque;

                            ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C0").Cells.Item(pVal.Row).Specific).Value = valItemCode;
                            ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C1").Cells.Item(pVal.Row).Specific).Value = valItemName;
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                    else if (oCFLEvento.BeforeAction == false && sCFL_ID == "CFL2")
                    {
                        SAPbouiCOM.DataTable oDataTable = oCFLEvento.SelectedObjects;
                        string valCarName = null;
                        string idFornecedor = null;
                        try
                        {
                            idFornecedor = System.Convert.ToString(oDataTable.GetValue(0, 0));
                            valCarName = System.Convert.ToString(oDataTable.GetValue(1, 0));

                            ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C6").Cells.Item(pVal.Row).Specific).Value = idFornecedor;
                            ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C3").Cells.Item(pVal.Row).Specific).Value = valCarName;
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                }

                string coluna = pVal.ColUID;

                if (EventEnum == SAPbouiCOM.BoEventTypes.et_DOUBLE_CLICK && !pVal.BeforeAction)
                {
                    //Anexo de arquivo
                    if (coluna == "Ela_Amb_C7" || coluna == "Ela_Amb_C8" || coluna == "Ela_Amb_C9" || coluna == "Med_Amb_C1"
                                               || coluna == "Apv_Amb_C3" || coluna == "Ped_Amb_C7" || coluna == "Det_Amb_C7"
                                               || coluna == "Etg_Amb_C3" || coluna == "Mon_Amb_C3" || coluna == "Mon_Amb_C4"
                                               || coluna == "Mon_Amb_C5" || coluna == "Apv_Amb_C4" || coluna == "Ans_Amb_C0")
                    {
                        oNewItem = oForm.Items.Item(pVal.ItemUID);
                        oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));
                        oEditItem = (SAPbouiCOM.EditText)oMatrix.Columns.Item(coluna).Cells.Item(pVal.Row).Specific;

                        GridComAnexo(oEditItem);
                    }

                    //Url
                    if (coluna == "Ped_Amb_C8" && ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Ped_Amb_C8").Cells.Item(pVal.Row).Specific).Value != "")
                    {
                        newProcess = new Process();
                        string valor = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Ped_Amb_C8").Cells.Item(pVal.Row).Specific).Value;
                        info = new ProcessStartInfo(valor);
                        newProcess.StartInfo = info;
                        newProcess.Start();

                    }
                }

                if (EventEnum == SAPbouiCOM.BoEventTypes.et_LOST_FOCUS && !pVal.BeforeAction)
                {
                    if (coluna == "Cmp_Amb_C2")
                    {
                        oNewItem = oForm.Items.Item("Det_Cmp");
                        oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                        string qtd = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C2").Cells.Item(pVal.Row).Specific).String;
                        decimal teste = Convert.ToDecimal(qtd);
                        string estoque = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C4").Cells.Item(pVal.Row).Specific).String;
                        decimal teste2 = Convert.ToDecimal(estoque);
                        if (qtd != "" && teste > teste2)
                        {
                            SBO_Application.MessageBox("Sem ítens sufucintes no estoque");
                        }
                    }
                }

                //Evento da grid de ambiente/análise crítica.
                if (!pVal.BeforeAction && pVal.ItemUID == "Apr_Amb" && EventEnum == SAPbouiCOM.BoEventTypes.et_CLICK && pVal.ColUID == "#" && pVal.Row > 0)
                {

                    if (modificouAnsCritica)
                    {
                        SBO_Application.MessageBox("Vai atualizar");
                        Atualizar();
                        oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE;
                        modificouAnsCritica = false;
                    }

                    //Instancia a matriz de ambiente da aba apresentação.
                    oNewItem = oForm.Items.Item("Apr_Amb");
                    SAPbouiCOM.Matrix matrixApresentacao;
                    matrixApresentacao = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                    //Instancia a matriz de análise crítica da aba apresentação.
                    oNewItem = oForm.Items.Item("Ans_Amb");
                    SAPbouiCOM.Matrix matrixAnaliseCritica;
                    matrixAnaliseCritica = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                    //Pega a coluna onde vai setar os valores pra o ambiente na matriz de análise crítica.
                    oColumnsAnaliseCritica = matrixAnaliseCritica.Columns;
                    oColumnAnaliseCritica = oColumnsAnaliseCritica.Item("Ans_Amb_C0");

                    //Pega o id do ambiente e a descrição do ambiente.
                    oEditItem = (SAPbouiCOM.EditText)matrixApresentacao.Columns.Item("Apr_Amb_C2").Cells.Item(pVal.Row).Specific;
                    SAPbouiCOM.EditText oItemGrid = (SAPbouiCOM.EditText)matrixApresentacao.Columns.Item("Apr_Amb_C0").Cells.Item(pVal.Row).Specific;
                    idAmbiente = int.Parse(oEditItem.String);
                    string nomeGrid = oItemGrid.String;

                    //Mostra na matriz de análise crítica qual ambiente selecionado.
                    oColumnAnaliseCritica.TitleObject.Caption = "Analise Crítica (" + nomeGrid + ")";
                    LoadGridAnaliseCritica();
                    countMatrixAnaliseCriticaAntes = matrixAnaliseCritica.RowCount;

                    if (matrixAnaliseCritica.RowCount == 0)
                    {
                        matrixAnaliseCritica.AddRow(1, 1);
                    }
                }
                //Evento da grid de ambiente/análise crítica.
                if (!pVal.BeforeAction && pVal.ItemUID == "Ans_Amb" && EventEnum == SAPbouiCOM.BoEventTypes.et_KEY_DOWN && pVal.ColUID == "Ans_Amb_C0" && pVal.CharPressed == 9)
                {
                    oNewItem = oForm.Items.Item("Ans_Amb");
                    SAPbouiCOM.Matrix matrixAnaliseCritica;
                    matrixAnaliseCritica = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                    oEditItem = (SAPbouiCOM.EditText)matrixAnaliseCritica.Columns.Item("Ans_Amb_C0").Cells.Item(matrixAnaliseCritica.RowCount).Specific;
                    string nome = oEditItem.String;

                    if (matrixAnaliseCritica.RowCount > 0 && nome != "")
                    {
                        matrixAnaliseCritica.AddRow(1, matrixAnaliseCritica.RowCount + 1);
                        ((SAPbouiCOM.EditText)matrixAnaliseCritica.Columns.Item("Ans_Amb_C0").Cells.Item(matrixAnaliseCritica.RowCount).Specific).Value = "";
                        ((SAPbouiCOM.EditText)matrixAnaliseCritica.Columns.Item("Ans_Amb_C1").Cells.Item(matrixAnaliseCritica.RowCount).Specific).Value = "";
                    }
                }

                if (pVal.ItemUID == "Ans_Amb" && pVal.ColUID == "Ans_Amb_C0" && pVal.ItemChanged && !pVal.BeforeAction)
                {
                    SBO_Application.MessageBox("Teste");
                    modificouAnsCritica = true;
                }

                if (!pVal.BeforeAction && pVal.ItemUID == "Fab_Amb" && EventEnum == SAPbouiCOM.BoEventTypes.et_CLICK && pVal.ColUID == "Fab_#" && pVal.Row > 0)
                {
                    if (bGravouAvarias)
                    {
                        SBO_Application.MessageBox("Vai atualizar Avarias");
                        Atualizar();
                        oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE;
                        bGravouAvarias = false;
                    }

                    oNewItem = oForm.Items.Item("Fab_Amb");
                    SAPbouiCOM.Matrix matrixFabrica;
                    matrixFabrica = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                    oNewItem = oForm.Items.Item("Ava_Amb");
                    SAPbouiCOM.Matrix matrixAvarias;
                    matrixAvarias = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                    SAPbouiCOM.Columns oColumnsAvarias = null;
                    SAPbouiCOM.Column oColumnAvarias = null;
                    oColumnsAvarias = matrixAvarias.Columns;
                    oColumnAvarias = oColumnsAvarias.Item("Ava_Amb_C0");

                    //Pega o id do ambiente e a descrição do ambiente.
                    oEditItem = (SAPbouiCOM.EditText)matrixFabrica.Columns.Item("Fab_Amb_C4").Cells.Item(pVal.Row).Specific;
                    SAPbouiCOM.EditText oItemGrid = (SAPbouiCOM.EditText)matrixFabrica.Columns.Item("Fab_Amb_C0").Cells.Item(pVal.Row).Specific;
                    iRowAmbiente = int.Parse(oEditItem.String);
                    string nomeGrid = oItemGrid.String;

                    oColumnAvarias.TitleObject.Caption = "Descrição (" + nomeGrid + ")";
                    LoadGridAvarias();
                    countMatrixAvariasAntes = matrixAvarias.RowCount;

                    if (matrixAvarias.RowCount == 0)
                    {
                        matrixAvarias.AddRow(1, 1);
                    }
                }

                if (!pVal.BeforeAction && pVal.ItemUID == "Ava_Amb" && EventEnum == SAPbouiCOM.BoEventTypes.et_KEY_DOWN && pVal.ColUID == "Ava_Amb_C0" && pVal.CharPressed == 9)
                {
                    oNewItem = oForm.Items.Item("Ava_Amb");
                    SAPbouiCOM.Matrix matrixAvarias;
                    matrixAvarias = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                    oEditItem = (SAPbouiCOM.EditText)matrixAvarias.Columns.Item("Ava_Amb_C0").Cells.Item(matrixAvarias.RowCount).Specific;
                    string nome = oEditItem.String;

                    if (matrixAvarias.RowCount > 0 && nome != "")
                    {
                        matrixAvarias.AddRow(1, matrixAvarias.RowCount + 1);
                        ((SAPbouiCOM.EditText)matrixAvarias.Columns.Item("Ava_Amb_C0").Cells.Item(matrixAvarias.RowCount).Specific).Value = "";
                        ((SAPbouiCOM.EditText)matrixAvarias.Columns.Item("Ava_Amb_C1").Cells.Item(matrixAvarias.RowCount).Specific).Value = "";
                    }
                }

                if (pVal.ItemUID == "Ava_Amb" && pVal.ColUID == "Ava_Amb_C0" && pVal.ItemChanged && !pVal.BeforeAction)
                {
                    SBO_Application.MessageBox("Teste Avarias");
                    bGravouAvarias = true;
                }

                //Evento da grid de ambiente/conferência medições.
                if (!pVal.BeforeAction && pVal.ItemUID == "Med_Amb" && EventEnum == SAPbouiCOM.BoEventTypes.et_CLICK && pVal.ColUID == "#" && pVal.Row > 0)
                {
                    //Instancia a matriz de ambiente da aba medições.
                    oNewItem = oForm.Items.Item("Med_Amb");
                    SAPbouiCOM.Matrix matrixMedicoes;
                    matrixMedicoes = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                    //Instancia a matriz de conferência medições da aba medições.
                    oNewItem = oForm.Items.Item("Med_Cnf");
                    SAPbouiCOM.Matrix matrixConferenciaMedicoes;
                    matrixConferenciaMedicoes = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                    //Pega a coluna onde vai setar os valores para o ambiente na matriz de conferência medições.
                    oColumnsConferenciaMedicoes = matrixConferenciaMedicoes.Columns;
                    oColumnConferenciaMedicoes = oColumnsConferenciaMedicoes.Item("med_Cnf_C1");

                    //Pega o id do ambiente e a descrição do ambiente.
                    oEditItem = (SAPbouiCOM.EditText)matrixMedicoes.Columns.Item("Med_Amb_C2").Cells.Item(pVal.Row).Specific;
                    SAPbouiCOM.EditText oItemGrid = (SAPbouiCOM.EditText)matrixMedicoes.Columns.Item("Med_Amb_C0").Cells.Item(pVal.Row).Specific;
                    iIdAmbienteMedicao = int.Parse(oEditItem.String);
                    string nomeGrid = oItemGrid.String;

                    //Mostra na matriz de conferência medições qual ambiente selecionado.
                    oColumnConferenciaMedicoes.TitleObject.Caption = "Conferente (" + nomeGrid + ")";
                    LoadGridConferenciaMedicao();
                    countMatrixConfMedAntes = matrixConferenciaMedicoes.RowCount;

                    if (matrixConferenciaMedicoes.RowCount == 0)
                    {
                        matrixConferenciaMedicoes.AddRow(1, 1);
                        //Projetistas - Grid Conferencia de Medicao
                        loadComboEmGrid("Med_Cnf", "med_Cnf_C1", projetistas);
                    }
                }
                //Evento da grid de ambiente/conferência medições.
                if (pVal.CharPressed == 9 && !pVal.BeforeAction && pVal.ItemUID == "Med_Cnf" && EventEnum == SAPbouiCOM.BoEventTypes.et_KEY_DOWN && pVal.ColUID == "med_Cnf_C1")
                {
                    oNewItem = oForm.Items.Item("Med_Cnf");
                    SAPbouiCOM.Matrix matrixConferenciaMedicao;
                    matrixConferenciaMedicao = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                    oEditItem = (SAPbouiCOM.EditText)matrixConferenciaMedicao.Columns.Item("Med_Cnf_C0").Cells.Item(matrixConferenciaMedicao.RowCount).Specific;
                    string data = oEditItem.String;
                    SAPbouiCOM.ComboBox combo = (SAPbouiCOM.ComboBox)matrixConferenciaMedicao.Columns.Item("med_Cnf_C1").Cells.Item(matrixConferenciaMedicao.RowCount).Specific;
                    string nome = combo.Value;

                    if (matrixConferenciaMedicao.RowCount > 0 && data != "" && nome != "")
                    {
                        matrixConferenciaMedicao.AddRow(1, matrixConferenciaMedicao.RowCount + 1);
                        ((SAPbouiCOM.EditText)matrixConferenciaMedicao.Columns.Item("Med_Cnf_C0").Cells.Item(matrixConferenciaMedicao.RowCount).Specific).Value = "";
                        //Projetistas - Grid Conferencia de Medicao
                        RemoveValoresDeCombo(ref combo);
                        loadComboEmGrid("Med_Cnf", "med_Cnf_C1", projetistas);
                        ((SAPbouiCOM.ComboBox)matrixConferenciaMedicao.Columns.Item("med_Cnf_C1").Cells.Item(matrixConferenciaMedicao.RowCount).Specific).Select("", SAPbouiCOM.BoSearchKey.psk_ByValue);
                        ((SAPbouiCOM.EditText)matrixConferenciaMedicao.Columns.Item("Med_Cnf_C2").Cells.Item(matrixConferenciaMedicao.RowCount).Specific).Value = "";

                    }
                }

                //Evento da grid de Entrega
                if (!pVal.BeforeAction && pVal.ItemUID == "Etg_Amb" && EventEnum == SAPbouiCOM.BoEventTypes.et_CLICK && pVal.ColUID == "Etg_#" && pVal.Row > 0)
                {

                    if (modificouPendecia)
                    {
                        SBO_Application.MessageBox("Vai atualizar Pendencia");
                        Atualizar();
                        oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE;
                        modificouPendecia = false;
                    }

                    //Instancia a matriz de ambiente da aba apresentação.
                    oNewItem = oForm.Items.Item("Etg_Amb");
                    SAPbouiCOM.Matrix matrixEntrega;
                    matrixEntrega = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                    //Instancia a matriz de análise crítica da aba apresentação.
                    oNewItem = oForm.Items.Item("Pen_Amb");
                    SAPbouiCOM.Matrix matrixPendencia;
                    matrixPendencia = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                    //Pega a coluna onde vai setar os valores pra o ambiente na matriz de Pendencia.
                    oColumnsPendencia = matrixPendencia.Columns;
                    oColumnPendencia = oColumnsPendencia.Item("Pen_Amb_C0");

                    //Pega o id do ambiente e a descrição do ambiente.
                    oEditItem = (SAPbouiCOM.EditText)matrixEntrega.Columns.Item("Etg_Amb_C6").Cells.Item(pVal.Row).Specific;
                    SAPbouiCOM.EditText oItemGrid = (SAPbouiCOM.EditText)matrixEntrega.Columns.Item("Etg_Amb_C0").Cells.Item(pVal.Row).Specific;
                    idAmbientePendencia = int.Parse(oEditItem.String);
                    string nomeAmbiente = oItemGrid.String;

                    //Mostra na matriz de Pendencia qual ambiente selecionado.
                    oColumnPendencia.TitleObject.Caption = "Ambiente (" + nomeAmbiente + ")";
                    LoadGridPendencias();
                    countMatrixPendenciaAntes = matrixPendencia.RowCount;

                    if (matrixPendencia.RowCount == 0)
                    {
                        matrixPendencia.AddRow(1, 1);
                    }
                }
                //Evento da grid de ambiente/análise crítica.
                if (!pVal.BeforeAction && pVal.ItemUID == "Pen_Amb" && EventEnum == SAPbouiCOM.BoEventTypes.et_KEY_DOWN && pVal.ColUID == "Pen_Amb_C0" && pVal.CharPressed == 9)
                {
                    oNewItem = oForm.Items.Item("Pen_Amb");
                    SAPbouiCOM.Matrix matrixPendencia;
                    matrixPendencia = ((SAPbouiCOM.Matrix)(oNewItem.Specific));

                    oEditItem = (SAPbouiCOM.EditText)matrixPendencia.Columns.Item("Pen_Amb_C0").Cells.Item(matrixPendencia.RowCount).Specific;
                    string nome = oEditItem.String;

                    if (matrixPendencia.RowCount > 0 && nome != "")
                    {
                        matrixPendencia.AddRow(1, matrixPendencia.RowCount + 1);
                        ((SAPbouiCOM.EditText)matrixPendencia.Columns.Item("Pen_Amb_C0").Cells.Item(matrixPendencia.RowCount).Specific).Value = "";
                        ((SAPbouiCOM.EditText)matrixPendencia.Columns.Item("Pen_Amb_C1").Cells.Item(matrixPendencia.RowCount).Specific).Value = "";
                    }
                }

                if (pVal.ItemUID == "Pen_Amb" && pVal.ColUID == "Pen_Amb_C0" && pVal.ItemChanged && !pVal.BeforeAction)
                {
                    SBO_Application.MessageBox("Teste Pendencia");
                    modificouPendecia = true;
                }
            }

            if (pVal.FormType == 651)
            {
                if (pVal.EventType != SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD)
                {
                    oFormAtual = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);

                    if (pVal.ItemUID == "Ata_Ativ" & pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED & !pVal.Before_Action)
                    {
                        abrirRelatorio("Ata de reuniao", oFormAtual.Items.Item("5").Specific.Value);
                    }

                    if (!pVal.Before_Action && (pVal.EventType == SAPbouiCOM.BoEventTypes.et_COMBO_SELECT) & pVal.ItemChanged & (pVal.ItemUID == "67"))
                    {
                        if (oFormAtual.Items.Item("67").Specific.Value == "M")
                        {
                            atividade.habilitaBotaoAta();
                        }
                        else
                        {
                            atividade.desabilitaBotaoAta();
                        }
                    }

                    if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD)
                    {

                        if (pVal.Before_Action)
                        {
                            atividade = new Atividade(oFormAtual);
                        }

                        if (bBotaoAgendarFoiClicado)
                        {
                            oFormPai = SBO_Application.Forms.GetFormByTypeAndCount(320, iUltimoFormTypeCount_SalesOpportunities);

                            sSalesOpportunities_Id = ((SAPbouiCOM.EditText)oFormPai.Items.Item("74").Specific).Value;
                            sBPCode = ((SAPbouiCOM.EditText)oFormPai.Items.Item("9").Specific).Value;

                            oFormAtual = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);

                            ((SAPbouiCOM.EditText)oFormAtual.Items.Item("9").Specific).Value = sBPCode;

                            bBotaoAgendarFoiClicado = false;
                        }
                    }
                }
            }
        }
コード例 #39
0
        private void SBO_Application_MenuEvent(ref SAPbouiCOM.MenuEvent pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;

            //Matrix de Conferencia de Medicao
            if (pVal.MenuUID == "AddRowMatrixConf" && pVal.BeforeAction == true)
            {
                oNewItem = oForm.Items.Item("Med_Cnf");
                oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));
                oColumns = oMatrix.Columns;
                int numeroLinhas = oMatrix.RowCount;
                oMatrix.AddRow(1, numeroLinhas + 1);
                ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Med_Cnf_C0").Cells.Item(oMatrix.RowCount).Specific).Value = "";
                //((SAPbouiCOM.EditText)oMatrix.Columns.Item("med_Cnf_C1").Cells.Item(oMatrix.RowCount).Specific).Value = "";
            }

            //Matrix de Conferencia de Avarias
            if (pVal.MenuUID == "AddRowMatrixAvr" && pVal.BeforeAction == true)
            {
                oNewItem = oForm.Items.Item("Ava_Amb");
                oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));
                oColumns = oMatrix.Columns;
                int numeroLinhas = oMatrix.RowCount;
                oMatrix.AddRow(1, numeroLinhas + 1);
                ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Ava_Amb_C0").Cells.Item(oMatrix.RowCount).Specific).Value = "";
            }

            //Matrix de Conferencia de Avarias
            if (pVal.MenuUID == "AddRowMatrixPend" && pVal.BeforeAction == true)
            {
                oNewItem = oForm.Items.Item("Pen_Amb");
                oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));
                oColumns = oMatrix.Columns;
                int numeroLinhas = oMatrix.RowCount;
                oMatrix.AddRow(1, numeroLinhas + 1);
                ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Pen_Amb_C0").Cells.Item(oMatrix.RowCount).Specific).Value = "";
            }

            //Matrix de Itens Complementares
            if (pVal.MenuUID == "AddRowMatrixIt" && pVal.BeforeAction == true)
            {
                oNewItem = oForm.Items.Item("Det_Cmp");
                oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));
                oColumns = oMatrix.Columns;
                int numeroLinhas = oMatrix.RowCount;
                oMatrix.AddRow(1, numeroLinhas + 1);
                ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C0").Cells.Item(oMatrix.RowCount).Specific).Value = "";
                ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C1").Cells.Item(oMatrix.RowCount).Specific).Value = "";
                ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C4").Cells.Item(oMatrix.RowCount).Specific).Value = "0.000000";
                ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C2").Cells.Item(oMatrix.RowCount).Specific).Value = "0.000000";
                ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C6").Cells.Item(oMatrix.RowCount).Specific).Value = "";
                ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C3").Cells.Item(oMatrix.RowCount).Specific).Value = "";
                ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C5").Cells.Item(oMatrix.RowCount).Specific).Value = "";
                ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C7").Cells.Item(oMatrix.RowCount).Specific).Value = "";

                oMatrix.FlushToDataSource();
            }
        }
コード例 #40
0
        public void Atualizar()
        {
            SAPbouiCOM.EditText oEdit = null;
            SAPbouiCOM.ComboBox oCombo = null;

            string etvProjetista = "";
            string apsProjetista = "";
            string medProjetista = "";
            string logradouro, numero, complemento, bairro, cidade, uf, pontoRef, etvData, etvHora, etvPrevisao, apsData, apsHora,
                medData, medHora, idOOPR = null;

            idOOPR = ((SAPbouiCOM.EditText)oForm.Items.Item("74").Specific).Value;

            oItem = oForm.Items.Item("End_Log");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            logradouro = oEdit.String;

            oItem = oForm.Items.Item("End_Num");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            numero = oEdit.String;

            oItem = oForm.Items.Item("End_Com");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            complemento = oEdit.String;

            oItem = oForm.Items.Item("End_Bai");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            bairro = oEdit.String;

            oItem = oForm.Items.Item("End_Cid");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            cidade = oEdit.String;

            oItem = oForm.Items.Item("End_UF");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            uf = oEdit.String;

            oItem = oForm.Items.Item("End_Ref");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            pontoRef = oEdit.String;

            //Abas Fases Entrevista
            oItem = oForm.Items.Item("Ent_Data");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            etvData = oEdit.String;

            oItem = oForm.Items.Item("Ent_Hora");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            etvHora = oEdit.String;

            if (upProjEnt)
            {
                oItem = oForm.Items.Item("Ent_Proj");
                oCombo = ((SAPbouiCOM.ComboBox)(oItem.Specific));
                etvProjetista = oCombo.Value;
                upProjEnt = false;
            }
            else
                etvProjetista = "0";

            oItem = oForm.Items.Item("Ent_Prev");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            etvPrevisao = oEdit.String;

            //Abas - Fase Apresentação

            oItem = oForm.Items.Item("Apr_Data");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            apsData = oEdit.String;

            oItem = oForm.Items.Item("Apr_Hora");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            apsHora = oEdit.String;

            if (upProjAps)
            {
                oItem = oForm.Items.Item("Apr_Proj");
                oCombo = ((SAPbouiCOM.ComboBox)(oItem.Specific));
                apsProjetista = oCombo.Value;
                upProjAps = false;
            }
            else
                apsProjetista = "0";

            //Aba - Fase Medição

            oItem = oForm.Items.Item("Med_Data");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            medData = oEdit.String;

            oItem = oForm.Items.Item("Med_Hora");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            medHora = oEdit.String;

            if (upProjMed)
            {
                oItem = oForm.Items.Item("Med_Proj");
                oCombo = ((SAPbouiCOM.ComboBox)(oItem.Specific));
                medProjetista = oCombo.Value;
                upProjMed = false;
            }
            else
                medProjetista = "0";

            int etvAmbiente = 0;
            if (upEtvAmb)
            {
                oItem = oForm.Items.Item("Ent_Amb");
                oCombo = ((SAPbouiCOM.ComboBox)(oItem.Specific));
                //if (oCombo.ValidValues.Count == 0)
                if (oCombo.Value != "")
                {
                    try
                    {
                        etvAmbiente = Convert.ToInt32(oCombo.Value);
                    }
                    catch
                    {
                    }
                }
            }

            string descAmb = null;
            oItem = oForm.Items.Item("Ent_Det");
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            descAmb = oEdit.String;

            //Conferencia de Medições
            oNewItem = oForm.Items.Item("Med_Cnf");
            oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));
            string data = null;
            string conferente = null;

            for (int i = 1; i <= oMatrix.RowCount; i++)
            {
                if (countMatrixConfMedAntes >= i)
                {
                    data = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Med_Cnf_C0").Cells.Item(i).Specific).String;
                    conferente = ((SAPbouiCOM.ComboBox)oMatrix.Columns.Item("med_Cnf_C1").Cells.Item(i).Specific).Value;

                    //string codeMed = GetIdConferenciaMedicaoParaUpdate(ListDataConfMed[i - 1].ToString(), Convert.ToInt32(idOOPR), ListConferenteCofMed[i - 1].ToString(), iIdAmbienteMedicao);
                    string codeMed = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Med_Cnf_C2").Cells.Item(i).Specific).String; ;

                    if (data != "" && conferente != "")
                        UpdateConferenciaDeMedicao(codeMed, codeMed, int.Parse(idOOPR), data, conferente, iIdAmbienteMedicao);
                }
                else
                {
                    data = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Med_Cnf_C0").Cells.Item(i).Specific).String;
                    conferente = ((SAPbouiCOM.ComboBox)oMatrix.Columns.Item("med_Cnf_C1").Cells.Item(i).Specific).Value;
                    if (data != "" && conferente != "")
                        AddConferenciaDeMedicao(int.Parse(idOOPR), data, conferente, iIdAmbienteMedicao);
                }
            }

            //Adiciona o anexo da medição.
            AddAnexoMedicao(Convert.ToInt32(idOOPR));

            //Adiciona Avarias
            oNewItem = oForm.Items.Item("Ava_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));
            string descricao = null;

            for (int i = 1; i <= oMatrix.RowCount; i++)
            {
                descricao = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Ava_Amb_C0").Cells.Item(i).Specific).Value;
                if (countMatrixAvariasAntes >= i)
                {
                    string codeAvarias = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Ava_Amb_C1").Cells.Item(i).Specific).Value; ; //GetIdAvariasParaUpdate(ListNomeAvarias[i - 1].ToString(), Convert.ToInt32(idOOPR), iIdAmbiente);

                    UpdateAvarias(codeAvarias, codeAvarias, int.Parse(idOOPR), descricao, iRowAmbiente);
                }
                else
                {
                    AddAvarias(int.Parse(idOOPR), descricao, iRowAmbiente);
                }
            }

            //Adiciona Pendencias
            oNewItem = oForm.Items.Item("Pen_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));
            string descricaoPend = null;
            string idPendencia = null;

            for (int i = 1; i <= oMatrix.RowCount; i++)
            {
                if (countMatrixPendenciaAntes >= i)
                {
                    descricaoPend = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Pen_Amb_C0").Cells.Item(i).Specific).Value;
                    idPendencia = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Pen_Amb_C1").Cells.Item(i).Specific).Value;
                    UpdatePendencias(descricaoPend, idPendencia);
                }
                else
                {
                    descricaoPend = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Pen_Amb_C0").Cells.Item(i).Specific).Value;
                    AddPendencias(Convert.ToInt32(idOOPR), descricaoPend, idAmbientePendencia);
                }
            }

            //Adiciona Analise Critica
            oNewItem = oForm.Items.Item("Ans_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));
            string txtAnexo = null;
            string idAnaliseCritica = null;

            for (int i = 1; i <= oMatrix.RowCount; i++)
            {
                if (countMatrixAnaliseCriticaAntes >= i)
                {
                    txtAnexo = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Ans_Amb_C0").Cells.Item(i).Specific).Value;
                    idAnaliseCritica = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Ans_Amb_C1").Cells.Item(i).Specific).Value;
                    UpdateAnaliseCritica(txtAnexo, idAnaliseCritica);
                }
                else
                {
                    txtAnexo = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Ans_Amb_C0").Cells.Item(i).Specific).Value;
                    AddAnaliseCritica(Convert.ToInt32(idOOPR), idAmbiente, txtAnexo);
                }

                if (i == oMatrix.RowCount)
                {
                    LoadGridAnaliseCritica();
                }
            }

            //Adiciona Itens Complementares
            oNewItem = oForm.Items.Item("Det_Cmp");
            oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));
            string idOITM = null;
            string idOCRD = null;
            string qtd = null;
            string observacao = null;
            string idItensComplementares = null;

            for (int i = 1; i <= oMatrix.RowCount; i++)
            {
                if (countMatrixItensComplementaresAntes >= i)
                {
                    idOITM = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C0").Cells.Item(i).Specific).String;
                    idOCRD = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C6").Cells.Item(i).Specific).Value;
                    qtd = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C2").Cells.Item(i).Specific).Value;
                    observacao = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C5").Cells.Item(i).Specific).Value;
                    idItensComplementares = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C7").Cells.Item(i).Specific).String;
                    UpdateItensComplementares(idOITM, idOCRD, qtd, observacao, idItensComplementares);
                }
                else
                {
                    idOITM = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C0").Cells.Item(i).Specific).String;
                    idOCRD = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C6").Cells.Item(i).Specific).Value;
                    qtd = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C2").Cells.Item(i).Specific).Value;
                    observacao = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Cmp_Amb_C5").Cells.Item(i).Specific).Value;

                    AddItensComplementares(Convert.ToInt32(idOOPR), idOITM, idOCRD, qtd, observacao);
                }

                if (i == oMatrix.RowCount)
                {
                    //LoadGridAnaliseCritica();
                }
            }

            //Update Itens Complementares (Aba Montagem)
            oNewItem = oForm.Items.Item("Mon_Itc");
            oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));
            string prazoEntrega = null;
            string solicitante = null;
            bool recebido = false;
            int check = 0;

            for (int i = 1; i <= oMatrix.RowCount; i++)
            {
                prazoEntrega = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Itc_Amb_C5").Cells.Item(i).Specific).String;
                solicitante = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Itc_Amb_C6").Cells.Item(i).Specific).String;
                recebido = ((SAPbouiCOM.CheckBox)oMatrix.Columns.Item("Itc_Amb_C7").Cells.Item(i).Specific).Checked;
                idItensComplementares = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Itc_Amb_10").Cells.Item(i).Specific).String;

                if (recebido)
                {
                    check = 1;
                }
                else
                {
                    check = 0;
                }

                UpdateItensComplementares(idItensComplementares, prazoEntrega, solicitante, check);
                LoadGridItensComplementares();
            }

            AddOportunidadeVendas(Convert.ToInt32(idOOPR), etvProjetista, medProjetista, apsProjetista, etvAmbiente, descAmb);
        }
コード例 #41
0
 private void ContarLinhasIniciaisMatrixMedicoes()
 {
     //Conferência de Medições
     oNewItem = oForm.Items.Item("Med_Cnf");
     oMatrix = ((SAPbouiCOM.Matrix)(oNewItem.Specific));
     countMatrixConfMedAntes = oMatrix.RowCount;
     ListDataConfMed.Clear();
     ListConferenteCofMed.Clear();
     for (int i = 1; i <= oMatrix.RowCount; i++)
     {
         ListDataConfMed.Add(((SAPbouiCOM.EditText)oMatrix.Columns.Item("Med_Cnf_C0").Cells.Item(i).Specific).String);
         ListConferenteCofMed.Add(((SAPbouiCOM.EditText)oMatrix.Columns.Item("med_Cnf_C1").Cells.Item(i).Specific).String);
     }
 }
コード例 #42
0
        public void loadComboEmGrid(string matrix, string combo, SAPbobsCOM.Recordset valores)
        {
            oMatrix = checked((SAPbouiCOM.Matrix)oForm.Items.Item(matrix).Specific);
            SAPbouiCOM.ComboBox oCombo = checked((SAPbouiCOM.ComboBox)oMatrix.Columns.Item(combo).Cells.Item(1).Specific);
            RemoveValoresDeCombo(ref oCombo);

            oCombo.ValidValues.Add("", "");

            int RecCount = valores.RecordCount;
            valores.MoveFirst();

            for (int RecIndex = 0; RecIndex <= RecCount - 1; RecIndex++)
            {
                oCombo.ValidValues.Add(Convert.ToString(valores.Fields.Item(0).Value), Convert.ToString(valores.Fields.Item(1).Value));
                valores.MoveNext();
            }
        }
コード例 #43
0
        private void LoadGridConferenciaMedicao()
        {
            string OpID = null;

            oForm.DataSources.DataTables.Item("oDataTable").Clear();
            oItem = oForm.Items.Item("74");
            oEditItem = ((SAPbouiCOM.EditText)(oItem.Specific));
            OpID = oEditItem.Value;
            oForm.DataSources.DataTables.Item("oDataTable").ExecuteQuery("select * from [@FLX_FB_CONFMED] where U_FLX_FB_CONFMED_ID = '" + OpID + "' and U_FLX_FB_CONFMED_IDA = '" + iIdAmbienteMedicao.ToString() + "'");

            oItem = oForm.Items.Item("Med_Cnf");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();
        }
コード例 #44
0
        private void LoadGridAvarias()
        {
            string OpID = null;

            oForm.DataSources.DataTables.Item("oDataTableAvr").Clear();
            oItem = oForm.Items.Item("74");
            oEditItem = ((SAPbouiCOM.EditText)(oItem.Specific));
            OpID = oEditItem.Value;
            oForm.DataSources.DataTables.Item("oDataTableAvr").ExecuteQuery("select * from [@FLX_FB_AVR] where U_FLX_FB_AVR_IDOOPR = '" + OpID + "' and U_FLX_FB_AVR_IDAMBI = '" + iRowAmbiente.ToString() + "'");

            oItem = oForm.Items.Item("Ava_Amb");
            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
            oMatrix.LoadFromDataSource();
        }
コード例 #45
0
        /// <summary>
        /// Initialize components. Called by framework after form created.
        /// </summary>
        public override void OnInitializeComponent()
        {
            this.mtxItems = ((SAPbouiCOM.Matrix)(this.GetItem("mtxItems").Specific));
            this.txtDocNo = ((SAPbouiCOM.EditText)(this.GetItem("txtDocNo").Specific));
            this.dtTransferItemLines = this.UIAPIRawForm.DataSources.DBDataSources.Item(string.Format("@{0}", TableNames.TransferItemsLines));
            this.dpDocDate = ((SAPbouiCOM.EditText)(this.GetItem("dpDocDate").Specific));
            this.mtxItems.ChooseFromListBefore += new SAPbouiCOM._IMatrixEvents_ChooseFromListBeforeEventHandler(this.mtxItems_ChooseFromListBefore);
            this.mtxItems.ChooseFromListAfter += new SAPbouiCOM._IMatrixEvents_ChooseFromListAfterEventHandler(this.mtxItems_ChooseFromListAfter);
            this.mtxItems.ClickBefore += new SAPbouiCOM._IMatrixEvents_ClickBeforeEventHandler(this.mtxItems_ClickBefore);
            this.btnSave = ((SAPbouiCOM.Button)(this.GetItem("1").Specific));
            this.btnSave.ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.btnSave_ClickBefore);
            this.btnSave.PressedBefore += new SAPbouiCOM._IButtonEvents_PressedBeforeEventHandler(this.btnSave_PressedBefore);
            this.btnCancel = ((SAPbouiCOM.Button)(this.GetItem("2").Specific));
            this.fldrItems = ((SAPbouiCOM.Folder)(this.GetItem("Item_5").Specific));
            this.fldrCosts = ((SAPbouiCOM.Folder)(this.GetItem("Item_6").Specific));
            this.mtxCost = ((SAPbouiCOM.Matrix)(this.GetItem("Item_7").Specific));
            this.mtxCost.ChooseFromListAfter += new SAPbouiCOM._IMatrixEvents_ChooseFromListAfterEventHandler(this.mtxCost_ChooseFromListAfter);
            this.mtxCost.ClickBefore += new SAPbouiCOM._IMatrixEvents_ClickBeforeEventHandler(this.mtxCost_ClickBefore);
            //this.btnCalculate = ((SAPbouiCOM.Button)(this.GetItem("btnClc").Specific));
            //this.btnCalculate.ClickAfter += new SAPbouiCOM._IButtonEvents_ClickAfterEventHandler(this.btnCalculate_ClickAfter);
            //this.btnCalculate.ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.btnCalculate_ClickBefore);
            this.btnAddRow = ((SAPbouiCOM.Button)(this.GetItem("btnAddRow").Specific));
            this.btnAddRow.ClickBefore += btnAddRow_ClickBefore;
            this.btnAddRow.ClickAfter += btnAddRow_ClickAfter;
            this.mtxItems.ValidateBefore += mtxItems_ValidateBefore;
            this.OnCustomInitialize();

        }