Exemplo n.º 1
0
        /// <summary>
        /// Initialize components. Called by framework after form created.
        /// </summary>
        public override void OnInitializeComponent()
        {
            this.fileSelector              = ((SAPbouiCOM.Button)(this.GetItem("btArq").Specific));
            this.fileSelector.ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.FileButton_ClickBefore);
            this.modulePath                       = ((SAPbouiCOM.EditText)(this.GetItem("edArquivo").Specific));
            this.installUpdateModule              = ((SAPbouiCOM.Button)(this.GetItem("btInst").Specific));
            this.installUpdateModule.ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.InstallUpdateModule_ClickBefore);
            this.moduleGrid                       = ((SAPbouiCOM.Grid)(this.GetItem("gridArq").Specific));
            this.removeButton                     = ((SAPbouiCOM.Button)(this.GetItem("btModu").Specific));
            this.removeButton.ClickAfter         += new SAPbouiCOM._IButtonEvents_ClickAfterEventHandler(this.RemoveButtom_ClickAfter);
            this.startButton                      = ((SAPbouiCOM.Button)(this.GetItem("btStart").Specific));
            this.startButton.ClickAfter          += new _IButtonEvents_ClickAfterEventHandler(startButton_ClickAfter);
            this.shutdownButton                   = ((SAPbouiCOM.Button)(this.GetItem("btStop").Specific));
            this.shutdownButton.ClickAfter       += new _IButtonEvents_ClickAfterEventHandler(shutdownButton_ClickAfter);
            this.installButton                    = ((SAPbouiCOM.Button)(this.GetItem("btInstall").Specific));
            this.installButton.ClickAfter        += new _IButtonEvents_ClickAfterEventHandler(installButton_ClickAfter);
            this.configTemp                       = this.UIAPIRawForm.DataSources.DataTables.Item("configTemp");
            this.moduleGrid.ClickAfter           += new _IGridEvents_ClickAfterEventHandler(moduleGrid_ClickAfter);

            ((ComboBoxColumn)moduleGrid.Columns.Item("Installed")).ValidValues.Add("Y", Messages.Yes);
            ((ComboBoxColumn)moduleGrid.Columns.Item("Installed")).ValidValues.Add("N", Messages.No);
            ((ComboBoxColumn)moduleGrid.Columns.Item("Installed")).DisplayType = BoComboDisplayType.cdt_Description;

            ((ComboBoxColumn)moduleGrid.Columns.Item("Status")).ValidValues.Add("R", Messages.AdminRunning);
            ((ComboBoxColumn)moduleGrid.Columns.Item("Status")).ValidValues.Add("S", Messages.AdminStopped);
            ((ComboBoxColumn)moduleGrid.Columns.Item("Status")).DisplayType = BoComboDisplayType.cdt_Description;

            moduleDT = moduleGrid.DataTable;

            // click on first tab.
            this.UIAPIRawForm.DataSources.UserDataSources.Item("Folders").Value = "1";
        }
        }//fin InitForm

        public new void FormEvent(String FormUID, ref SAPbouiCOM.ItemEvent pVal, ref Boolean BubbleEvent)
        {
            Int32  nErr;
            String sErr;

            base.FormEvent(FormUID, ref pVal, ref BubbleEvent);
            IvkFormInterface oFormB;
            String           oUid;

            try
            {
                if ((pVal.EventType == BoEventTypes.et_ITEM_PRESSED) && (!pVal.BeforeAction))
                {
                    if (pVal.ItemUID == "btn1")
                    {
                        oFormB            = (IvkFormInterface)(new TLibros());
                        TLibros.TipoLibro = "C";
                        oEditText         = (EditText)(oForm.Items.Item("Desde").Specific);
                        TLibros.Desde     = oEditText.Value;
                        oEditText         = (EditText)(oForm.Items.Item("Hasta").Specific);
                        TLibros.Hasta     = oEditText.Value;
                        oUid = FSBOf.generateFormId(FGlobalSettings.SBOSpaceName, FGlobalSettings);
                        oFormB.InitForm(oUid, "forms\\", ref FSBOApp, ref FCmpny, ref FSBOf, ref FGlobalSettings);
                        FoForms.Add(oFormB);
                    }
                }
            }
            catch (Exception e)
            {
                FCmpny.GetLastError(out nErr, out sErr);
                FSBOApp.StatusBar.SetText("FormEvent: " + e.Message + " ** Trace: " + e.StackTrace, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                OutLog("FormEvent: " + e.Message + " ** Trace: " + e.StackTrace);
            }
        }//fin FormEvent
        /// <summary>
        /// Inicializa los componentes de la forma activa
        /// </summary>
        public void inicializarComponentes()
        {
            try
            {
                _oForma      = _Application.Forms.Item(formID);
                _oForma.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE;
                _oForma.Freeze(true);

                //Tipo de dato fecha inicial
                _oForma.DataSources.UserDataSources.Add(TXT_FECHA_INICIAL, BoDataType.dt_DATE);
                _oTxtFechaInicial = (SAPbouiCOM.EditText)_oForma.Items.Item(TXT_FECHA_INICIAL).Specific;
                _oTxtFechaInicial.DataBind.SetBound(true, "", TXT_FECHA_INICIAL);

                //Tipo de dato fecha final
                _oForma.DataSources.UserDataSources.Add(TXT_FECHA_FINAL, BoDataType.dt_DATE);
                _oTxtFechaFinal = (SAPbouiCOM.EditText)_oForma.Items.Item(TXT_FECHA_FINAL).Specific;
                _oTxtFechaFinal.DataBind.SetBound(true, "", TXT_FECHA_FINAL);

                _oCmbOficinaVentas = (SAPbouiCOM.ComboBox)_oForma.Items.Item(CMB_OFICINA_VENTAS).Specific;
                _oCmbOficinaVentas.LlenarCargarOficinas(_Company, _oForma);
            }
            catch (Exception ex)
            {
                _Application.MessageBox("Error al inicializar: " + ex.Message);
            }
            finally
            {
                _oForma.Freeze(false);
            }
        }
Exemplo n.º 4
0
        private void InitiallizeForm()
        {
            Program.objHrmsUI.loadSettings();
            oForm.Freeze(true);



            dtHead    = oForm.DataSources.DataTables.Item("dtHead");
            dtSetting = oForm.DataSources.DataTables.Item("dtSetting");
            dtSetting.Rows.Add(1);
            mtAddon = (SAPbouiCOM.Matrix)oForm.Items.Item("mtAddon").Specific;

            txDfltExp = (SAPbouiCOM.EditText)oForm.Items.Item("txDfltExp").Specific;

            txUID     = (SAPbouiCOM.EditText)oForm.Items.Item("txUID").Specific;
            txPWD     = (SAPbouiCOM.EditText)oForm.Items.Item("txPWD").Specific;
            txINCCode = (SAPbouiCOM.EditText)oForm.Items.Item("txINCCode").Specific;
            txLTDCode = (SAPbouiCOM.EditText)oForm.Items.Item("txLTDCode").Specific;
            txINCDB   = (SAPbouiCOM.EditText)oForm.Items.Item("txINCDB").Specific;
            txLTDDB   = (SAPbouiCOM.EditText)oForm.Items.Item("txLTDDB").Specific;
            txTax     = (SAPbouiCOM.EditText)oForm.Items.Item("txTax").Specific;

            cflDE = oForm.ChooseFromLists.Item("cflDE");
            fillAddons();
            fillSettings();
            filtertocfl();

            oForm.Freeze(false);
        }
Exemplo n.º 5
0
        public override void etAfterClick(ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent)
        {
            base.etAfterClick(ref pVal, ref BubbleEvent);

            if (pVal.ItemUID == "1")
            {
            }
            if (pVal.ItemUID == "btPost")
            {
                postJe();
            }
            if (pVal.ItemUID == "mtJE")
            {
                if (pVal.Row <= mtJE.RowCount && pVal.Row > 0)
                {
                    SAPbouiCOM.EditText InvNum = mtJE.Columns.Item("#").Cells.Item(pVal.Row).Specific;
                    fillJeDetailHead(InvNum.Value.ToString(), pVal.Row);
                }
            }
            if (pVal.ItemUID == "lnkBG")
            {
                oApplication.OpenForm(BoFormObjectEnum.fo_UserDefinedObject, "ABGP", txDN.Value.ToString());
            }
            if (pVal.ItemUID == "optPP" || pVal.ItemUID == "optPC" || pVal.ItemUID == "optC")
            {
                fillJeGrid();
                fillJeDetailHead("0", 0);
            }
        }
Exemplo n.º 6
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);

            initiallizing = true;

            dtDoc  = oForm.DataSources.DataTables.Item("dtDoc");
            dtRow  = oForm.DataSources.DataTables.Item("dtRow");
            dtRpt  = oForm.DataSources.DataTables.Item("dtRpt");
            dtHead = oForm.DataSources.DataTables.Item("dtHead");
            dtSB   = oForm.DataSources.DataTables.Item("dtSB");

            dtHead.Rows.Add(1);
            mtDocs    = (SAPbouiCOM.Matrix)oForm.Items.Item("mtDocs").Specific;
            mtDocRows = (SAPbouiCOM.Matrix)oForm.Items.Item("mtDocRows").Specific;
            mtRpt     = (SAPbouiCOM.Matrix)oForm.Items.Item("mtRpt").Specific;
            mtSB      = (SAPbouiCOM.Matrix)oForm.Items.Item("mtSB").Specific;
            btAtt     = (SAPbouiCOM.Button)oForm.Items.Item("btAtt").Specific;

            txAtt = (SAPbouiCOM.EditText)oForm.Items.Item("txAtt").Specific;
            txAtt.Item.Enabled = false;
            getUserWHSAndOT();

            // oForm.Items.Item("btUpd").Enabled = false;
            oForm.Freeze(false);

            getDocs();
            initiallizing = false;
        }
Exemplo n.º 7
0
        private void InitiallizeForm()
        {
            Program.objHrmsUI.loadSettings();

            oForm.Freeze(true);

            initiallizing = true;


            mtWO = (SAPbouiCOM.Matrix)oForm.Items.Item("mtWO").Specific;
            mtOD = (SAPbouiCOM.Matrix)oForm.Items.Item("mtOD").Specific;

            lblStatus = (SAPbouiCOM.StaticText)oForm.Items.Item("lblStatus").Specific;
            dtRDR1    = oForm.DataSources.DataTables.Item("dtRDR1");
            dtORDR    = oForm.DataSources.DataTables.Item("dtORDR");
            dtHead    = oForm.DataSources.DataTables.Item("dtHead");
            dtCard    = oForm.DataSources.DataTables.Item("dtCard");
            dtWebO    = oForm.DataSources.DataTables.Item("dtWebO");

            cbOS = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbOS").Specific;
            cbOS.ValidValues.Add("01", "All");
            cbOS.ValidValues.Add("02", "Not Posted");
            cbOS.ValidValues.Add("03", "Posted");
            cbOS.Item.DisplayDesc = true;
            cbOS.Select("01", BoSearchKey.psk_ByValue);
            txCEmail  = (SAPbouiCOM.EditText)oForm.Items.Item("txCEmail").Specific;
            txCNCode  = (SAPbouiCOM.EditText)oForm.Items.Item("txCNCode").Specific;
            txCNTel   = (SAPbouiCOM.EditText)oForm.Items.Item("txCNTel").Specific;
            txCNEmail = (SAPbouiCOM.EditText)oForm.Items.Item("txCNEmail").Specific;
            txSName   = (SAPbouiCOM.EditText)oForm.Items.Item("txSName").Specific;
            txSSPO    = (SAPbouiCOM.EditText)oForm.Items.Item("txSSPO").Specific;
            txSCity   = (SAPbouiCOM.EditText)oForm.Items.Item("txSCity").Specific;
            txSState  = (SAPbouiCOM.EditText)oForm.Items.Item("txSState").Specific;
            txSZip    = (SAPbouiCOM.EditText)oForm.Items.Item("txSZip").Specific;
            txSPhone  = (SAPbouiCOM.EditText)oForm.Items.Item("txSPhone").Specific;
            txSEmail  = (SAPbouiCOM.EditText)oForm.Items.Item("txSEmail").Specific;

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



            txCTel  = (SAPbouiCOM.EditText)oForm.Items.Item("txCTel").Specific;
            txCCode = (SAPbouiCOM.EditText)oForm.Items.Item("txCCode").Specific;

            cbOS   = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbOS").Specific;
            btPost = (SAPbouiCOM.Button)oForm.Items.Item("btPost").Specific;
            btGet  = (SAPbouiCOM.Button)oForm.Items.Item("btGet").Specific;
            //   ini_controls();

            dtHead.Rows.Add(1);

            string INCCard = Program.objHrmsUI.getSetting("LTDCODE").ToString();

            dtHead.SetValue("CardCode", 0, INCCard);
            oForm.PaneLevel = 1;
            oForm.Freeze(false);

            initiallizing = false;
        }
Exemplo n.º 8
0
        /// <summary>
        /// Valida que los planes que cancelados tengan la inversión inicial en ceros
        /// </summary>
        /// <param name="_oForm">Forma activa</param>
        /// <returns>Mensaje de error</returns>
        private string ValidarStatusSolicitudGrid(Form _oForm)
        {
            try
            {
                string msgError = null;
                _oMatrixArticulos = _oForm.Items.Item(GRID_ARTICULOS).Specific;
                SAPbouiCOM.ComboBox _oCmbStatusSolicitud = null;
                SAPbouiCOM.EditText _oInversionIni       = null;
                SAPbouiCOM.EditText _oSolicitud          = null;

                for (int noLinea = 1; noLinea <= _oMatrixArticulos.RowCount; noLinea++)
                {
                    _oCmbStatusSolicitud = (SAPbouiCOM.ComboBox)_oMatrixArticulos.Columns.Item(COLUMNA_STATUS_DE_SOLICITUD).Cells.Item(noLinea).Specific;
                    _oInversionIni       = (SAPbouiCOM.EditText)_oMatrixArticulos.Columns.Item(COLUMNA_IVERSION_INICIAL).Cells.Item(noLinea).Specific;
                    _oSolicitud          = (SAPbouiCOM.EditText)_oMatrixArticulos.Columns.Item(COLUMNA_SERIE).Cells.Item(noLinea).Specific;

                    if (_oCmbStatusSolicitud.Selected.Value.Contains('N'))
                    {
                        if (Convert.ToDouble(_oInversionIni.Value) != 0)
                        {
                            return(msgError = "Monto de la inversión inicial debe estar en ceros " + Environment.NewLine +
                                              "Solicitud: " + _oSolicitud.Value.ToString() + Environment.NewLine + " Estatus: ERRONEO");
                        }
                    }

                    if (_oCmbStatusSolicitud.Selected.Value.Contains('C'))
                    {
                        if (Convert.ToDouble(_oInversionIni.Value) != 0)
                        {
                            return(msgError = "Monto de la inversión inicial deber estar en ceros " + Environment.NewLine +
                                              "Solicitud: " + _oSolicitud.Value.ToString() + Environment.NewLine + " Estatus: CANCELADO");
                        }
                    }

                    if (_oCmbStatusSolicitud.Selected.Value.Contains('A'))
                    {
                        if (Convert.ToDouble(_oInversionIni.Value) != 0)
                        {
                            return(msgError = "Monto de la inversión inicial deber estar en ceros " + Environment.NewLine +
                                              "Solicitud: " + _oSolicitud.Value.ToString() + Environment.NewLine + " Estatus: ATRACO");
                        }
                    }

                    if (_oCmbStatusSolicitud.Selected.Value.Contains('E'))
                    {
                        if (Convert.ToDouble(_oInversionIni.Value) != 0)
                        {
                            return(msgError = "Monto de la inversión inicial deber estar en ceros " + Environment.NewLine +
                                              "Solicitud: " + _oSolicitud.Value.ToString() + Environment.NewLine + " Estatus: EXTRAVIO");
                        }
                    }
                }
                return(msgError);
            }
            catch (Exception ex)
            {
                throw new Exception("Error al validar estatus de solicitudes del grid *ValidarStatusSolicitudGrid* : " + ex.Message);
            }
        }
        /// <summary>
        /// Ejecución de eventos de la forma activa
        /// </summary>
        /// <param name="FormUID">Nombre o ID de la forma</param>
        /// <param name="pVal">Propiedades de la forma</param>
        /// <param name="bubbleEvent">Evento</param>
        public override void eventos(string FormUID, ref ItemEvent pVal, out bool bubbleEvent)
        {
            bubbleEvent = true;
            try
            {
                if (pVal.FormUID == formID && pVal.BeforeAction == false)
                {
                    if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_CLOSE)
                    {
                        _Application.ItemEvent -= new SAPbouiCOM._IApplicationEvents_ItemEventEventHandler(SBO_Application_ItemEvent);
                        _Application.MenuEvent -= new SAPbouiCOM._IApplicationEvents_MenuEventEventHandler(SBO_Application_MenuEvent);
                        Dispose();
                        application           = null;
                        company               = null;
                        _oRptCorteSolicitudes = false;
                        Addon.typeList.RemoveAll(p => p._forma == formID);
                        return;
                    }

                    if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED)
                    {
                        if (pVal.ItemUID == BTN_CANCELAR)
                        {
                            _oForma.Close();
                        }

                        if (pVal.ItemUID == BTN_IMPRIMIR)
                        {
                            _oTxtFechaInicial  = _oForma.Items.Item(TXT_FECHA_INICIAL).Specific;
                            _oTxtFechaFinal    = _oForma.Items.Item(TXT_FECHA_FINAL).Specific;
                            _oCmbOficinaVentas = _oForma.Items.Item(CMB_OFICINA_VENTAS).Specific;
                            //_oTxtUsuario = _oForma.Items.Item(TXT_USUARIO).Specific;

                            if (ValidarCampos())
                            {
                                if (Extensor.ValidarImpresionCorteSolicitudes(_Company, _oCmbOficinaVentas.Selected.Value.ToString()))
                                {
                                    if (_Application.MessageBox("¿Desea generar el corte de solicitudes?", 2, "Si", "No") == 1)
                                    {
                                        if (ImprimirReporteCorteSolicitudes())
                                        {
                                            _Application.StatusBar.SetText("Generar reporte terminado correctamente...", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success);
                                        }
                                    }
                                }
                                else
                                {
                                    _Application.MessageBox("El reporte ya fue impreso");
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en evento *clsReporteOficinasContratos* : " + ex.Message);
            }
        }
Exemplo n.º 10
0
        public string postDocument(double amount)
        {
            string outStr = "";

            try
            {
                SAPbobsCOM.Documents        Doc = (SAPbobsCOM.Documents)Program.objHrmsUI.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices);
                SAPbobsCOM.BusinessPartners bp  = (SAPbobsCOM.BusinessPartners)Program.objHrmsUI.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners);

                SAPbouiCOM.EditText OWORDocNum = (SAPbouiCOM.EditText)oForm.Items.Item("18").Specific;
                string oworNum = OWORDocNum.Value.ToString();
                oworEntry = Convert.ToString(Program.objHrmsUI.getScallerValue("Select DocEntry from owor where docnum='" + oworNum + "'"));

                Doc.CardCode = txSupplier.Value.ToString();
                Doc.DocDate  = DateTime.ParseExact(txPostingDate.Value.ToString(), "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);
                //  Doc.DocDueDate = Convert.ToDateTime(dtORDR.GetValue("CCDate", 0));
                Doc.NumAtCard = txRef.Value.ToString();
                Doc.DocType   = BoDocumentTypes.dDocument_Service;

                Doc.Lines.AccountCode = txEA.Value.ToString();
                Doc.Lines.LineTotal   = amount;
                Doc.Lines.Add();


                try
                {
                    if (Doc.Add() != 0)
                    {
                        int    erroCode = 0;
                        string errDescr = "";
                        Program.objHrmsUI.oCompany.GetLastError(out erroCode, out errDescr);
                        outStr = "Error:" + errDescr + outStr;
                        oApplication.StatusBar.SetText("Failed to post Order : " + errDescr);
                    }
                    else
                    {
                        outStr = Convert.ToString(Program.objHrmsUI.oCompany.GetNewObjectKey());
                        string strUpdate = "Update OWOR set U_CostAP = '" + outStr + "' WHERE DocEntry = '" + oworEntry + "'";
                        Program.objHrmsUI.ExecQuery(strUpdate, "Marking AP");

                        oApplication.StatusBar.SetText("Sales AP Posted Successfully for ", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success);
                        oApplication.Menus.Item("1304").Activate();
                    }
                }
                catch (Exception ex)
                {
                    oApplication.StatusBar.SetText("Failed in Exec Query on Posting Document.  : " + ex.Message);
                }
                finally
                {
                }
            }
            catch (Exception ex)
            {
                oApplication.SetStatusBarMessage("Error in posting document : " + ex.Message);
            }
            return(outStr);
        }
Exemplo n.º 11
0
 /// <summary>
 /// Evento que se ejecuta cuando se encuentra un mensaje de status
 /// </summary>
 /// <param name="Text">Texto que se esta mostrando</param>
 /// <param name="messageType">Tipo de mensaje</param>
 private void SBO_Application_StatusBarEvent(string Text, BoStatusBarMessageType messageType)
 {
     try
     {
         if (Text.Contains("No se puede añadir fila") && messageType == BoStatusBarMessageType.smt_Warning)
         {
             if (_Application.Forms.ActiveForm.TypeEx == FRM_TRANSFERENCIA_DE_STOCK.ToString())
             {
                 if (_oForm.Mode == BoFormMode.fm_ADD_MODE)
                 {
                     lDatos.Clear();
                     _oMatrixArticulos = _oForm.Items.Item(GRID_ARTICULOS).Specific;
                     int x = 1;
                     for (int noLinea = 1; noLinea < _oMatrixArticulos.RowCount; noLinea++)
                     {
                         oItemCode = (SAPbouiCOM.EditText)_oMatrixArticulos.Columns.Item(COLUMNA_CLAVE_ARTICULO).Cells.Item(noLinea).Specific;
                         if (oItemCode.Value.Substring(0, 2).ToString() == "PL")
                         {
                             oSerieInicio = (SAPbouiCOM.EditText)_oMatrixArticulos.Columns.Item(COLUMNA_SERIE_INICIO).Cells.Item(noLinea).Specific;
                             oSerieFin    = (SAPbouiCOM.EditText)_oMatrixArticulos.Columns.Item(COLUMNA_SERIE_FIN).Cells.Item(noLinea).Specific;
                             oSerie       = (SAPbouiCOM.EditText)_oMatrixArticulos.Columns.Item(COLUMNA_SERIE).Cells.Item(noLinea).Specific;
                             if (!string.IsNullOrEmpty(oSerieInicio.Value.ToString()) && !string.IsNullOrEmpty(oSerieFin.Value.ToString()))
                             {
                                 itemDatos            = new Datos();
                                 itemDatos.itemCode   = oItemCode.Value.ToString();
                                 itemDatos.serieInial = oSerieInicio.Value.ToString();
                                 itemDatos.serieFinal = oSerieFin.Value.ToString();
                                 itemDatos.noLinea    = x;
                                 lDatos.Add(itemDatos);
                                 x += 1;
                             }
                             else if (!string.IsNullOrEmpty(oSerie.Value.ToString()))
                             {
                                 itemDatos            = new Datos();
                                 itemDatos.itemCode   = oItemCode.Value.ToString();
                                 itemDatos.serieInial = oSerie.Value.ToString();
                                 itemDatos.serieFinal = oSerie.Value.ToString();
                                 itemDatos.noLinea    = x;
                                 lDatos.Add(itemDatos);
                                 x += 1;
                             }
                         }
                     }
                     if (lDatos.Count != 0)
                     {
                         Addon.Instance.Ejecutaclase("25", lDatos);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         _Application.MessageBox("Error en StatusBarEvent *clsTransferenciaDeStock* : " + ex.Message);
     }
 }
Exemplo n.º 12
0
        private void CriarFormularioComMatrix()
        {
            SAPbouiCOM.Button     oButton     = null;
            SAPbouiCOM.StaticText oStaticText = null;
            SAPbouiCOM.EditText   oEditText   = null;

            SAPbouiCOM.FormCreationParams oCreationParams = null;
            oCreationParams = ((SAPbouiCOM.FormCreationParams)(oApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)));
            //oCreationParams.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed;
            oCreationParams.UniqueID = "frmMtx";
            oCreationParams.FormType = "frmMtx";

            oForm = oApplication.Forms.AddEx(oCreationParams);

            oForm.Title        = "Matrix, DataSources and Linked Buttons";
            oForm.Left         = 336;
            oForm.ClientWidth  = 520;
            oForm.Top          = 44;
            oForm.ClientHeight = 200;


            oItem           = oForm.Items.Add("1 ", BoFormItemTypes.it_BUTTON);
            oItem.Left      = 5;
            oItem.Width     = 65;
            oItem.Top       = 170;
            oItem.Height    = 19;
            oButton         = ((SAPbouiCOM.Button)(oItem.Specific));
            oButton.Caption = "OK";

            oItem           = oForm.Items.Add("2 ", BoFormItemTypes.it_BUTTON);
            oItem.Left      = 75;
            oItem.Width     = 65;
            oItem.Top       = 170;
            oItem.Height    = 19;
            oButton         = ((SAPbouiCOM.Button)(oItem.Specific));
            oButton.Caption = "Cancel";

            oItem        = oForm.Items.Add("txtPhone", SAPbouiCOM.BoFormItemTypes.it_EDIT);
            oItem.Left   = 265;
            oItem.Width  = 163;
            oItem.Top    = 172;
            oItem.Height = 14;

            oItem           = oForm.Items.Add("btnPhone ", BoFormItemTypes.it_BUTTON);
            oItem.Left      = 160;
            oItem.Width     = 100;
            oItem.Top       = 170;
            oItem.Height    = 19;
            oButton         = ((SAPbouiCOM.Button)(oItem.Specific));
            oButton.Caption = "Add Phone Prefix";

            this.oForm.Visible = true;

            AddMatrixNoForm();
        }
Exemplo n.º 13
0
        private void InitiallizeForm()
        {
            Program.objHrmsUI.loadSettings();
            Program.isDemo = Program.objHrmsUI.settings["IsDemo"].ToString() == "Y" ? true : false;


            oForm.Freeze(true);

            initiallizing = true;



            lblStatus = (SAPbouiCOM.StaticText)oForm.Items.Item("lblStatus").Specific;
            dtORDR    = oForm.DataSources.DataTables.Item("dtORDR");
            dtHead    = oForm.DataSources.DataTables.Item("dtHead");
            dtCard    = oForm.DataSources.DataTables.Item("dtCard");
            txWON     = (SAPbouiCOM.EditText)oForm.Items.Item("txWON").Specific;


            txSName  = (SAPbouiCOM.EditText)oForm.Items.Item("txSName").Specific;
            txSSPO   = (SAPbouiCOM.EditText)oForm.Items.Item("txSSPO").Specific;
            txSCity  = (SAPbouiCOM.EditText)oForm.Items.Item("txSCity").Specific;
            txSState = (SAPbouiCOM.EditText)oForm.Items.Item("txSState").Specific;
            txSZip   = (SAPbouiCOM.EditText)oForm.Items.Item("txSZip").Specific;
            txSPhone = (SAPbouiCOM.EditText)oForm.Items.Item("txSPhone").Specific;
            txSEmail = (SAPbouiCOM.EditText)oForm.Items.Item("txSEmail").Specific;

            SCompany = (SAPbouiCOM.EditText)oForm.Items.Item("txSComp").Specific;
            SAdd2    = (SAPbouiCOM.EditText)oForm.Items.Item("txSAdd2").Specific;
            SAdd1    = (SAPbouiCOM.EditText)oForm.Items.Item("txSAdd1").Specific;
            BCompany = (SAPbouiCOM.EditText)oForm.Items.Item("txBComp").Specific;
            BAdd2    = (SAPbouiCOM.EditText)oForm.Items.Item("txBAdd2").Specific;
            BAdd1    = (SAPbouiCOM.EditText)oForm.Items.Item("txBAdd1").Specific;

            txDD     = (SAPbouiCOM.EditText)oForm.Items.Item("txDD").Specific;
            txShipD  = (SAPbouiCOM.EditText)oForm.Items.Item("txShipD").Specific;
            txShipA  = (SAPbouiCOM.EditText)oForm.Items.Item("txShipA").Specific;
            txCustFN = (SAPbouiCOM.EditText)oForm.Items.Item("txCustFN").Specific;
            txCustLN = (SAPbouiCOM.EditText)oForm.Items.Item("txCustLN").Specific;
            txCustE  = (SAPbouiCOM.EditText)oForm.Items.Item("txCustE").Specific;
            txCustG  = (SAPbouiCOM.EditText)oForm.Items.Item("txCustG").Specific;
            txCustCG = (SAPbouiCOM.EditText)oForm.Items.Item("txCustCG").Specific;
            txStore  = (SAPbouiCOM.EditText)oForm.Items.Item("txStore").Specific;
            txCD     = (SAPbouiCOM.EditText)oForm.Items.Item("txCD").Specific;
            txSD     = (SAPbouiCOM.EditText)oForm.Items.Item("txSD").Specific;

            btGet = (SAPbouiCOM.Button)oForm.Items.Item("btGet").Specific;

            ini_controls();

            oForm.Freeze(false);

            initiallizing = false;
        }
Exemplo n.º 14
0
        private void FillSalesOrder()
        {
            mSalesOrderForm.Freeze(true);

            for (int i = 1; i <= mLstSalesOrderLines.Count; i++)
            {
                mObjCboPyloadType = (SAPbouiCOM.ComboBox)mObjSOMtx.Columns.Item("U_TR_LoadType").Cells.Item(i).Specific;
                mObjCboPyloadType.Select(mLstSalesOrderLines[i - 1].PayloadType, SAPbouiCOM.BoSearchKey.psk_ByValue);

                mObjCboVehicleType = (SAPbouiCOM.ComboBox)mObjSOMtx.Columns.Item("U_TR_VehicleType").Cells.Item(i).Specific;
                mObjCboVehicleType.Select(mLstSalesOrderLines[i - 1].VehicleType, SAPbouiCOM.BoSearchKey.psk_ByValue);

                mObjCboRoute = (SAPbouiCOM.ComboBox)mObjSOMtx.Columns.Item("U_TR_Paths").Cells.Item(i).Specific;
                mObjCboRoute.Select(mLstSalesOrderLines[i - 1].Route, SAPbouiCOM.BoSearchKey.psk_ByValue);

                mObjTxtTotKm       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TotKm").Cells.Item(i).Specific;
                mObjTxtTotKm.Value = mLstSalesOrderLines[i - 1].TotKm;

                mObjTxtKmA       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TypeA").Cells.Item(i).Specific;
                mObjTxtKmA.Value = mLstSalesOrderLines[i - 1].KmA;

                mObjTxtKmB       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TypeB").Cells.Item(i).Specific;
                mObjTxtKmB.Value = mLstSalesOrderLines[i - 1].KmB;

                mObjTxtKmC       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TypeC").Cells.Item(i).Specific;
                mObjTxtKmC.Value = mLstSalesOrderLines[i - 1].KmC;

                mObjTxtKmD       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TypeD").Cells.Item(i).Specific;
                mObjTxtKmD.Value = mLstSalesOrderLines[i - 1].KmD;

                mObjTxtKmE       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TypeE").Cells.Item(i).Specific;
                mObjTxtKmE.Value = mLstSalesOrderLines[i - 1].KmE;

                mObjTxtKmF       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TypeF").Cells.Item(i).Specific;
                mObjTxtKmF.Value = mLstSalesOrderLines[i - 1].KmF;

                mObjTxtTotKG       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TotKilos").Cells.Item(i).Specific;
                mObjTxtTotKG.Value = mLstSalesOrderLines[i - 1].TotKg;

                mObjTxtExtra       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_AdditionalExpen").Cells.Item(i).Specific;
                mObjTxtExtra.Value = mLstSalesOrderLines[i - 1].Extra;

                mObjTxtAnthPyld       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_OtherLoad").Cells.Item(i).Specific;
                mObjTxtAnthPyld.Value = mLstSalesOrderLines[i - 1].AnotherPyld;

                mObjTxtDestination       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_Destination").Cells.Item(i).Specific;
                mObjTxtDestination.Value = mLstSalesOrderLines[i - 1].Destination;
            }


            mSalesOrderForm.Freeze(false);
        }
Exemplo n.º 15
0
        private void addItem()
        {
            string itemCode = txItCode.Value.ToString();

            int cntExist = Convert.ToInt32(Program.objHrmsUI.getScallerValue("Select count(*) from oitm where ItemCode = '" + itemCode + "'"));

            if (cntExist == 0)
            {
                SAPbobsCOM.Items newRetItem;
                newRetItem                 = (SAPbobsCOM.Items)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems);
                newRetItem.ItemCode        = itemCode;
                newRetItem.ItemName        = txName.Value.ToString();
                newRetItem.ItemsGroupCode  = Convert.ToInt16(cbIG.Selected.Value.ToString());
                newRetItem.SalesUnitLength = txL.Value != "" ? Convert.ToDouble(txL.Value) : 0.00;
                newRetItem.SalesUnitWidth  = txW.Value != "" ? Convert.ToDouble(txW.Value) : 0.00;
                newRetItem.SalesUnitHeight = txH.Value != "" ? Convert.ToDouble(txH.Value) : 0.00;

                newRetItem.UserFields.Fields.Item("U_PARAM1").Value = cbPM1.Value.ToString();
                newRetItem.UserFields.Fields.Item("U_PARAM2").Value = cbPM2.Value.ToString();
                newRetItem.UserFields.Fields.Item("U_PARAM3").Value = cbPM3.Checked == true ? "Y" : "N";
                newRetItem.UserFields.Fields.Item("U_PARAM4").Value = cbPM4.Checked == true ? "Y":"N";
                newRetItem.UserFields.Fields.Item("U_PARAM5").Value = cbPM5.Checked == true?"Y":"N";
                newRetItem.UserFields.Fields.Item("U_PARAM6").Value = cbPM6.Checked == true ? "Y" : "N";
                newRetItem.UserFields.Fields.Item("U_PARAM7").Value = cbPM7.Value.ToString();
                newRetItem.UserFields.Fields.Item("U_PARAM8").Value = cbPM8.Checked == true ? "Y" : "N";

                int result = newRetItem.Add();
                if (result == 0)
                {
                    oApplication.SetStatusBarMessage("Item " + itemCode + " Added Successfully", BoMessageTime.bmt_Short, false);
                    txName.Value = "";
                    SAPbouiCOM.EditText newItemCode = (SAPbouiCOM.EditText)mtItems.Columns.Item("1").Cells.Item(mtItems.RowCount).Specific;
                    SAPbouiCOM.Folder   general     = (SAPbouiCOM.Folder)oForm.Items.Item("112").Specific;
                    general.Select();
                    oForm.PaneLevel   = 1;
                    newItemCode.Value = itemCode;



                    // txName.Active = true;
                }
                else
                {
                    int    erroCode = 0;
                    string errDescr = "";
                    string Errmsg   = "";
                    oCompany.GetLastError(out erroCode, out errDescr);
                    oApplication.SetStatusBarMessage("Item " + itemCode + " Failed to import: " + errDescr, BoMessageTime.bmt_Short, true);
                }
            }
        }
        public static SAPbouiCOM.EditText AddEditTextAoFormulario(
            SAPbouiCOM.Form pForm
            , string pUID
            , int pLeft
            , int pWidth
            , int pTop
            , int pHeight
            , string pLinkTo
            , bool AffectsFormMode = false
            , int pFromPane        = 0
            , int pToPane          = 0

            )
        {
            Item oItem = pForm.Items.Add(pUID, BoFormItemTypes.it_EDIT);

            SAPbouiCOM.EditText oEditText = null;
            if (pLeft > 0)
            {
                oItem.Left = pLeft;
            }
            if (pWidth > 0)
            {
                oItem.Width = pWidth;
            }
            if (pTop > 0)
            {
                oItem.Top = pTop;
            }
            if (pHeight > 0)
            {
                oItem.Height = pHeight;
            }
            oItem.AffectsFormMode = AffectsFormMode;
            if (pFromPane > 0)
            {
                oItem.FromPane = pFromPane;
            }
            if (pToPane > 0)
            {
                oItem.ToPane = pToPane;
            }
            if (string.IsNullOrEmpty(pLinkTo))
            {
                oItem.LinkTo = pLinkTo;
            }
            oItem.LinkTo = pLinkTo;
            oEditText    = ((SAPbouiCOM.EditText)(oItem.Specific));
            return(oEditText);
        }
Exemplo n.º 17
0
        /// <summary>
        /// Inicializa los componentes de la forma activa
        /// </summary>
        public void inicializarComponentes()
        {
            try
            {
                _oForma      = _Application.Forms.Item(formID);
                _oForma.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE;
                _oForma.Freeze(true);

                //Código del asociado
                _oForma.DataSources.UserDataSources.Add(TXT_CODIGO_ASOCIADO, BoDataType.dt_SHORT_TEXT, 10);
                _oTxtCodigoAsociado = (SAPbouiCOM.EditText)_oForma.Items.Item(TXT_CODIGO_ASOCIADO).Specific;
                _oTxtCodigoAsociado.DataBind.SetBound(true, "", TXT_CODIGO_ASOCIADO);

                //Nombre del asociado
                _oForma.DataSources.UserDataSources.Add(TXT_NOMBRE_ASOCIADO, BoDataType.dt_SHORT_TEXT, 150);
                _oTxtNombreAsociado = (SAPbouiCOM.EditText)_oForma.Items.Item(TXT_NOMBRE_ASOCIADO).Specific;
                _oTxtNombreAsociado.DataBind.SetBound(true, "", TXT_NOMBRE_ASOCIADO);

                //Código de oficina
                _oForma.DataSources.UserDataSources.Add(TXT_CODIGO_OFICINA, BoDataType.dt_SHORT_TEXT, 10);
                _oTxtCodigoOficina = (SAPbouiCOM.EditText)_oForma.Items.Item(TXT_CODIGO_OFICINA).Specific;
                _oTxtCodigoOficina.DataBind.SetBound(true, "", TXT_CODIGO_OFICINA);

                //Nombre de oficina
                _oForma.DataSources.UserDataSources.Add(TXT_NOMBRE_OFICINA, BoDataType.dt_SHORT_TEXT, 150);
                _oTxtNombreOficina = (SAPbouiCOM.EditText)_oForma.Items.Item(TXT_NOMBRE_OFICINA).Specific;
                _oTxtNombreOficina.DataBind.SetBound(true, "", TXT_NOMBRE_OFICINA);

                //Código de solicitud
                _oForma.DataSources.UserDataSources.Add(TXT_CODIGO_SOLICITUD, BoDataType.dt_SHORT_TEXT, 20);
                _oTxtCodigoSolicitud = (SAPbouiCOM.EditText)_oForma.Items.Item(TXT_CODIGO_SOLICITUD).Specific;
                _oTxtCodigoSolicitud.DataBind.SetBound(true, "", TXT_CODIGO_SOLICITUD);

                _oBtnImprimirArqueo = _oForma.Items.Item(BTN_IMPRIMIR_ARQUEO).Specific;
                _oBtnImprimirArqueo.Item.Visible = false;

                _oTxtCodigoAsociado.Active = true;

                //Declarar DataTable
                _oForma.DataSources.DataTables.Add(DT_ARQUEOS);
            }
            catch (Exception ex)
            {
                _Application.MessageBox("Error al inicializar : " + ex.Message);
            }
            finally
            {
                _oForma.Freeze(false);
            }
        }
Exemplo n.º 18
0
        /// <summary>
        /// Crea el campo de RFC en la ventana de Datos maestros  empleado
        /// </summary>
        /// <param name="_oForm"></param>
        private void CrearCampoRFC(Form _oForm)
        {
            SAPbouiCOM.Item newItem = null;

            try
            {
                try
                {
                    string s = _oForm.Items.Item(TXT_RFC).UniqueID;
                }
                catch (Exception)
                {
                    _oForm.Freeze(true);

                    //LABEL RFC
                    SAPbouiCOM.Item _oLblTelOficina = null;
                    _oLblTelOficina  = _oForm.Items.Item(LBL_TELEFONO_OFICINA);
                    newItem          = _oForm.Items.Add(LBL_RFC, BoFormItemTypes.it_STATIC);
                    newItem.Left     = _oLblTelOficina.Left;
                    newItem.Top      = _oLblTelOficina.Top - 16;
                    newItem.Width    = 50;
                    newItem.ToPane   = 0;
                    newItem.FromPane = 0;
                    _oLblRfc         = newItem.Specific;
                    _oLblRfc.Caption = "RFC";

                    //EDITTEXT RFC
                    SAPbouiCOM.Item _oLabelRFC = null;
                    _oLabelRFC       = _oForm.Items.Item(LBL_RFC);
                    newItem          = _oForm.Items.Add(TXT_RFC, BoFormItemTypes.it_EDIT);
                    newItem.Left     = _oLabelRFC.Left + 102;
                    newItem.Top      = _oLabelRFC.Top;
                    newItem.Width    = 90;
                    newItem.ToPane   = 0;
                    newItem.FromPane = 0;
                    _oTxtRfc         = (SAPbouiCOM.EditText)newItem.Specific;
                    _oTxtRfc.DataBind.SetBound(true, "OHEM", "U_RFC");
                    _oLabelRFC.LinkTo = newItem.UniqueID;
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error al crear campos de usuario *CrearCampoRFC* : " + ex.Message);
            }
            finally
            {
                _oForm.Freeze(false);
            }
        }
Exemplo n.º 19
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);

            initiallizing = true;

            dtHead = oForm.DataSources.DataTables.Item("dtHead");
            dtList = oForm.DataSources.DataTables.Item("dtList");

            dtA  = oForm.DataSources.DataTables.Item("dtA");
            dtS  = oForm.DataSources.DataTables.Item("dtS");
            dtAW = oForm.DataSources.DataTables.Item("dtAW");
            dtSW = oForm.DataSources.DataTables.Item("dtSW");



            mtA  = (SAPbouiCOM.Matrix)oForm.Items.Item("mtA").Specific;
            mtS  = (SAPbouiCOM.Matrix)oForm.Items.Item("mtS").Specific;
            mtAW = (SAPbouiCOM.Matrix)oForm.Items.Item("mtAW").Specific;
            mtSW = (SAPbouiCOM.Matrix)oForm.Items.Item("mtSW").Specific;


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

            dtHead.Rows.Add(1);


            txCode = (SAPbouiCOM.EditText)oForm.Items.Item("txCode").Specific;
            txName = (SAPbouiCOM.EditText)oForm.Items.Item("txName").Specific;

            btAdd  = (SAPbouiCOM.Button)oForm.Items.Item("btAdd").Specific;
            btAddA = (SAPbouiCOM.Button)oForm.Items.Item("btAddA").Specific;
            btDelA = (SAPbouiCOM.Button)oForm.Items.Item("btDelA").Specific;
            btAddW = (SAPbouiCOM.Button)oForm.Items.Item("btAddW").Specific;
            btDelW = (SAPbouiCOM.Button)oForm.Items.Item("btDelW").Specific;

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


            cflCode = (SAPbouiCOM.ChooseFromList)oForm.ChooseFromLists.Item("cflCode");



            // oForm.Items.Item("btUpd").Enabled = false;
            oForm.Freeze(false);

            initiallizing = false;
            getCodes();
        }
Exemplo n.º 20
0
        private void SetFormSettings(Form pFrmActive)
        {
            try
            {
                mObjSOForm      = pFrmActive;//SAPbouiCOM.Framework.Application.SBO_Application.Forms.GetFormByTypeAndCount(pFrmActive.Type, pFrmActive.TypeCount);
                mIntFormType    = pFrmActive.Type;
                mObjTxtCardCode = (SAPbouiCOM.EditText)mObjSOForm.Items.Item("4").Specific;


                mObjMtxSO  = (SAPbouiCOM.Matrix)mObjSOForm.Items.Item("38").Specific;
                mObjCboDoc = (SAPbouiCOM.ComboBox)mObjSOForm.Items.Item("81").Specific;
            }
            catch (Exception)
            {
                //ignore
            }
        }
Exemplo n.º 21
0
        /// <summary>
        ///Se producen cuando la aplicación realiza las acciones siguientes en formularios conectados a objetos de negocio:
        ///- Añadir
        ///- Actualizar
        ///- Borrar
        /// </summary>
        /// <param name="BusinessObjectInfo">
        /// Información del objeto aplicado
        /// </param>
        /// <param name="BubbleEvent">
        /// true/false
        /// </param>
        private void SBO_Application_FormEvent(ref BusinessObjectInfo BusinessObjectInfo, out bool BubbleEvent)
        {
            BubbleEvent = true;
            try
            {
                if (BusinessObjectInfo.BeforeAction == true && BusinessObjectInfo.FormTypeEx == FRM_ENTRADA_DE_MERCANCIA.ToString())
                {
                    if (BusinessObjectInfo.EventType == SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD &&
                        BusinessObjectInfo.Type == OBJETO_ENTRADA_MERCANCIA && BusinessObjectInfo.ActionSuccess == false)
                    {
                        lDatos.Clear();
                        SAPbouiCOM.Form _oNuevaForm = _Application.Forms.GetForm(BusinessObjectInfo.FormTypeEx, _Application.Forms.ActiveForm.TypeCount);
                        if (BusinessObjectInfo.FormTypeEx == FRM_ENTRADA_DE_MERCANCIA.ToString())
                        {
                            _oMatrixArticulos = _oNuevaForm.Items.Item(GRID_ARTICULOS).Specific;

                            for (int noLinea = 1; noLinea < _oMatrixArticulos.RowCount; noLinea++)
                            {
                                oItemCode = (SAPbouiCOM.EditText)_oMatrixArticulos.Columns.Item(COLUMNA_CLAVE_ARTICULO).Cells.Item(noLinea).Specific;
                                if (oItemCode.Value.Substring(0, 2).ToString() == "PL")
                                {
                                    oSerieInicio = (SAPbouiCOM.EditText)_oMatrixArticulos.Columns.Item(COLUMNA_SERIE_INICIO).Cells.Item(noLinea).Specific;
                                    oSerieFin    = (SAPbouiCOM.EditText)_oMatrixArticulos.Columns.Item(COLUMNA_SERIE_FIN).Cells.Item(noLinea).Specific;
                                    if (!string.IsNullOrEmpty(oSerieInicio.Value.ToString()) && !string.IsNullOrEmpty(oSerieFin.Value.ToString()))
                                    {
                                        itemDatos            = new Datos();
                                        itemDatos.itemCode   = oItemCode.Value.ToString();
                                        itemDatos.serieInial = oSerieInicio.Value.ToString();
                                        itemDatos.serieFinal = oSerieFin.Value.ToString();
                                        lDatos.Add(itemDatos);
                                    }
                                }
                            }
                            if (lDatos.Count != 0)
                            {
                                Addon.Instance.Ejecutaclase("21", lDatos);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                _Application.MessageBox("Error en FormEvent *clsEntradaDeMercancia* : " + ex.Message);
            }
        }
Exemplo n.º 22
0
        public override void etAfterClick(ref ItemEvent pVal, ref bool BubbleEvent)
        {
            base.etAfterClick(ref pVal, ref BubbleEvent);

            if (pVal.ItemUID == "fldNI")
            {
                oForm.PaneLevel = 101;
            }
            if (pVal.ItemUID == "38" && pVal.ColUID == "0" && pVal.Row < mtItems.RowCount)
            {
                // mtItems.FlushToDataSource();
                string itemCode = ((SAPbouiCOM.EditText)mtItems.Columns.Item("1").Cells.Item(pVal.Row).Specific).Value.ToString(); //Convert.ToString(dbQUT1.GetValue("ItemCode", pVal.Row-1 ));
                if (itemCode != null && itemCode != "")
                {
                    string pictureCode = Program.objHrmsUI.getScallerValue("Select U_Picture from oitm where itemcode='" + itemCode + "'").ToString();
                    if (pictureCode != null)
                    {
                        ItemImage.Picture = oCompany.BitMapPath + "\\" + pictureCode;
                    }
                }
            }
            if (checkboxes.Contains(pVal.ItemUID))
            {
                updateItemDetail();
            }
            if (pVal.ItemUID == btNI.Item.UniqueID)
            {
                if (txItCode.Value != "" && txName.Value.ToString() != "")
                {
                    SAPbouiCOM.EditText cardCode = (SAPbouiCOM.EditText)oForm.Items.Item("4").Specific;
                    if (cardCode.Value != "")
                    {
                        addItem();
                    }
                    else
                    {
                        oApplication.MessageBox("Please confirm if BP Selected ");
                    }
                }
                else
                {
                    oApplication.MessageBox("Please confirm if BP Selected and required info provided!");
                }
            }
        }
Exemplo n.º 23
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);

            initiallizing = true;

            dtA    = oForm.DataSources.DataTables.Item("dtA");
            dtHead = oForm.DataSources.DataTables.Item("dtHead");
            dtS    = oForm.DataSources.DataTables.Item("dtS");
            dtList = oForm.DataSources.DataTables.Item("dtList");

            mtA    = (SAPbouiCOM.Matrix)oForm.Items.Item("mtA").Specific;
            mtS    = (SAPbouiCOM.Matrix)oForm.Items.Item("mtS").Specific;
            mtList = (SAPbouiCOM.Matrix)oForm.Items.Item("mtList").Specific;

            dtHead.Rows.Add(1);


            txCode = (SAPbouiCOM.EditText)oForm.Items.Item("txCode").Specific;
            txName = (SAPbouiCOM.EditText)oForm.Items.Item("txName").Specific;

            btAdd  = (SAPbouiCOM.Button)oForm.Items.Item("btAdd").Specific;
            btAddA = (SAPbouiCOM.Button)oForm.Items.Item("btAddA").Specific;
            btDelA = (SAPbouiCOM.Button)oForm.Items.Item("btDelA").Specific;


            opI = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opI").Specific;
            opG = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opG").Specific;


            cflCode  = (SAPbouiCOM.ChooseFromList)oForm.ChooseFromLists.Item("cflCode");
            cflGroup = (SAPbouiCOM.ChooseFromList)oForm.ChooseFromLists.Item("cflGroup");



            opG.GroupWith("opI");
            opG.Selected = true;


            // oForm.Items.Item("btUpd").Enabled = false;
            oForm.Freeze(false);

            initiallizing = false;
            getCodes();
        }
Exemplo n.º 24
0
 private void lObjTxt_LostFocusAfter(object sboObject, SBOItemEventArg pVal)
 {
     try
     {
         SAPbouiCOM.EditText lObjTxt = sboObject as SAPbouiCOM.EditText;
         if (string.IsNullOrEmpty(lObjTxt.Value))
         {
             lObjTxt.Value = "0";
         }
         SetAmounts();
     }
     catch (Exception ex)
     {
         LogService.WriteError("JournalService (CreateAction): " + ex.Message);
         LogService.WriteError(ex);
         UIApplication.ShowMessageBox(string.Format("CreateAction: {0}", ex.Message));
     }
 }
Exemplo n.º 25
0
 private bool CheckMtxItems()
 {
     mBoolInsurance      = false;
     mObjSalesOrderLines = null;
     for (int i = 1; i <= mObjMtxSO.RowCount; i++)
     {
         mObjTxtItem = (SAPbouiCOM.EditText)mObjMtxSO.Columns.Item("1").Cells.Item(i).Specific;
         if (!string.IsNullOrEmpty(mObjTxtItem.Value) && TransportsItem(mObjTxtItem.Value))
         {
             SetSalesOrderLine(i);
         }
         else if (Insuranceline(mObjTxtItem.Value))
         {
             mBoolInsurance = true;
         }
     }
     return(mObjSalesOrderLines != null || mBoolInsurance ? true : false);
 }
Exemplo n.º 26
0
 public override void OnInitializeComponent()
 {
     this.StaticText0           = ((SAPbouiCOM.StaticText)(this.GetItem("lb_pcode").Specific));
     this.EditText0             = ((SAPbouiCOM.EditText)(this.GetItem("txt_pcode").Specific));
     this.Button0               = ((SAPbouiCOM.Button)(this.GetItem("bt_info").Specific));
     this.Button0.PressedAfter += new SAPbouiCOM._IButtonEvents_PressedAfterEventHandler(this.Button0_PressedAfter);
     this.StaticText1           = ((SAPbouiCOM.StaticText)(this.GetItem("lb_ptype").Specific));
     this.EditText1             = ((SAPbouiCOM.EditText)(this.GetItem("txt_ptype").Specific));
     this.StaticText2           = ((SAPbouiCOM.StaticText)(this.GetItem("lb_pname").Specific));
     this.EditText2             = ((SAPbouiCOM.EditText)(this.GetItem("txt_pname").Specific));
     this.Button1               = ((SAPbouiCOM.Button)(this.GetItem("bt_clone").Specific));
     this.Button1.PressedAfter += new SAPbouiCOM._IButtonEvents_PressedAfterEventHandler(this.Button1_PressedAfter);
     this.StaticText3           = ((SAPbouiCOM.StaticText)(this.GetItem("lb_bpname").Specific));
     this.EditText3             = ((SAPbouiCOM.EditText)(this.GetItem("txt_bpname").Specific));
     this.StaticText4           = ((SAPbouiCOM.StaticText)(this.GetItem("lb_pgrp").Specific));
     this.EditText4             = ((SAPbouiCOM.EditText)(this.GetItem("txt_pgroup").Specific));
     this.EditText5             = ((SAPbouiCOM.EditText)(this.GetItem("t_absentry").Specific));
     this.OnCustomInitialize();
 }
Exemplo n.º 27
0
        public void SubFormInit(string KeyValue)
        {
            this.LoadForm();
            oForm = B1Connections.theAppl.Forms.Item(formuid);
            oForm.Freeze(true);
            this.Act1_FormInit();

            oForm.Freeze(false);
            oForm.Visible = true;

            oForm.Mode = BoFormMode.fm_FIND_MODE;
            oEditText = (SAPbouiCOM.EditText)oForm.Items.Item("edtCODE").Specific;
            oEditText.Value = KeyValue;

            SAPbouiCOM.Item oItem = oForm.Items.Item("1");
            oItem.Click();

            oItem = null;

        }
Exemplo n.º 28
0
        public static SAPbouiCOM.EditText AddEditTextAoFormulario(
            SAPbouiCOM.Form pForm
            , string pUID
            , int pLeft
            , int pWidth
            , int pTop
            , int pHeight
            )
        {
            Item oItem = pForm.Items.Add(pUID, BoFormItemTypes.it_EDIT);

            SAPbouiCOM.EditText oEditText = null;
            oItem.Left            = pLeft;
            oItem.Width           = pWidth;
            oItem.Top             = pTop;
            oItem.Height          = pHeight;
            oItem.AffectsFormMode = false;
            oEditText             = ((SAPbouiCOM.EditText)(oItem.Specific));
            return(oEditText);
        }
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            //SAPbouiCOM.ComboBox oComboBox;
            SAPbouiCOM.Column oColumn;

            bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

            try
            {
                oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));

                //Lista    := New list<string>;

                FSBOf.LoadForm(xmlPath, "VID_LibroCompra.srf", uid);
                //EnableCrystal := true;
                oForm = FSBOApp.Forms.Item(uid);
                oForm.Freeze(true);
                oForm.AutoManaged    = false;
                oForm.SupportedModes = -1;       // afm_All

                oForm.EnableMenu("1281", false); //Actualizar
                oForm.EnableMenu("1282", false); //Crear

                oForm.DataSources.UserDataSources.Add("Desde", BoDataType.dt_DATE, 10);
                oEditText = (EditText)(oForm.Items.Item("Desde").Specific);
                oEditText.DataBind.SetBound(true, "", "Desde");
                oEditText.Value = DateTime.Now.ToString("yyyyMM") + "01";

                oForm.DataSources.UserDataSources.Add("Hasta", BoDataType.dt_DATE, 10);
                oEditText = (EditText)(oForm.Items.Item("Hasta").Specific);
                oEditText.DataBind.SetBound(true, "", "Hasta");
                oEditText.Value = DateTime.Now.ToString("yyyyMMdd");
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            oForm.Freeze(false);
            return(Result);
        }//fin InitForm
Exemplo n.º 30
0
        /// <summary>
        /// Obtiene el reporte agregado en SAP
        /// </summary>
        private void CargarReporteArqueo()
        {
            try
            {
                _oRec = null;
                _oRec = _Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
                SAPbouiCOM.Form     _formaRpt = null;
                SAPbouiCOM.EditText asistente = null;

                _oRec.DoQuery(@"SELECT  MenuUID
                                FROM    dbo.OCMN
                                WHERE   Name = 'Arqueos'
                                        AND Type = 'C'");
                _Application.ActivateMenuItem(_oRec.Fields.Item("MenuUID").Value);
                _formaRpt       = _Application.Forms.ActiveForm;
                asistente       = _formaRpt.Items.Item("1000003").Specific;
                asistente.Value = _oTxtCodigoAsociado.Value;
                _formaRpt.Items.Item(0).Click();
                _Application.Menus.Item("520").Activate();
            }
            catch (Exception ex)
            {
                throw new Exception("Error al cargar el reporte de Arqueo *CargarReporteArqueo* : " + ex.Message);
            }
            finally
            {
                try
                {
                    if (_oRec != null)
                    {
                        System.Runtime.InteropServices.Marshal.ReleaseComObject(_oRec);
                    }
                }
                catch (Exception)
                {
                }
            }
        }
Exemplo n.º 31
0
        public override void etAfterClick(ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent)
        {
            base.etAfterClick(ref pVal, ref BubbleEvent);

            if (pVal.ItemUID == "1")
            {
            }
            if (pVal.ItemUID == "btPost")
            {
                postJe();
            }
            if (pVal.ItemUID == "mtJE")
            {
                if (pVal.Row <= mtJE.RowCount && pVal.Row > 0)
                {
                    SAPbouiCOM.EditText InvNum = mtJE.Columns.Item("cDN").Cells.Item(pVal.Row).Specific;
                    fillJeDetailHead(InvNum.Value.ToString());
                }
            }
            if (pVal.ItemUID == "lnkBG")
            {
                Hashtable hp = new Hashtable();
                hp.Add("~p1", txDN.Value.ToString());
                string strSelect            = Program.objHrmsUI.getQryString("JE_GET_DE", hp);
                string strEntry             = "0";
                System.Data.DataTable dtUsr = Program.objHrmsUI.getDataTable(strSelect, "Opening Linked Branch JE");
                if (dtUsr != null && dtUsr.Rows.Count > 0)
                {
                    foreach (DataRow dr in dtUsr.Rows)
                    {
                        strEntry = dr["docentry"].ToString();
                    }
                }


                oApplication.OpenForm(BoFormObjectEnum.fo_UserDefinedObject, "ABGP", strEntry);
            }
        }
Exemplo n.º 32
0
        public virtual void ET_edtRECVID_AFChooseFromList(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtRECVID").Specific));

            // ADD YOUR ACTION CODE HERE ...
            string pItemUID = pVal.ItemUID.ToString();
            string colid = "Code";
            string cItemUID = "";

            SetChooseFromList(pVal, pItemUID, colid, cItemUID);
        }
Exemplo n.º 33
0
        public virtual void ET_edtDISACCD_AFValidate(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtDISACCD").Specific));
            // ADD YOUR ACTION CODE HERE ....

            if (pVal.ItemChanged == true)
            {
                if (oEditText.Value == "")
                {
                    oDB_M.SetValue("U_DISACCD", 0, "");
                    oDB_M.SetValue("U_DISACCT", 0, "");
                    //oForm.DataSources.UserDataSources.Item("edtDISACCD").Value = "";
                    //oForm.DataSources.UserDataSources.Item("edtDISACCT").Value = "";
                }
            }
        }
Exemplo n.º 34
0
        public virtual bool ET_edtACCTCD_BFValidate(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtACCTCD").Specific));
            // ADD YOUR ACTION CODE HERE ...

            try
            {
                if (oEditText.Value == "" && pVal.ItemChanged == true)
                {
                    oForm.DataSources.UserDataSources.Item("edtACCOUNT").Value = "";
                    oForm.DataSources.UserDataSources.Item("edtACCTCD").Value = "";
                    oForm.DataSources.UserDataSources.Item("edtACCTNM").Value = "";

                }
            }
            catch (Exception ex)
            {

                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            return true;
        }
Exemplo n.º 35
0
        private void ClearUnManagedObject() {
			if ( oEditText != null ) { Marshal.ReleaseComObject(oEditText); } oEditText = null;
			if ( oButtonCombo != null ) { Marshal.ReleaseComObject(oButtonCombo); } oButtonCombo = null;
			if ( oButton != null ) { Marshal.ReleaseComObject(oButton); } oButton = null;
			if ( oMatrix != null ) { Marshal.ReleaseComObject(oMatrix); } oMatrix = null;
            if ((oForm != null)) {
                Marshal.ReleaseComObject(oForm);
            }
            oForm = null;
            // ADD YOUR ACTION CODE HERE ...
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
        }
Exemplo n.º 36
0
        public virtual bool ET_edtORDERNM_BFValidate(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtORDERNM").Specific));
            // ADD YOUR ACTION CODE HERE ...

            SAPbouiCOM.DBDataSource oKIS_SD0030T_HRD = oForm.DataSources.DBDataSources.Item("@KIS_SD0030T_HRD");
            try
            {
                if (pVal.ItemChanged)
                {
                    if (string.IsNullOrEmpty(oEditText.Value))
                    {
                        oKIS_SD0030T_HRD.SetValue("U_ORDERCD", 0, "");
                        oKIS_SD0030T_HRD.SetValue("U_ORDERNM", 0, "");
                        oKIS_SD0030T_HRD.SetValue("U_ORDERRAT", 0, "0");
                        this.SetMatrixRateColumn("U_ORDERRAT", "0");
                    }
                }
                
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oKIS_SD0030T_HRD = null;
            }

            return true;
        }
Exemplo n.º 37
0
        public virtual void ET_edtBPNM_AFChooseFromList(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtBPNM").Specific));
            // ADD YOUR ACTION CODE HERE ...
            SAPbouiCOM.DataTable oDataTable = null;

            oDataTable = FN.GetCFLSelectedObjects(pVal);

            SAPbouiCOM.DBDataSource oKIS_SD0030T_HRD = oForm.DataSources.DBDataSources.Item("@KIS_SD0030T_HRD");

            try
            {
                if (oDataTable != null)
                {

                    oKIS_SD0030T_HRD.SetValue("U_BPCD", 0, oDataTable.GetValue("CardCode", 0).ToString());
                    oKIS_SD0030T_HRD.SetValue("U_BPNM", 0, oDataTable.GetValue("CardName", 0).ToString());
                    oKIS_SD0030T_HRD.SetValue("U_BPRATE", 0, _BPRATE.ToString());

                    gl_U_VATCDBP = oDataTable.GetValue("ECVatGroup", 0).ToString();
                    SetMatrixColumnVATGRP(gl_U_VATCD, gl_U_VATCDBP);

                    this.SetMatrixRateColumn("U_BPRATE", _BPRATE.ToString());

                    if (oForm.Mode == BoFormMode.fm_OK_MODE)
                        oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                }
                else
                {
                    if (string.IsNullOrEmpty(oEditText.Value) == false)
                    {
                        gl_U_VATCDBP = FN.GetRecordsetValue(string.Format("SELECT ECVatGroup FROM OCRD WHERE CardCode = '{0}'", oEditText.Value));
                    }
                    else
                    {
                        gl_U_VATCDBP = string.Empty;
                    }
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oKIS_SD0030T_HRD = null;
                oDataTable = null;
            }

        }
Exemplo n.º 38
0
        public virtual bool ET_edtBNKCD_BFValidate(ItemEvent pVal) {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtBNKCD").Specific));
            // ADD YOUR ACTION CODE HERE ...

            try
            {
                if (pVal.ItemChanged)
                {
                    oForm.Freeze(true);

                    System.Data.DataTable Dt = null;

                    switch (pVal.ItemUID)
                    {
                        case "edtBNKCD":
                            #region 주거래은행 정보를 가져온다.
                            string U_HBNKCD = oForm.Items.Item("edtBNKCD").Specific.value;

                            System.Text.StringBuilder sb = new System.Text.StringBuilder();
                            sb.Append(" SELECT A.AbsEntry                     ");
                            sb.Append("      , A.GLAccount                    ");
                            sb.Append("      , B.AcctName                     ");
                            sb.Append("  FROM DSC1 A                          ");
                            sb.Append("  LEFT JOIN OACT B ON A.GLAccount = B.AcctCode     ");
                            sb.AppendFormat(" WHERE A.AbsEntry = {0}", U_HBNKCD);

                            if (U_HBNKCD != "")
                            {
                                Dt = FN.GetRecordsetToDataTable(sb.ToString());

                                if (Dt.Rows.Count == 1)
                                {
                                    oForm.Items.Item("edtBNKACCT").Specific.value = Dt.Rows[0]["GLAccount"].ToString();
                                    oForm.Items.Item("edtBNKATNM").Specific.value = Dt.Rows[0]["AcctName"].ToString();
                                }
                                else
                                {
                                    oForm.Items.Item("edtBNKACCT").Specific.value = "";
                                    oForm.Items.Item("edtBNKATNM").Specific.value = "";

                                    //FN.Trace("주거래은행을 확인해 주세요", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                                }
                            }
                            else
                            {
                                oForm.Items.Item("edtBNKACCT").Specific.value = "";
                                oForm.Items.Item("edtBNKATNM").Specific.value = "";
                            }
                            #endregion
                            break;

                        default:
                            break;
                    }
                }

            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                oForm.Freeze(false);
            }
            finally
            {
                oForm.Freeze(false);
            }
            return true;
        }
Exemplo n.º 39
0
        public virtual void ET_edtCARDNO_AFValidate(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtCARDNO").Specific));
            // ADD YOUR ACTION CODE HERE ...

            if (pVal.ItemChanged == true)
            {
                if (oEditText.Value == "")
                {
                    oForm.DataSources.UserDataSources.Item("edtCARDNO").Value = "";
                    oForm.DataSources.UserDataSources.Item("edtCARDNM").Value = "";
                }
            }
        }
Exemplo n.º 40
0
 public virtual void ET_edtDATE_AFKeyDown(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtDATE").Specific));
     // ADD YOUR ACTION CODE HERE ...
     if (oForm.Items.Item("edtDATE").Specific.value.Length > 4)
     {
         oForm.DataSources.UserDataSources.Item("edtDATE").ValueEx = oForm.Items.Item("edtDATE").Specific.value;
         oForm.DataSources.UserDataSources.Item("edtDATE").ValueEx = FN.Left(oForm.DataSources.UserDataSources.Item("edtDATE").Value, 4);
         B1Connections.theAppl.StatusBar.SetText("4자 이상 입력할수없습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
     }
 }
Exemplo n.º 41
0
        private void ClearUnManagedObject()
        {
            if (oDB_M != null) { Marshal.ReleaseComObject(oDB_M); } oDB_M = null;
            if (oDB_1 != null) { Marshal.ReleaseComObject(oDB_1); } oDB_1 = null;
            if (oUDS != null) { Marshal.ReleaseComObject(oUDS); } oUDS = null;
            if (oButton != null) { Marshal.ReleaseComObject(oButton); } oButton = null;
            if (oMatrix != null) { Marshal.ReleaseComObject(oMatrix); } oMatrix = null;
           
            if (oRS != null) { Marshal.ReleaseComObject(oRS); } oRS = null;
            if (oEditText != null) { Marshal.ReleaseComObject(oEditText); } oEditText = null;

            if ((pForm != null)) { Marshal.ReleaseComObject(pForm); } pForm = null;
            if ((oForm != null)) { Marshal.ReleaseComObject(oForm); } oForm = null;
            // ADD YOUR ACTION CODE HERE ...
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
        }
Exemplo n.º 42
0
        public virtual void ET_edtCOAMCD_AFValidate(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtCOAMCD").Specific));
            // ADD YOUR ACTION CODE HERE ....

            if (oEditText.Value == "")
            {
                oDB_M.SetValue("U_COAMCD", 0, "");
                oDB_M.SetValue("U_COMAMT", 0, "");
                oForm.Items.Item("edtCOMAMCD").Enabled = false;
                oDB_M.SetValue("U_COMAMCD", 0, "");
                oDB_M.SetValue("U_COMAMNM", 0, "");
            }
            else
                oForm.Items.Item("edtCOMAMCD").Enabled = true;

        }
Exemplo n.º 43
0
        private void ClearUnManagedObject() {
			if ( oFolder != null ) { Marshal.ReleaseComObject(oFolder); } oFolder = null;
            if (oEditText != null) { Marshal.ReleaseComObject(oEditText); } oEditText = null;
            if (oButton != null) { Marshal.ReleaseComObject(oButton); } oButton = null;
            if (oComboBox != null) { Marshal.ReleaseComObject(oComboBox); } oComboBox = null;
            if ((oForm != null)) { Marshal.ReleaseComObject(oForm); } oForm = null;
            if ((oGrid1 != null)) { Marshal.ReleaseComObject(oGrid1); } oForm = null;
            if ((oGrid2 != null)) { Marshal.ReleaseComObject(oGrid2); } oForm = null;
            if ((oGrid3 != null)) { Marshal.ReleaseComObject(oGrid3); } oForm = null;
            if ((oGrid4 != null)) { Marshal.ReleaseComObject(oGrid4); } oForm = null;
            if ((oRS != null)) { Marshal.ReleaseComObject(oRS); } oForm = null;
            // ADD YOUR ACTION CODE HERE ...
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();

            GRIDCODE = "";
        }
Exemplo n.º 44
0
        public virtual void ET_edtEMPNO_OnLostFocus(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtEMPNO").Specific));
            // ADD YOUR ACTION CODE HERE ...
            if (oForm.Items.Item("edtEMPNO").Specific.Value == "")
            {
                oForm.Items.Item("edtEMPNM").Specific.Value = "";
            }

        }
Exemplo n.º 45
0
        public virtual bool ET_edtDATE_BFKeyDown(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtDATE").Specific));
            // ADD YOUR ACTION CODE HERE ...

            if ((pVal.CharPressed != 8) && (pVal.CharPressed != 9) && (pVal.CharPressed != 13))
            {
                if (!((pVal.CharPressed >= 48) && (pVal.CharPressed <= 57)))
                {
                    B1Connections.theAppl.StatusBar.SetText("숫자만 입력해야합니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    return false;
                }
            } return true;
        }
Exemplo n.º 46
0
        public virtual void ET_edtPRCCD_AFChooseFromList(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtPRCCD").Specific));
            // ADD YOUR ACTION CODE HERE ...
            SAPbouiCOM.DataTable oDataTable = null;

            oDataTable = FN.GetCFLSelectedObjects(pVal);

            try
            {
                if (oDataTable != null)
                {
                    
                    oForm.DataSources.UserDataSources.Item("edtPRCCD").Value = oDataTable.GetValue("PrcCode", 0).ToString();
                    oForm.DataSources.UserDataSources.Item("edtPRCNM").Value = oDataTable.GetValue("PrcName", 0).ToString();

                    //oEditText.Value = oDataTable.GetValue("PrcCode", 0).ToString();
                    //((SAPbouiCOM.EditText)oForm.Items.Item("edtPRCNM").Specific).Value = oDataTable.GetValue("PrcName", 0).ToString();

                    //SetGridColumn_U_PRCCD();
                    edtPRCCD_Changed = true;

                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oDataTable = null;
            }
        }
Exemplo n.º 47
0
        public virtual void ET_edtORDERNM_AFChooseFromList(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtORDERNM").Specific));
            // ADD YOUR ACTION CODE HERE ...
            SAPbouiCOM.DataTable oDataTable = null;

            oDataTable = FN.GetCFLSelectedObjects(pVal);

            SAPbouiCOM.DBDataSource oKIS_SD0030T_HRD = oForm.DataSources.DBDataSources.Item("@KIS_SD0030T_HRD");

            try
            {
                if (oDataTable != null)
                {

                    oKIS_SD0030T_HRD.SetValue("U_ORDERCD", 0, oDataTable.GetValue("Code", 0).ToString());
                    oKIS_SD0030T_HRD.SetValue("U_ORDERNM", 0, oDataTable.GetValue("Name", 0).ToString());
                    oKIS_SD0030T_HRD.SetValue("U_ORDERRA", 0, _ORDERRATE.ToString());

                    this.SetMatrixRateColumn("U_ORDERRAT", _ORDERRATE.ToString());

                    if (oForm.Mode == BoFormMode.fm_OK_MODE)
                        oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oKIS_SD0030T_HRD = null;
                oDataTable = null;
            }

        }
Exemplo n.º 48
0
        private void ClearUnManagedObject() 
        {
            if (oUDS != null) { Marshal.ReleaseComObject(oUDS); } oUDS = null;
            if (oComboBox != null) { Marshal.ReleaseComObject(oComboBox); } oComboBox = null;
            if (oEditText != null) { Marshal.ReleaseComObject(oEditText); } oEditText = null;
            if (oGrid != null) { Marshal.ReleaseComObject(oGrid); } oGrid = null;
            if (oButton != null) { Marshal.ReleaseComObject(oButton); } oButton = null;
            if ((oForm != null)) { Marshal.ReleaseComObject(oForm); } oForm = null;

            // ADD YOUR ACTION CODE HERE ...
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
        }
Exemplo n.º 49
0
        public virtual bool ET_edtBPRATE_BFValidate(ItemEvent pVal) {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtBPRATE").Specific));
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                oMatrix = oForm.Items.Item("mtx1").Specific;

                if (pVal.ItemChanged)
                {
                    this.SetMatrixRateColumn("U_BPRATE", oEditText.Value);
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            return true;
        }
Exemplo n.º 50
0
        public virtual void ET_edtCALLPER_AFValidate(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtCALLPER").Specific));
            // ADD YOUR ACTION CODE HERE ....

            if (pVal.ItemChanged == true)
            {
                if (oEditText.Value == "")
                {
                    oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                    oDB_M.SetValue("U_CALLNM", 0, "");
                }
            }
        }
Exemplo n.º 51
0
        public virtual void ET_edtACCTCD_AFChooseFromList(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtACCTCD").Specific));
            // ADD YOUR ACTION CODE HERE ...
            SAPbouiCOM.DataTable oDataTable = null;

            oDataTable = FN.GetCFLSelectedObjects(pVal);

            try
            {
                if (oDataTable != null)
                {

                    oForm.DataSources.UserDataSources.Item("edtACCOUNT").Value = oDataTable.GetValue("Account", 0).ToString();
                    oForm.DataSources.UserDataSources.Item("edtACCTCD").Value = oDataTable.GetValue("GLAccount", 0).ToString();
                    oForm.DataSources.UserDataSources.Item("edtACCTNM").Value = FN.GetRecordsetValue(string.Format("SELECT AcctName FROM [OACT] WHERE AcctCode = '{0}'", oDataTable.GetValue("GLAccount", 0).ToString()));

                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oDataTable = null;
            }
        }
Exemplo n.º 52
0
 public virtual bool ET_edtAC09_BFValidate(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtAC09").Specific));
     // ADD YOUR ACTION CODE HERE ...
     try
     {
         if (oEditText.Value == "" && pVal.ItemChanged == true)
         {
             SAPbouiCOM.StaticText oStatic = (SAPbouiCOM.StaticText)oForm.Items.Item("sttAC09_1").Specific;
             oStatic.Caption = "";
         }
     }
     catch (Exception ex)
     {
         B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
     }
     return true;
 }
Exemplo n.º 53
0
        public virtual void ET_edtCENTCD2_AFChooseFromList(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtCENTCD2").Specific));
            // ADD YOUR ACTION CODE HERE ...

            //데이터를 가져오기 위해 데이터테이블 추가
            SAPbouiCOM.DataTable oDataTable = FN.GetCFLSelectedObjects(pVal);

            try
            {
                if (oDataTable != null)
                {
                    oForm.DataSources.UserDataSources.Item("edtCENTCD2").Value = oDataTable.GetValue("Code", 0).ToString();
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText("ET_edtCENTCD2_AFChooseFromList " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oDataTable = null;
            }
        }
Exemplo n.º 54
0
        private void ClearUnManagedObject()
        {
            if (oComboBox != null) { Marshal.ReleaseComObject(oComboBox); } oComboBox = null;
            if (oGrid != null) { Marshal.ReleaseComObject(oGrid); } oGrid = null;
            if (oUDS != null) { Marshal.ReleaseComObject(oUDS); } oUDS = null;
            //if (gDs.Tables[oForm.UniqueID + "_Deliver"] != null) gDs.Tables[oForm.UniqueID + "_Deliver"] = null;
            //if (gDs.Tables[oForm.UniqueID + "_Call"] != null) gDs.Tables[oForm.UniqueID + "_Call"] = null;
            if (gDs != null)
            {
                if(gDs.Tables.Contains(oForm.UniqueID + "_Deliver"))
                {
                    gDs.Tables.Remove(oForm.UniqueID + "_Deliver");
                }

                if (gDs.Tables.Contains(oForm.UniqueID + "_Call"))
                {
                    gDs.Tables.Remove(oForm.UniqueID + "_Call");
                }
            }
            if (oDB_M != null) { Marshal.ReleaseComObject(oDB_M); } oDB_M = null;
            if (oMatrix != null) { Marshal.ReleaseComObject(oMatrix); } oMatrix = null;
            if (oDB1_O != null) { Marshal.ReleaseComObject(oDB1_O); } oDB1_O = null;
            if (oDB1_Z != null) { Marshal.ReleaseComObject(oDB1_Z); } oDB1_Z = null;
            if (oDB2_O != null) { Marshal.ReleaseComObject(oDB2_O); } oDB2_O = null;
            if (oDB2_Z != null) { Marshal.ReleaseComObject(oDB2_Z); } oDB2_Z = null;
            if (oRS != null) { Marshal.ReleaseComObject(oRS); } oRS = null;
            if (oEditText != null) { Marshal.ReleaseComObject(oEditText); } oEditText = null;

            if ((oForm != null))
            {
                Marshal.ReleaseComObject(oForm);
            }
            oForm = null;
            // ADD YOUR ACTION CODE HERE ...
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
        }
Exemplo n.º 55
0
        public virtual void ET_edtCALLPER_AFChooseFromList(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtCALLPER").Specific));
            // ADD YOUR ACTION CODE HERE ...

            //데이터를 가져오기 위해 데이터테이블 추가

            SAPbouiCOM.DataTable oDataTable = FN.GetCFLSelectedObjects(pVal);

            try
            {
                if (oForm.Mode != BoFormMode.fm_FIND_MODE)
                {
                    if (oDataTable != null)
                    {
                        oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                        oDB_M.SetValue("U_CALLPER", 0, oDataTable.GetValue("USER_CODE", 0).ToString());
                        oDB_M.SetValue("U_CALLNM", 0, oDataTable.GetValue("U_NAME", 0).ToString());
                        if (oForm.Mode == BoFormMode.fm_OK_MODE)
                            oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                    }
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText("ET_edtCALLPER_AFChooseFromList " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oDataTable = null;
            }
        }
Exemplo n.º 56
0
        public virtual bool ET_edtTODELCD_BFChooseFromList(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtTORECDT").Specific));
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                string pCol = "edtTODELCD";
                string ColName = ((SAPbouiCOM.StaticText)oForm.Items.Item("sttFRDELCD").Specific).Caption;
                string Col = "U_DELVCD";
                string FRCol = oForm.Items.Item("edtFRRDCD").Specific.value;
                string TOCol = oForm.Items.Item("edtTORDCD").Specific.value;
                this.LoadSubForm(oForm, "KIS_SO0081F_HRD", pCol, ColName, Col, FRCol, TOCol);
                return false;
            }
            catch (Exception ex)
            {

                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            return false;
        }
Exemplo n.º 57
0
        public virtual void ET_edtADDR2_AFKeyDown(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtADDR2").Specific));
            // ADD YOUR ACTION CODE HERE ...

            if (pVal.CharPressed == 9 && oEditText.Value == "")
                OpenPopup_Address(oForm, "MST_거리주소", SO.SO_COMMON_HRD.ZipCodeTypes.Road);
        }
Exemplo n.º 58
0
 public virtual void ET_edtAC09_AFChooseFromList(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtAC09").Specific));
     // ADD YOUR ACTION CODE HERE ...
     SetChooseFromList_AfterAction(pVal, "AC09");
 }
Exemplo n.º 59
0
 public virtual void ET_edtR_FRDT_AFValidate(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtR_FRDT").Specific));
     // ADD YOUR ACTION CODE HERE ...
     ItemValidate(oForm, pVal.ItemUID);
 }
Exemplo n.º 60
0
 public virtual void ET_edtCENT_T_AFChooseFromList(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtCENT_T").Specific));
     // ADD YOUR ACTION CODE HERE ...
     SetChooseFromListValue(oForm, pVal);
 }