Ejemplo n.º 1
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;
        }
        /// <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);
            }
        }
        public static SAPbouiCOM.ComboBox AddComboBoxAoFormulario(
            SAPbouiCOM.Form pForm
            , string pUID
            , int pLeft
            , int pWidth
            , int pTop
            , int pHeight

            )
        {
            //SAPbouiCOM.Button oButton = null;
            SAPbouiCOM.Item     oItem     = null;
            SAPbouiCOM.ComboBox oComboBox = null;

            oItem                 = pForm.Items.Add(pUID, BoFormItemTypes.it_COMBO_BOX);
            oItem.Left            = pLeft;
            oItem.Width           = pWidth;
            oItem.Top             = pTop;
            oItem.Height          = pHeight;
            oItem.AffectsFormMode = false;
            oItem.DisplayDesc     = true;

            oComboBox = ((SAPbouiCOM.ComboBox)(oItem.Specific));

            return(oComboBox);
        }
Ejemplo n.º 4
0
        private static void SBO_Application_ItemEvent(string FormUID, ref ItemEvent pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            if (pVal.FormType == 866 && pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD)
            {
                oForm    = SAPbouiCOM.Framework.Application.SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                oOldItem = oForm.Items.Item("4");
                Matrix matrix = (SAPbouiCOM.Matrix)oOldItem.Specific;
                ExchangeForm.ExchangeForm.GetCurs(matrix, Month, Year);
            }
            if (pVal.FormType == 866 && pVal.FormMode == 1 && pVal.EventType == SAPbouiCOM.BoEventTypes.et_COMBO_SELECT)
            {
                oForm = SAPbouiCOM.Framework.Application.SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);

                if (pVal.ItemUID.ToString() == "12")
                {
                    oOldItem = oForm.Items.Item("4");
                    Matrix matrix = (SAPbouiCOM.Matrix)oOldItem.Specific;
                    oOldItem = oForm.Items.Item("12");
                    SAPbouiCOM.ComboBox cb = (SAPbouiCOM.ComboBox)oOldItem.Specific;
                    Year = cb.Value;
                    ExchangeForm.ExchangeForm.GetCurs(matrix, Month, Year);
                }
                if (pVal.ItemUID.ToString() == "13")
                {
                    oOldItem = oForm.Items.Item("4");
                    Matrix matrix = (SAPbouiCOM.Matrix)oOldItem.Specific;
                    oOldItem = oForm.Items.Item("13");
                    SAPbouiCOM.ComboBox cb = (SAPbouiCOM.ComboBox)oOldItem.Specific;
                    Month = cb.Selected.Value;

                    ExchangeForm.ExchangeForm.GetCurs(matrix, Month, Year);
                }
            }
        }
Ejemplo n.º 5
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);
            }
        }
        private void AddItems(SAPbouiCOM.Form oFormPurchaseRequest)
        {
            SAPbouiCOM.Item       oCamposPurchaseRequest = null;
            SAPbouiCOM.Form       _oFormPurchaseRequest;
            SAPbouiCOM.StaticText oStaticText = null;
            SAPbouiCOM.Item       oItem;
            SAPbouiCOM.ComboBox   oComboBox = null;

            _oFormPurchaseRequest = oFormPurchaseRequest;

            //*******************************************
            // Se adiciona Label "Integrar Documento"
            //*******************************************

            oItem = _oFormPurchaseRequest.Items.Item("62");

            oCamposPurchaseRequest        = _oFormPurchaseRequest.Items.Add("blbID", SAPbouiCOM.BoFormItemTypes.it_STATIC);
            oCamposPurchaseRequest.Left   = oItem.Left + 10;
            oCamposPurchaseRequest.Width  = oItem.Width;
            oCamposPurchaseRequest.Top    = oItem.Top;
            oCamposPurchaseRequest.Height = oItem.Height;

            oCamposPurchaseRequest.LinkTo = "ComboBox1";

            oStaticText = ((SAPbouiCOM.StaticText)(oCamposPurchaseRequest.Specific));

            oStaticText.Caption = "Integrar Documento ?";

            oCamposPurchaseRequest.FromPane = 5;
            oCamposPurchaseRequest.ToPane   = 5;

            //*******************************************
            // Se adiciona Combo box "Integrar Documento"
            //*******************************************

            oCamposPurchaseRequest        = _oFormPurchaseRequest.Items.Add("ComboBox1", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX);
            oCamposPurchaseRequest.Left   = oItem.Left + 120;
            oCamposPurchaseRequest.Width  = oItem.Width;
            oCamposPurchaseRequest.Top    = oItem.Top;
            oCamposPurchaseRequest.Height = oItem.Height;

            oCamposPurchaseRequest.DisplayDesc = true;

            _oFormPurchaseRequest.DataSources.UserDataSources.Add("CombSource", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 20);

            oComboBox = ((SAPbouiCOM.ComboBox)(oCamposPurchaseRequest.Specific));


            oComboBox.DataBind.SetBound(true, "", "CombSource");

            oComboBox.ValidValues.Add("Y", "Si");
            oComboBox.ValidValues.Add("N", "No");

            oComboBox.Select("Y", BoSearchKey.psk_ByValue);

            oCamposPurchaseRequest.FromPane = 5;
            oCamposPurchaseRequest.ToPane   = 5;
        }
Ejemplo n.º 8
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);
            dbOITM = oForm.DataSources.DBDataSources.Item("OITM");



            oItemRef = oForm.Items.Item("39");
            SAPbouiCOM.StaticText lblCode, lblName, lblInt;
            SAPbouiCOM.CheckBox   chkAll, chkMon, chkTue, chkWed, chkThs, chkFri, chkSat, chkSun;
            SAPbouiCOM.ComboBox   cbInt;
            SAPbouiCOM.EditText   txtCode, txtName;


            try
            {
                SAPbouiCOM.Item oItemRef1 = oForm.Items.Item("106");


                oItem         = oForm.Items.Add("B1_lbSub", SAPbouiCOM.BoFormItemTypes.it_STATIC);
                oItem.Top     = oItemRef.Top;
                oItem.Height  = oItemRef.Height;
                oItem.Left    = oItemRef1.Left;
                oItem.Width   = oItemRef.Width + 40;
                oItem.Visible = true;
                B1_lbSub      = (SAPbouiCOM.StaticText)oItem.Specific;

                B1_lbSub.Caption = "Sub Group";

                oItemRef1 = oForm.Items.Item("107");

                oItem             = oForm.Items.Add("cbSubGroup", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX);
                oItem.Top         = oItemRef.Top;
                oItem.Height      = oItemRef.Height;
                oItem.Left        = oItemRef1.Left;
                oItem.Width       = oItemRef.Width + 90;
                oItem.Visible     = true;
                oItem.DisplayDesc = true;
                oItem.LinkTo      = "B1_lbSub";
                cbSubGroup        = (SAPbouiCOM.ComboBox)oItem.Specific;

                cbSubGroup.DataBind.SetBound(true, "OITM", "U_SubGrp");


                //   <databind>
                //    <DataTable UniqueId="dtHead" ColumnUID="RNN"/>
                //  </databind>
                //</specific>
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }

            oForm.Freeze(false);
            dsSAP = new DataServices(Program.strConSAP);
        }
Ejemplo n.º 9
0
        }//fin InitForm

        public new void FormEvent(String FormUID, ref SAPbouiCOM.ItemEvent pVal, ref Boolean BubbleEvent)
        {
            SAPbouiCOM.DataTable            oDataTable;
            SAPbouiCOM.IChooseFromListEvent oCFLEvento = null;
            base.FormEvent(FormUID, ref pVal, ref BubbleEvent);

            try
            {
                if ((pVal.ItemUID == "87") && (pVal.EventType == BoEventTypes.et_COMBO_SELECT) && (pVal.BeforeAction))
                {
                    oComboBox     = (ComboBox)(oForm.Items.Item("87").Specific);
                    SerieAnterior = (System.String)(oComboBox.Value);
                }

                if ((pVal.ItemUID == "87") && (pVal.EventType == BoEventTypes.et_COMBO_SELECT) && (!pVal.BeforeAction))
                {
                    oComboBox = (ComboBox)(oForm.Items.Item("87").Specific);
                    var sSeries = (System.String)(oComboBox.Value);

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"select LEFT(ISNULL(UPPER(BeginStr),''),1) 'Valor', DocSubType, SUBSTRING(ISNULL(UPPER(BeginStr),''),2,LEN(ISNULL(UPPER(BeginStr),''))) 'Doc', ObjectCode, SeriesName
                                from NNM1 where Series = {0} --AND ObjectCode = '{1}' ";
                    }
                    else
                    {
                        s = @"select LEFT(IFNULL(UPPER(""BeginStr""),''),1) ""Valor"", ""DocSubType"", SUBSTRING(IFNULL(UPPER(""BeginStr""),''),2,LENGTH(IFNULL(UPPER(""BeginStr""),''))) ""Doc"", ""ObjectCode"", ""SeriesName""
                                from ""NNM1"" where ""Series"" = {0} --AND ""ObjectCode"" = '{1}' ";
                    }
                    s = String.Format(s, sSeries, oForm.BusinessObject.Type);
                    oRecordSet.DoQuery(s);
                    if (oRecordSet.RecordCount > 0)
                    {
                        if ((System.String)(oRecordSet.Fields.Item("Valor").Value) == "E")
                        {
                            oForm.Items.Item("VID_Estado").Visible = true;
                            oForm.Items.Item("lblEstado").Visible  = true;
                            oForm.Items.Item("VID_FEDCTO").Visible = true;
                        }
                        else
                        {
                            oForm.Items.Item("VID_Estado").Visible = false;
                            oForm.Items.Item("lblEstado").Visible  = false;
                        }
                    }
                }
            }
            catch (Exception e)
            {
                if (FCmpny.InTransaction)
                {
                    FCmpny.EndTransaction(BoWfTransOpt.wf_RollBack);
                }
                FSBOApp.StatusBar.SetText(e.Message + " ** Trace: " + e.StackTrace, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                OutLog("FormEvent: " + e.Message + " ** Trace: " + e.StackTrace);
            }
        }//fin FormEvent
Ejemplo n.º 10
0
        }//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;
            String AbsDesde;
            String FDesde, FHasta;
            String TipoLibro;

            try
            {
                if ((pVal.EventType == BoEventTypes.et_ITEM_PRESSED) && (!pVal.BeforeAction))
                {
                    if (pVal.ItemUID == "btn1")
                    {
                        //enviar libro al portal
                        oComboBox = ((ComboBox)oForm.Items.Item("Periodo").Specific);
                        AbsDesde  = oComboBox.Selected.Value;

                        if (GlobalSettings.RunningUnderSQLServer)
                        {
                            s = @"select F_RefDate, T_RefDate,* from OFPR where AbsEntry = {0}";
                        }
                        else
                        {
                            s = @"select ""F_RefDate"", ""T_RefDate"" from ""OFPR"" where ""AbsEntry"" = {0}";
                        }
                        s = String.Format(s, AbsDesde);
                        oRecordSet.DoQuery(s);
                        FDesde = ((System.DateTime)oRecordSet.Fields.Item("F_RefDate").Value).ToString("yyyyMMdd");
                        FHasta = ((System.DateTime)oRecordSet.Fields.Item("T_RefDate").Value).ToString("yyyyMMdd");

                        oComboBox = ((ComboBox)oForm.Items.Item("TipoLibro").Specific);
                        TipoLibro = oComboBox.Selected.Value;

                        if (FSBOApp.MessageBox("¿ Desea enviar libro electronico al portal ?", 1, "Si", "No", "") == 1)
                        {
                            EnviarLibros(TipoLibro, FDesde, FHasta);
                        }
                    }
                }
            }
            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
Ejemplo n.º 11
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);
        }
        public static SAPbouiCOM.ComboBox AddComboBoxAoFormulario(
            SAPbouiCOM.Form pForm
            , string pUID
            , int pLeft
            , int pWidth
            , int pTop
            , int pHeight
            , bool AffectsFormMode = false
            , int pFromPane        = 0
            , int pToPane          = 0

            )
        {
            //SAPbouiCOM.Button oButton = null;
            SAPbouiCOM.Item     oItem     = null;
            SAPbouiCOM.ComboBox oComboBox = null;

            oItem = pForm.Items.Add(pUID, BoFormItemTypes.it_COMBO_BOX);

            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;
            }
            oItem.DisplayDesc = true;
            oComboBox         = ((SAPbouiCOM.ComboBox)(oItem.Specific));
            return(oComboBox);
        }
Ejemplo n.º 13
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();
        }
Ejemplo n.º 14
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
            }
        }
Ejemplo n.º 15
0
        public static string getDescriptionFromComboBox(SAPbouiCOM.Form objForm, string sItemUID)
        {
            SAPbouiCOM.ComboBox objComboBox = null;
            string sValor = "";

            try
            {
                objComboBox = ((SAPbouiCOM.ComboBox)(objForm.Items.Item(sItemUID).Specific));
                if (objComboBox.Selected != null)
                {
                    sValor = objComboBox.Selected.Description;
                }
            }
            catch (Exception e)
            {
                //ExceptionAddOn.GetInstance().throwException("HELPERS", "3.0", e);
                B1Connections.theAppl.SetStatusBarMessage(String.Format("Helpers.getValueFormUserDataSource - {0}", e.Message));
            }

            return(sValor);
        }
Ejemplo n.º 16
0
        }//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());
                        oComboBox         = (ComboBox)(oForm.Items.Item("TipoLibro").Specific);
                        TLibros.TipoLibro = oComboBox.Selected.Value;
                        oEditText         = (EditText)(oForm.Items.Item("Desde").Specific);
                        TLibros.Desde     = oEditText.Value;
                        oEditText         = (EditText)(oForm.Items.Item("Hasta").Specific);
                        TLibros.Hasta     = oEditText.Value;
                        TLibros.bMultiSoc = bMultiSoc;
                        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
Ejemplo n.º 17
0
        public virtual bool ET_cboSTATUS_BFClick(ItemEvent pVal) {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oComboBox = ((SAPbouiCOM.ComboBox)(oForm.Items.Item("cboSTATUS").Specific));
            // ADD YOUR ACTION CODE HERE ...
            oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);

            try
            {
                string sql = string.Format(" SELECT U_RMK2 FROM [@KIS_AD00201] WHERE CODE = 'HR01' AND U_USEYN = 'Y' AND U_SMLCD = '{0}'",oForm.Items.Item("cboYEAR").Specific.Value);
                oRS.DoQuery(sql);

                if (!string.IsNullOrEmpty(oRS.Fields.Item("U_RMK2").Value.ToString()))
                    SetComboValue_STATUS(ref oComboBox, FN.Enum_WholeTp.m_Nothing, oRS.Fields.Item("U_RMK2").Value.ToString());
            }

            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                return false;
            }
            finally
            {
                oForm.Items.Item("btnSAVE").Enabled = false;
                STATE = false;
                oRS = null;
            }
            return true;
        }
Ejemplo n.º 18
0
        public virtual void ET_cboYEAR_AFComboSelect(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oComboBox = ((SAPbouiCOM.ComboBox)(oForm.Items.Item("cboYEAR").Specific));
            // ADD YOUR ACTION CODE HERE ...
            oForm.Items.Item("btnSAVE").Enabled = false;

            oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboSTATUS").Specific;
            string sql = string.Format(" SELECT U_RMK2 FROM [@KIS_AD00201] WHERE CODE = 'HR01' AND U_USEYN = 'Y' AND U_SMLCD = '{0}'",oForm.Items.Item("cboYEAR").Specific.Value);
            oRS.DoQuery(sql);
            oComboBox.Select(oRS.Fields.Item("U_RMK2").Value.ToString(), BoSearchKey.psk_ByValue);

        }
Ejemplo n.º 19
0
 public virtual void ET_cboBPLID_AFComboSelect(ItemEvent pVal) {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oComboBox = ((SAPbouiCOM.ComboBox)(oForm.Items.Item("cboBPLID").Specific));
     // ADD YOUR ACTION CODE HERE ...
     try
     {
         if (pVal.ItemChanged)
         {
             string cboBPLID = oForm.DataSources.UserDataSources.Item("cboBPLID").Value;
             oForm.DataSources.UserDataSources.Item("edtVATRNUM").Value = FN.GetRecordsetValue(string.Format("SELECT VATRegNum FROM dbo.[OBPL] WHERE BPLId =  '{0}'", cboBPLID));
         }
     }
     catch (Exception)
     {
         
         throw;
     }
 }
Ejemplo n.º 20
0
        private void InitiallizeForm()
        {
            //  dtHead = oForm.DataSources.DataTables.Item("dtHead");
            // dtHead.Rows.Add(1);

            dtPendingJEs.Columns.Add("V#");
            dtPendingJEs.Columns.Add("Date");
            dtPendingJEs.Columns.Add("Remarks");
            dtPendingJEs.Columns.Add("Month");
            dtPendingJEs.Columns.Add("Year");
            dtPendingJEs.Columns.Add("Posted");
            dtPendingJEs.Columns.Add("PostedJE");
            dtPendingJEs.Columns.Add("Canceled");
            dtPendingJEs.Columns.Add("CanceledJE");

            oForm.Freeze(true);
            mtJE   = oForm.Items.Item("mtJE").Specific;
            mtDet  = oForm.Items.Item("mtDet").Specific;
            dtDet  = oForm.DataSources.DataTables.Item("dtDet");
            dtHead = oForm.DataSources.DataTables.Item("dtHead");
            cbOr   = oForm.Items.Item("cbOr").Specific;
            IcbOr  = oForm.Items.Item("cbOr");
            cbOr.ValidValues.Add("All", "All");
            fillUserCb();

            oForm.DataSources.UserDataSources.Add("txDN", SAPbouiCOM.BoDataType.dt_LONG_NUMBER, 15); // Days of Month
            txDN  = oForm.Items.Item("txDN").Specific;
            ItxDN = oForm.Items.Item("txDN");
            txDN.DataBind.SetBound(true, "", "txDN");


            oForm.DataSources.UserDataSources.Add("txCJ", SAPbouiCOM.BoDataType.dt_LONG_NUMBER, 15); // Days of Month
            txCJ  = oForm.Items.Item("txCJ").Specific;
            itxCJ = oForm.Items.Item("txCJ");
            txCJ.DataBind.SetBound(true, "", "txCJ");


            oForm.DataSources.UserDataSources.Add("txPJ", SAPbouiCOM.BoDataType.dt_LONG_NUMBER, 15); // Days of Month
            txPJ  = oForm.Items.Item("txPJ").Specific;
            itxPJ = oForm.Items.Item("txPJ");
            txPJ.DataBind.SetBound(true, "", "txPJ");



            oForm.DataSources.UserDataSources.Add("txDD", SAPbouiCOM.BoDataType.dt_DATE); // Days of Month
            txDD  = oForm.Items.Item("txDD").Specific;
            ItxDD = oForm.Items.Item("txDD");
            txDD.DataBind.SetBound(true, "", "txDD");

            oForm.DataSources.UserDataSources.Add("txRem", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 50); // Days of Month
            txRem  = oForm.Items.Item("txRem").Specific;
            ItxRem = oForm.Items.Item("txRem");
            txRem.DataBind.SetBound(true, "", "txRem");

            oForm.DataSources.UserDataSources.Add("txRef1", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 30); // Days of Month
            txRef1  = oForm.Items.Item("txRef1").Specific;
            ItxRef1 = oForm.Items.Item("txRef1");
            txRef1.DataBind.SetBound(true, "", "txRef1");

            oForm.DataSources.UserDataSources.Add("txRef2", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 30);    // Days of Month
            txRef2  = oForm.Items.Item("txRef2").Specific;
            ItxRef2 = oForm.Items.Item("txRef2");
            txRef2.DataBind.SetBound(true, "", "txRef2");

            oForm.DataSources.UserDataSources.Add("txDS", SAPbouiCOM.BoDataType.dt_SUM);      // Days of Month
            txDS  = oForm.Items.Item("txDS").Specific;
            ItxDS = oForm.Items.Item("txDS");
            txDS.DataBind.SetBound(true, "", "txDS");


            oForm.DataSources.UserDataSources.Add("txCS", SAPbouiCOM.BoDataType.dt_SUM);      // Days of Month
            txCS  = oForm.Items.Item("txCS").Specific;
            ItxCS = oForm.Items.Item("txCS");
            txCS.DataBind.SetBound(true, "", "txCS");


            oForm.DataSources.UserDataSources.Add("chkPost", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); // Days of Month
            chkPost  = oForm.Items.Item("chkPost").Specific;
            IchkPost = oForm.Items.Item("chkPost");
            chkPost.DataBind.SetBound(true, "", "chkPost");

            oForm.DataSources.UserDataSources.Add("optPP", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); // Days of Month
            optPP  = oForm.Items.Item("optPP").Specific;
            ioptPP = oForm.Items.Item("optPP");
            optPP.DataBind.SetBound(true, "", "optPP");

            oForm.DataSources.UserDataSources.Add("optC", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); // Days of Month
            optC  = oForm.Items.Item("optC").Specific;
            ioptC = oForm.Items.Item("optC");
            optC.DataBind.SetBound(true, "", "optC");

            oForm.DataSources.UserDataSources.Add("optPC", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); // Days of Month
            optPC  = oForm.Items.Item("optPC").Specific;
            ioptPC = oForm.Items.Item("optPC");
            optPC.DataBind.SetBound(true, "", "optPC");

            optC.GroupWith("optPP");
            optPC.GroupWith("optPP");
            optPP.Selected = true;

            btPost = oForm.Items.Item("btPost").Specific;

            lnkBG    = oForm.Items.Item("lnkBG").Specific;
            IchkPost = oForm.Items.Item("lnkBG");
        }
Ejemplo n.º 21
0
        private void ClearUnManagedObject() {
			if ( oEditText != null ) { Marshal.ReleaseComObject(oEditText); } oEditText = null;
            if (oComboBox != null) { Marshal.ReleaseComObject(oComboBox); } oComboBox = null;
            if ((oForm != null)) { Marshal.ReleaseComObject(oForm); } oForm = null;
            if (oMatrix != null) { Marshal.ReleaseComObject(oMatrix); } oMatrix = null;
            if (oButton != null) { Marshal.ReleaseComObject(oButton); } oButton = null;
            if (oDB_M != null) { Marshal.ReleaseComObject(oDB_M); } oDB_M = null;
            if (oDB_1 != null) { Marshal.ReleaseComObject(oDB_1); } oDB_1 = null;
            // ADD YOUR ACTION CODE HERE ...
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
        }
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            Int32 CantRol;

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

            oRecordSet      = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
            Funciones.SBO_f = FSBOf;
            try
            {
                Lista = new List <string>();

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

                oForm.DataSources.UserDataSources.Add("Periodo", BoDataType.dt_SHORT_TEXT, 10);
                ((ComboBox)oForm.Items.Item("Periodo").Specific).DataBind.SetBound(true, "", "Periodo");

                oForm.DataSources.UserDataSources.Add("PeriodoD", BoDataType.dt_SHORT_TEXT, 10);
                ((ComboBox)oForm.Items.Item("PeriodoD").Specific).DataBind.SetBound(true, "", "PeriodoD");

                oForm.DataSources.UserDataSources.Add("PeriodoH", BoDataType.dt_SHORT_TEXT, 10);
                ((ComboBox)oForm.Items.Item("PeriodoH").Specific).DataBind.SetBound(true, "", "PeriodoH");

                odt            = oForm.DataSources.DataTables.Add("grid");
                grid           = ((Grid)oForm.Items.Item("grid").Specific);
                grid.DataTable = odt;


                if ((TipoLibro == "D") || (TipoLibro == "M")) //Libro Mayor y Diario
                {
                    s = "Periodo";
                    oForm.Items.Item(s).Click(BoCellClickType.ct_Regular);
                    if (TipoLibro == "D")
                    {
                        oForm.Title = "Libro Diario y Mayor";
                    }

                    oForm.PaneLevel = 1;
                    oForm.Items.Item("5").Visible        = false;
                    oForm.Items.Item("PeriodoD").Visible = false;
                    oForm.Items.Item("7").Visible        = false;
                    oForm.Items.Item("PeriodoH").Visible = false;

                    oForm.Items.Item("grid").Height   = 210;
                    oForm.Items.Item("grid2").Visible = true;

                    odt2            = oForm.DataSources.DataTables.Add("grid2");
                    grid2           = ((Grid)oForm.Items.Item("grid2").Specific);
                    grid2.DataTable = odt2;

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code', Code 'Name'
                              FROM OFPR
                             WHERE Category BETWEEN YEAR(GETDATE()) -1 AND YEAR(GETDATE())";
                    }
                    else
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"", ""Code"" ""Name""
                              FROM ""OFPR""
                             WHERE ""Category"" BETWEEN EXTRACT(YEAR FROM CURRENT_DATE) -1 AND EXTRACT(YEAR FROM CURRENT_DATE)";
                    }
                    oRecordSet.DoQuery(s);

                    oComboBox = ((ComboBox)oForm.Items.Item("Periodo").Specific);
                    FSBOf.FillCombo(oComboBox, ref oRecordSet, false);

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code' FROM OFPR WHERE CONVERT(CHAR(6), F_RefDate, 112) = CONVERT(CHAR(6), GETDATE(), 112)";
                    }
                    else
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"" FROM ""OFPR"" WHERE TO_VARCHAR(""F_RefDate"", 'yyyyMM') = TO_VARCHAR(CURRENT_DATE, 'yyyyMM')";
                    }
                    oRecordSet.DoQuery(s);
                    oComboBox.Select(((System.String)oRecordSet.Fields.Item("Code").Value), BoSearchKey.psk_ByValue);
                }
                else if (TipoLibro == "B")//Balance
                {
                    s = "PeriodoD";
                    oForm.Items.Item(s).Click(BoCellClickType.ct_Regular);
                    oForm.Title     = "Balance";
                    oForm.PaneLevel = 1;
                    oForm.Items.Item("4").Visible       = false;
                    oForm.Items.Item("Periodo").Visible = false;

                    oForm.Items.Item("grid").Height   = 210;
                    oForm.Items.Item("grid2").Visible = true;

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code', Code 'Name'
                              FROM OFPR
                             WHERE Category BETWEEN YEAR(GETDATE()) -1 AND YEAR(GETDATE())";
                    }
                    else
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"", ""Code"" ""Name""
                              FROM ""OFPR""
                             WHERE ""Category"" BETWEEN EXTRACT(YEAR FROM CURRENT_DATE) -1 AND EXTRACT(YEAR FROM CURRENT_DATE)";
                    }
                    oRecordSet.DoQuery(s);
                    oForm.Items.Item("PeriodoD").DisplayDesc = true;
                    oComboBox = ((ComboBox)oForm.Items.Item("PeriodoD").Specific);
                    FSBOf.FillCombo(oComboBox, ref oRecordSet, false);

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code' FROM OFPR WHERE CONVERT(CHAR(6), F_RefDate, 112) = CONVERT(CHAR(6), GETDATE(), 112)";
                    }
                    else
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"" FROM ""OFPR"" WHERE TO_VARCHAR(""F_RefDate"", 'yyyyMM') = TO_VARCHAR(CURRENT_DATE, 'yyyyMM')";
                    }
                    oRecordSet.DoQuery(s);
                    oComboBox.Select(((System.String)oRecordSet.Fields.Item("Code").Value), BoSearchKey.psk_ByValue);

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code', Code 'Name'
                              FROM OFPR
                             WHERE Category BETWEEN YEAR(GETDATE()) -1 AND YEAR(GETDATE())";
                    }
                    else
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"", ""Code"" ""Name""
                              FROM ""OFPR""
                             WHERE ""Category"" BETWEEN EXTRACT(YEAR FROM CURRENT_DATE) -1 AND EXTRACT(YEAR FROM CURRENT_DATE)";
                    }
                    oRecordSet.DoQuery(s);
                    oForm.Items.Item("PeriodoH").DisplayDesc = true;
                    oComboBox = ((ComboBox)oForm.Items.Item("PeriodoH").Specific);
                    FSBOf.FillCombo(oComboBox, ref oRecordSet, false);

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code' FROM OFPR WHERE CONVERT(CHAR(6), F_RefDate, 112) = CONVERT(CHAR(6), GETDATE(), 112)";
                    }
                    else
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"" FROM ""OFPR"" WHERE TO_VARCHAR(""F_RefDate"", 'yyyyMM') = TO_VARCHAR(CURRENT_DATE, 'yyyyMM')";
                    }
                    oRecordSet.DoQuery(s);
                    oComboBox.Select(((System.String)oRecordSet.Fields.Item("Code").Value), BoSearchKey.psk_ByValue);

                    odt2            = oForm.DataSources.DataTables.Add("grid2");
                    grid2           = ((Grid)oForm.Items.Item("grid2").Specific);
                    grid2.DataTable = odt2;
                }
                else if (TipoLibro == "C") //para Diccionario de cuentas
                {
                    oForm.Title = "Diccionario";
                    //oForm.PaneLevel = 2;
                    oForm.Items.Item("btnExp").Enabled = true;
                    oForm.PaneLevel = 1;
                    oForm.Items.Item("5").Visible        = false;
                    oForm.Items.Item("PeriodoD").Visible = false;
                    oForm.Items.Item("7").Visible        = false;
                    oForm.Items.Item("PeriodoH").Visible = false;

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code', Code 'Name'
                              FROM OFPR
                             WHERE Category BETWEEN YEAR(GETDATE()) -1 AND YEAR(GETDATE())";
                    }
                    else
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"", ""Code"" ""Name""
                              FROM ""OFPR""
                             WHERE ""Category"" BETWEEN EXTRACT(YEAR FROM CURRENT_DATE) -1 AND EXTRACT(YEAR FROM CURRENT_DATE)";
                    }
                    oRecordSet.DoQuery(s);

                    oComboBox = ((ComboBox)oForm.Items.Item("Periodo").Specific);
                    FSBOf.FillCombo(oComboBox, ref oRecordSet, false);

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code' FROM OFPR WHERE CONVERT(CHAR(6), F_RefDate, 112) = CONVERT(CHAR(6), GETDATE(), 112)";
                    }
                    else
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"" FROM ""OFPR"" WHERE TO_VARCHAR(""F_RefDate"", 'yyyyMM') = TO_VARCHAR(CURRENT_DATE, 'yyyyMM')";
                    }
                    oRecordSet.DoQuery(s);
                    oComboBox.Select(((System.String)oRecordSet.Fields.Item("Code").Value), BoSearchKey.psk_ByValue);
                }
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            finally
            {
                oForm.Freeze(false);
            }


            return(Result);
        }//fin InitForm
Ejemplo n.º 23
0
        public new bool InitForm(string uid, string xmlPath, ref SAPbouiCOM.Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            Int32 CantRol;

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

            oRecordSet      = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
            Funciones.SBO_f = FSBOf;
            try
            {
                Lista = new List <string>();
                FSBOf.LoadForm(xmlPath, "VID_FEMonDTE.srf", uid);
                //EnableCrystal := true;
                oForm = FSBOApp.Forms.Item(uid);
                oForm.Freeze(true);
                oForm.AutoManaged    = false;
                oForm.SupportedModes = -1;       // afm_All
                oForm.EnableMenu("1282", false); //Crear
                oForm.EnableMenu("1281", false); //Actualizar

                // Ok Ad  Fnd Vw Rq Sec
                //Lista.Add('DocNum    , f,  f,  t,  f, n, 1');
                //Lista.Add('DocDate   , f,  t,  f,  f, r, 1');
                //Lista.Add('CardCode  , f,  t,  t,  f, r, 1');
                //FSBOf.SetAutoManaged(var oForm, Lista);

                oDBDSHC = oForm.DataSources.DBDataSources.Add("@VID_FEDTECPRA");
                oDBDSHV = oForm.DataSources.DBDataSources.Add("@VID_FEDTEVTA");

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

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

                oComboBox = (ComboBox)(oForm.Items.Item("TipoDTE").Specific);
                oForm.DataSources.UserDataSources.Add("TipoDTE", BoDataType.dt_SHORT_TEXT, 10);
                oComboBox.DataBind.SetBound(true, "", "TipoDTE");
                oComboBox.ValidValues.Add("V", "Venta");
                oComboBox.ValidValues.Add("C", "Compra");
                oComboBox.Select("V", BoSearchKey.psk_ByValue);
                oForm.Items.Item("TipoDTE").DisplayDesc = true;

                oDataTable      = oForm.DataSources.DataTables.Add("dt");
                oGrid           = (Grid)(oForm.Items.Item("grid").Specific);
                oGrid.DataTable = oDataTable;

                DSOpFec = oForm.DataSources.UserDataSources.Add("FechaEmi", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1);
                ((OptionBtn)oForm.Items.Item("FechaEmi").Specific).DataBind.SetBound(true, "", "FechaEmi");

                ((OptionBtn)oForm.Items.Item("FechaRecep").Specific).DataBind.SetBound(true, "", "FechaEmi");
                ((OptionBtn)oForm.Items.Item("FechaRecep").Specific).GroupWith("FechaEmi");
                ((OptionBtn)oForm.Items.Item("FechaEmi").Specific).Selected = true;


                oComboBox = (ComboBox)(oForm.Items.Item("Cliente").Specific);
                oForm.DataSources.UserDataSources.Add("Cliente", BoDataType.dt_SHORT_TEXT, 10);
                oComboBox.DataBind.SetBound(true, "", "Cliente");
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"SELECT 'Todos' Code, 'Todos' Name UNION ALL 
                          SELECT T1.FldValue Code, T1.Descr Name
                          FROM CUFD T0
                          JOIN UFD1 T1 ON T1.TableID = T0.TableID
                                      AND T1.FieldID = T0.FieldID
                         WHERE T0.TableID = '{0}'
                           AND T0.AliasID = 'EstadoC'";
                }
                else
                {
                    s = @"SELECT 'Todos' ""Code"", 'Todos' ""Name"" FROM DUMMY UNION ALL
                          SELECT T1.""FldValue"" ""Code"", T1.""Descr"" ""Name""
                          FROM ""CUFD"" T0
                          JOIN ""UFD1"" T1 ON T1.""TableID"" = T0.""TableID""
                                      AND T1.""FieldID"" = T0.""FieldID""
                         WHERE T0.""TableID"" = '{0}'
                           AND T0.""AliasID"" = 'EstadoC'";
                }
                s = String.Format(s, "@VID_FEDTEVTA");
                oRecordSet.DoQuery(s);
                FSBOf.FillCombo(oComboBox, ref oRecordSet, false);
                oComboBox.Select("Todos", BoSearchKey.psk_ByValue);

                oComboBox = (ComboBox)(oForm.Items.Item("SII").Specific);
                oForm.DataSources.UserDataSources.Add("SII", BoDataType.dt_SHORT_TEXT, 10);
                oComboBox.DataBind.SetBound(true, "", "SII");
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"SELECT 'Todos' Code, 'Todos' Name UNION ALL
                          SELECT T1.FldValue Code, T1.Descr Name
                          FROM CUFD T0
                          JOIN UFD1 T1 ON T1.TableID = T0.TableID
                                      AND T1.FieldID = T0.FieldID
                         WHERE T0.TableID = '{0}'
                           AND T0.AliasID = 'EstadoSII'";
                }
                else
                {
                    s = @"SELECT 'Todos' ""Code"", 'Todos' ""Name"" FROM DUMMY UNION ALL
                          SELECT T1.""FldValue"" ""Code"", T1.""Descr"" ""Name""
                          FROM ""CUFD"" T0
                          JOIN ""UFD1"" T1 ON T1.""TableID"" = T0.""TableID""
                                      AND T1.""FieldID"" = T0.""FieldID""
                         WHERE T0.""TableID"" = '{0}'
                           AND T0.""AliasID"" = 'EstadoSII'";
                }
                s = String.Format(s, "@VID_FEDTEVTA");
                oRecordSet.DoQuery(s);
                FSBOf.FillCombo(oComboBox, ref oRecordSet, false);
                oComboBox.Select("Todos", BoSearchKey.psk_ByValue);

                oComboBox = (ComboBox)(oForm.Items.Item("Ley").Specific);
                oForm.DataSources.UserDataSources.Add("Ley", BoDataType.dt_SHORT_TEXT, 10);
                oComboBox.DataBind.SetBound(true, "", "Ley");
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"SELECT 'Todos' Code, 'Todos' Name UNION ALL
                          SELECT T1.FldValue Code, T1.Descr Name
                          FROM CUFD T0
                          JOIN UFD1 T1 ON T1.TableID = T0.TableID
                                      AND T1.FieldID = T0.FieldID
                         WHERE T0.TableID = '{0}'
                           AND T0.AliasID = 'EstadoLey'";
                }
                else
                {
                    s = @"SELECT 'Todos' ""Code"", 'Todos' ""Name"" FROM DUMMY UNION ALL
                          SELECT T1.""FldValue"" ""Code"", T1.""Descr"" ""Name""
                          FROM ""CUFD"" T0
                          JOIN ""UFD1"" T1 ON T1.""TableID"" = T0.""TableID""
                                      AND T1.""FieldID"" = T0.""FieldID""
                         WHERE T0.""TableID"" = '{0}'
                           AND T0.""AliasID"" = 'EstadoLey'";
                }
                s = String.Format(s, "@VID_FEDTEVTA");
                oRecordSet.DoQuery(s);
                FSBOf.FillCombo(oComboBox, ref oRecordSet, false);
                oComboBox.Select("Todos", BoSearchKey.psk_ByValue);

                BuscarDatos();
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            finally
            {
                if (oForm != null)
                {
                    oForm.Freeze(false);
                }
            }


            return(Result);
        }//fin InitForm
Ejemplo n.º 24
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting() 
        {
            // '// ADD YOUR ACTION CODE HERE ...
            #region Form Setting

            oForm.DataBrowser.BrowseBy = "edtDOCNO";

            oForm.SupportedModes = -1;
            oForm.Settings.EnableRowFormat = false;
            oForm.Settings.Enabled = false;
            oForm.AutoManaged = true;
            //oForm.PaneLevel = 1;

            #endregion

            oForm.Mode = BoFormMode.fm_ADD_MODE;

            SetItemCaption(oForm, "1", "생성");
            //SetDefault(oForm);

            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0160T_HRD");
            oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_SO01601_HRD");

            oComboBox = oForm.Items.Item("cboREQYM").Specific;
            SO.SO_COMMON_HRD.SetComboValue_YearMonth(ref oComboBox, FN.Enum_WholeTp.m_Nothing, "");


            #region Matrix
            oMatrix = oForm.Items.Item("mtx").Specific;
            oMatrix.SelectionMode = BoMatrixSelect.ms_Auto;

            // 납부방법
            FN.SetComboBoxValidValues(oMatrix, "U_PMETHOD", "SELECT U_SMLCD AS CODE, U_SMLNM AS NAME FROM [@KIS_AD00201] WHERE Code = 'SO09' AND U_USEYN = 'Y'");

            // 요금제
            FN.SetComboBoxValidValues(oMatrix, "U_PAYCD", "SELECT CODE, NAME FROM [@KIS_SO0050M_HRD]");

            // 지국
            //FN.SetComboBoxValidValues(oMatrix, "U_BRCCD", "SELECT CODE, NAME FROM [@KIS_SO0040M_HRD]");
            FN.SetComboBoxValidValues(oMatrix, "U_CENTGBN", "SELECT U_SMLCD AS CODE, U_SMLNM AS NAME FROM [@KIS_AD00201] WHERE Code = 'SO17' AND U_USEYN = 'Y'");   // 분국구분(직배/지방)


            // 지종
            FN.SetComboBoxValidValues(oMatrix, "U_PAPERTP", "SELECT U_SMLCD AS CODE, U_SMLNM AS NAME FROM [@KIS_AD00201] WHERE Code = 'SO01' AND U_USEYN = 'Y'");

            // 독자코드
            //FN.SetChooseFromListAdd(oForm, "KIS_SO0030_HRD", "mtx", "Code", BoFormItemTypes.it_MATRIX, null, "U_RDCD");

            // 지국
            //FN.SetChooseFromListAdd(oForm, "KIS_SO0040_HRD", "mtx", "Code", BoFormItemTypes.it_MATRIX, null, "U_BRCCD");

            // 외주처
            //FN.SetChooseFromListbyItem(ref oForm, BoLinkedObject.lf_BusinessPartner, "mtx1.U_CARDCD(CardCode):CARDTYPE(=S)");//":FrozenFor(=Y) :LocManTran(-N) :Postable(Y)");

            FN.SetMatrixColumnLinkedObject(ref oMatrix, "U_RDCD", BoLinkedObject.lf_None);
            //FN.SetMatrixColumnLinkedObject(ref oMatrix, "U_BRCCD", BoLinkedObject.lf_GoodsIssue);

            FN.SetSumField(ref oMatrix, "U_REQAMT,U_CNT");

            #endregion


            string AllString = "edtDOCNO,cboREQYM,edtREQDT,edtAPPDT,btnEXCEL";
            string AddString = "cboREQYM,edtREQDT,edtAPPDT";
            string OKString = "btnEXCEL";//string.Empty;
            string FindString = "edtDOCNO,cboREQYM,edtREQDT";

            FN.SetAutoManagedAttribute(ref oForm, AllString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False);
            FN.SetAutoManagedAttribute(ref oForm, AddString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True);
            FN.SetAutoManagedAttribute(ref oForm, OKString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True);
            FN.SetAutoManagedAttribute(ref oForm, FindString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_True);
        }
Ejemplo n.º 25
0
 public virtual void ET_cboBPLID_AFComboSelect(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oComboBox = ((SAPbouiCOM.ComboBox)(oForm.Items.Item("cboBPLID").Specific));
     // ADD YOUR ACTION CODE HERE ...
     try
     {
         if (pVal.ItemChanged)
         {
             string cboBPLID = oForm.DataSources.UserDataSources.Item("cboBPLID").Value;
             oForm.DataSources.UserDataSources.Item("edtVATRNUM").Value = FN.GetRecordsetValue(string.Format("SELECT VATRegNum FROM dbo.[OBPL] WHERE BPLId =  '{0}'", cboBPLID));
         }
     }
     catch (Exception ex)
     {
         B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
     }
 }
Ejemplo n.º 26
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting()
        {
            // '// ADD YOUR ACTION CODE HERE ...
            StringBuilder sb = new StringBuilder();

            try
            {
                #region Form
                oForm.SupportedModes = 1;
                oForm.Settings.EnableRowFormat = false;
                oForm.Settings.Enabled = false;
                oForm.AutoManaged = true;

                foreach (SAPbouiCOM.Item item in oForm.Items)
                {
                    item.AffectsFormMode = false;

                }
                #endregion

                #region ComboBox
                // 기수
                FN.SetComboBoxValidValues(oForm, "SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201]  WHERE CODE = 'HR01' AND U_USEYN = 'Y' ", "cboYEAR", FN.Enum_WholeTp.m_Nothing);
                oCombo = oForm.Items.Item("cboYEAR").Specific;
                if (oCombo.ValidValues.Count > 0)
                {
                    oForm.DataSources.UserDataSources.Item("cboYEAR").Value = oCombo.ValidValues.Item(0).Value;
                }

                // 부서
                FN.SetComboBoxValidValues(oForm, "SELECT U_DEPTCD,U_DEPTNM FROM [@KIS_HR00401] WHERE U_USEYN = 'Y' ", "cboDEPTCD", FN.Enum_WholeTp.m_TotalTxt);
                oCombo = oForm.Items.Item("cboDEPTCD").Specific;
                if (oCombo.ValidValues.Count > 0)
                {
                    oForm.DataSources.UserDataSources.Item("cboDEPTCD").Value = oCombo.ValidValues.Item(0).Value;
                }

                #endregion

                oForm.DataSources.DataTables.Add("grd");
                SetGridTitle(oForm);

            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }

        }
Ejemplo n.º 27
0
 public virtual void ET_cboFINDTY_AFComboSelect(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oComboBox = ((SAPbouiCOM.ComboBox)(oForm.Items.Item("cboFINDTY").Specific));
     // ADD YOUR ACTION CODE HERE ...
     SetHeaderEnable(oForm);
 }
Ejemplo n.º 28
0
        public virtual bool ET_BFFormDataLoad(BusinessObjectInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                SetComboBox_Method(oForm);

                oComboBox = oForm.Items.Item("cboACCTCD").Specific;
                FN.SetComboClear(ref oComboBox);
                oDB_M.SetValue("U_ACCTCD", 0, "");
                FN.SetComboBoxValidValues(oForm, " SELECT  U_RMK1, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO19' AND U_SMLCD IN ('U201', 'U204', 'U205') ", "cboACCTCD", FN.Enum_WholeTp.m_Space, "");

            }
            catch (Exception)
            {

                throw;
            }
            return true;
        }
Ejemplo n.º 29
0
        private void btnPayments_ClickBefore(object sboObject, SBOItemEventArg pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            Form lObjPaymentForm    = null;
            Form lObjPaymentFormUDF = null;
            Form lObjAccountForm    = null;

            try
            {
                if (mIntRowSelected > 0)
                {
                    StatusEnum lEnmStatus      = (StatusEnum)int.Parse(DtMatrix.GetValue("C_Status", mIntRowSelected - 1).ToString());
                    string     lStrFolio       = DtMatrix.GetValue("C_Folio", mIntRowSelected - 1).ToString();
                    string     lStrEmpCode     = DtMatrix.GetValue("C_Employe", mIntRowSelected - 1).ToString();
                    string     lStrArea        = DtMatrix.GetValue("C_Area", mIntRowSelected - 1).ToString();
                    double     lDblImport      = double.Parse(DtMatrix.GetValue("C_Amount", mIntRowSelected - 1).ToString());
                    string     lStrEmpName     = mObjPurchasesServiceFactory.GetPurchaseService().GetEmpName(lStrEmpCode);
                    string     lStrLineAccount = mObjPurchasesServiceFactory.GetPurchaseReceiptsService().GetAccountRefund(lStrArea);
                    //string lStrChkAcct = mObjPurchasesServiceFactory.GetPurchaseReceiptsService().GetAccountInConfig("GLO_CTAREEMBCHEQ");
                    string lStrChkAcct = cbAccount.Value;
                    // Dictionary<string, string> lStrBankInfo = mObjPurchasesServiceFactory.GetPurchaseReceiptsService().GetBankInfo(lStrChkAcct);
                    Dictionary <string, string> lStrBankInfo = new Dictionary <string, string>();
                    lStrBankInfo.Add(cbAccount.Value, cbBank.Selected.Description);

                    if (lEnmStatus != StatusEnum.Authorized_Ope_Admon)
                    {
                        UIApplication.ShowError("El reembolso seleccionado no está autorizado");
                        return;
                    }

                    string lStrValidation = ValidatePaymentsFields(lStrFolio, lStrEmpCode, lStrArea, lDblImport, lStrChkAcct, lStrBankInfo, lStrLineAccount);
                    if (!string.IsNullOrEmpty(lStrValidation))
                    {
                        UIApplication.ShowMessageBox(lStrValidation);
                        return;
                    }
                    if (mObjPurchasesServiceFactory.GetPurchaseReceiptsService().ExistsPayment(lStrEmpCode, lStrFolio, lStrArea))

                    /*string lStrDocEntry = DtMatrix.GetValue("C_DocEntry", mIntRowSelected - 1).ToString();
                     * if (mObjPurchasesServiceFactory.GetPurchaseReceiptsService().ExistsPayment(lStrDocEntry))*/
                    {
                        UIApplication.ShowError("Ya existe un pago para el reembolso seleccionado");
                        return;
                    }
                    this.UIAPIRawForm.Freeze(true);
                    UIApplication.GetApplication().ActivateMenuItem("2818");
                    if (!UIApplication.GetApplication().Menus.Item("6913").Checked)
                    {
                        UIApplication.GetApplication().ActivateMenuItem("6913");//2050
                    }

                    lObjPaymentForm    = UIApplication.GetApplication().Forms.GetForm("426", -1);
                    lObjPaymentFormUDF = UIApplication.GetApplication().Forms.GetForm("-426", -1);

                    lObjPaymentForm.Freeze(true);
                    lObjPaymentFormUDF.Freeze(true);
                    SAPbouiCOM.EditText txtDocDate = ((SAPbouiCOM.EditText)lObjPaymentForm.Items.Item("10").Specific);
                    txtDocDate.Value = DateTime.Now.ToString("yyyyMMdd");

                    SAPbouiCOM.OptionBtn optionBtnAccount = ((SAPbouiCOM.OptionBtn)lObjPaymentForm.Items.Item("58").Specific);
                    optionBtnAccount.Selected = true;

                    SAPbouiCOM.ComboBox cboPymtType = ((SAPbouiCOM.ComboBox)lObjPaymentFormUDF.Items.Item("U_GLO_PaymentType").Specific);
                    cboPymtType.Select("GLREM", SAPbouiCOM.BoSearchKey.psk_ByValue);

                    SAPbouiCOM.EditText txtCodeMov = ((SAPbouiCOM.EditText)lObjPaymentFormUDF.Items.Item("U_GLO_CodeMov").Specific);
                    txtCodeMov.Value = lStrFolio;

                    SAPbouiCOM.ComboBox txtCostCenter = ((SAPbouiCOM.ComboBox)lObjPaymentFormUDF.Items.Item("U_GLO_CostCenter").Specific);
                    txtCostCenter.Select(lStrArea, SAPbouiCOM.BoSearchKey.psk_ByValue);

                    SAPbouiCOM.ComboBox cboAuxiliarType = ((SAPbouiCOM.ComboBox)lObjPaymentFormUDF.Items.Item("U_FZ_AuxiliarType").Specific);
                    cboAuxiliarType.Select("2", SAPbouiCOM.BoSearchKey.psk_ByValue);

                    SAPbouiCOM.EditText txtName = ((SAPbouiCOM.EditText)lObjPaymentForm.Items.Item("10000166").Specific);
                    txtName.Value = lStrEmpName;

                    SAPbouiCOM.EditText txtAuxiliar = ((SAPbouiCOM.EditText)lObjPaymentFormUDF.Items.Item("U_FZ_Auxiliar").Specific);
                    txtAuxiliar.Value = lStrEmpCode;


                    SAPbouiCOM.Button btnBank = ((SAPbouiCOM.Button)lObjPaymentForm.Items.Item("234000001").Specific);
                    btnBank.Item.Click();

                    lObjAccountForm = UIApplication.GetApplication().Forms.GetForm("196", -1);
                    lObjAccountForm.Freeze(true);
                    SAPbouiCOM.Folder folderCheck = ((SAPbouiCOM.Folder)lObjAccountForm.Items.Item("3").Specific);
                    folderCheck.Item.Click();

                    SAPbouiCOM.Matrix mtxCheck = ((SAPbouiCOM.Matrix)lObjAccountForm.Items.Item("28").Specific);
                    ((SAPbouiCOM.EditText)mtxCheck.Columns.Item("7").Cells.Item(1).Specific).Value = lDblImport.ToString();

                    ComboBox cb = ((SAPbouiCOM.ComboBox)mtxCheck.Columns.Item("2").Cells.Item(1).Specific);

                    string ss = lStrBankInfo[lStrBankInfo.Keys.ElementAt(0)]; //lStrBankInfo.ElementAt(0);


                    ((SAPbouiCOM.ComboBox)mtxCheck.Columns.Item("2").Cells.Item(1).Specific).Select(lStrBankInfo[lStrBankInfo.Keys.ElementAt(0)], SAPbouiCOM.BoSearchKey.psk_ByValue); //Banco
                    ((SAPbouiCOM.ComboBox)mtxCheck.Columns.Item("4").Cells.Item(1).Specific).Select(lStrBankInfo.Keys.ElementAt(0), SAPbouiCOM.BoSearchKey.psk_ByValue);               //Cuenta?

                    SAPbouiCOM.Button btnOk = ((SAPbouiCOM.Button)lObjAccountForm.Items.Item("1").Specific);
                    btnOk.Item.Click();

                    SAPbouiCOM.Matrix mtxPayment = ((SAPbouiCOM.Matrix)lObjPaymentForm.Items.Item("71").Specific);
                    mtxPayment.AddRow();
                    ((SAPbouiCOM.EditText)mtxPayment.Columns.Item("5").Cells.Item(1).Specific).Value = lDblImport.ToString();
                    ((SAPbouiCOM.EditText)mtxPayment.Columns.Item("8").Cells.Item(1).Specific).Value = lStrLineAccount; //cuenta de mayor
                }
                else
                {
                    UIApplication.ShowMessageBox("Favor de seleccionar un registro");
                }



                lObjPaymentFormUDF.Freeze(false);
                this.UIAPIRawForm.Freeze(false);



                if (lObjPaymentForm != null)
                {
                    lObjPaymentForm.Freeze(false);
                }
                if (lObjAccountForm != null)
                {
                    lObjPaymentFormUDF.Freeze(false);
                }
                if (this.UIAPIRawForm != null)
                {
                    this.UIAPIRawForm.Freeze(false);
                }
                // if (lObjAccountForm. ==) lObjAccountForm.Freeze(false);
                UIApplication.ShowSuccess("Carga de pago terminada");
            }
            catch (Exception ex)
            {
                LogService.WriteError("frmSearchRefunds (btnPayments_ClickBefore) " + ex.Message);
                LogService.WriteError(ex);
                UIApplication.ShowMessageBox(string.Format("Error al abrir pantalla de pagos: {0}", ex.Message));
            }
            finally
            {
                if (lObjPaymentFormUDF != null)
                {
                    lObjPaymentFormUDF.Freeze(false);
                }
                this.UIAPIRawForm.Freeze(false);
            }
        }
Ejemplo n.º 30
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting() {
            // '// ADD YOUR ACTION CODE HERE ...

            try
            {
                #region Form Setting

                oForm.SupportedModes = 1;
                oForm.Settings.EnableRowFormat = false;
                oForm.Settings.Enabled = false;
                oForm.AutoManaged = true;

                #endregion

                #region ComboBox
                // 고객그룹1
                oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboGROUP").Specific;
                FN.SetComboBoxValidValues(oForm, "SELECT U_CD,U_NM FROM [@KIS_CO00601] WHERE Code = '110' ", "cboGROUP", FN.Enum_WholeTp.m_TotalTxt);

                #endregion

                #region Grid

                oForm.DataSources.DataTables.Add("grd");
                oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific;
                oGrid.SelectionMode = BoMatrixSelect.ms_NotSupported;
                oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //데이터 그리드에 Display      

                SetGridTitle(oForm);

                #endregion

                #region Defalut Setting

                oForm.DataSources.UserDataSources.Item("edtDATE").ValueEx = FN.GetNowDate(Enum_Date.m_Yyyy);

                #endregion

                foreach (SAPbouiCOM.Item item in oForm.Items)
                {
                    item.AffectsFormMode = false;
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
Ejemplo n.º 31
0
        private void InitiallizeForm()
        {
            //  dtHead = oForm.DataSources.DataTables.Item("dtHead");
            // dtHead.Rows.Add(1);

            dtPendingJEs.Columns.Add("DocDate");
            dtPendingJEs.Columns.Add("DocNum");
            dtPendingJEs.Columns.Add("DocTotal");
            dtPendingJEs.Columns.Add("Originator");

            oForm.Freeze(true);
            mtJE   = oForm.Items.Item("mtJE").Specific;
            mtDet  = oForm.Items.Item("mtDet").Specific;
            dtDet  = oForm.DataSources.DataTables.Item("dtDet");
            dtHead = oForm.DataSources.DataTables.Item("dtHead");
            cbOr   = oForm.Items.Item("cbOr").Specific;
            IcbOr  = oForm.Items.Item("cbOr");
            cbOr.ValidValues.Add("All", "All");
            fillUserCb();

            oForm.DataSources.UserDataSources.Add("txDN", SAPbouiCOM.BoDataType.dt_LONG_NUMBER, 15); // Days of Month
            txDN  = oForm.Items.Item("txDN").Specific;
            ItxDN = oForm.Items.Item("txDN");
            txDN.DataBind.SetBound(true, "", "txDN");

            oForm.DataSources.UserDataSources.Add("txDD", SAPbouiCOM.BoDataType.dt_DATE); // Days of Month
            txDD  = oForm.Items.Item("txDD").Specific;
            ItxDD = oForm.Items.Item("txDD");
            txDD.DataBind.SetBound(true, "", "txDD");

            oForm.DataSources.UserDataSources.Add("txRem", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 100); // Days of Month
            txRem  = oForm.Items.Item("txRem").Specific;
            ItxRem = oForm.Items.Item("txRem");
            txRem.DataBind.SetBound(true, "", "txRem");

            oForm.DataSources.UserDataSources.Add("txRef1", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 100); // Days of Month
            txRef1  = oForm.Items.Item("txRef1").Specific;
            ItxRef1 = oForm.Items.Item("txRef1");
            txRef1.DataBind.SetBound(true, "", "txRef1");

            oForm.DataSources.UserDataSources.Add("txRef2", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 100);    // Days of Month
            txRef2  = oForm.Items.Item("txRef2").Specific;
            ItxRef2 = oForm.Items.Item("txRef2");
            txRef2.DataBind.SetBound(true, "", "txRef2");

            oForm.DataSources.UserDataSources.Add("txDS", SAPbouiCOM.BoDataType.dt_SUM);      // Days of Month
            txDS  = oForm.Items.Item("txDS").Specific;
            ItxDS = oForm.Items.Item("txDS");
            txDS.DataBind.SetBound(true, "", "txDS");


            oForm.DataSources.UserDataSources.Add("txCS", SAPbouiCOM.BoDataType.dt_SUM);      // Days of Month
            txCS  = oForm.Items.Item("txCS").Specific;
            ItxCS = oForm.Items.Item("txCS");
            txCS.DataBind.SetBound(true, "", "txCS");


            oForm.DataSources.UserDataSources.Add("chkPost", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); // Days of Month
            chkPost  = oForm.Items.Item("chkPost").Specific;
            IchkPost = oForm.Items.Item("chkPost");
            chkPost.DataBind.SetBound(true, "", "chkPost");


            lnkBG    = oForm.Items.Item("lnkBG").Specific;
            IchkPost = oForm.Items.Item("lnkBG");
        }
Ejemplo n.º 32
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting() {
            // '// ADD YOUR ACTION CODE HERE ...

            #region Form Setting

            oForm.DataBrowser.BrowseBy = "Code";

            oForm.SupportedModes = -1;
            oForm.Settings.EnableRowFormat = false;
            oForm.Settings.Enabled = false;
            oForm.AutoManaged = true;
            oForm.PaneLevel = 1;

            #endregion

            oForm.Mode = BoFormMode.fm_FIND_MODE;

            string strNowDate = B1Connections.diCompany.GetCompanyDate().ToShortDateString();
            strNowDate = FN.SetDateFormatToDB(strNowDate, FN.eDateType.p_YYYYMMDD);


            oComboBox = oForm.Items.Item("Code").Specific;
            FN.SetComboBoxValidValues(oForm, " SELECT YEAR AS CODE, YEAR AS NAME FROM OACP ", "Code", FN.Enum_WholeTp.m_Nothing);
            oComboBox.Select(FN.Left(strNowDate,4), BoSearchKey.psk_ByValue);
            oForm.Items.Item("btnTR").Enabled = false;
            oForm.Items.Item("btnCAN").Enabled = false;

            #region Matrix
            oMatrix = oForm.Items.Item("mtx").Specific;
            oMatrix.SelectionMode = BoMatrixSelect.ms_Single;

            // 메트릭스 
            //FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oDB_1, FN.RowSelectMode.SelectedLine, "U_YYYYMM");

            #endregion

        }
Ejemplo n.º 33
0
        public virtual void ET_cboTYPE_AFClick(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oComboBox = ((SAPbouiCOM.ComboBox)(oForm.Items.Item("cboTYPE").Specific));
            // ADD YOUR ACTION CODE HERE ...           

            oForm.Freeze(true);
            SetItemEnabled(oForm);

            SetComboBox_Method(oForm);
            SetComboBox_AcctCode(oForm);

            oForm.Freeze(false);
        }
Ejemplo n.º 34
0
        public virtual void ET_AFDataMenu_Add(MenuEvent pVal) {
            oForm = B1Connections.theAppl.Forms.ActiveForm;
            // ADD YOUR ACTION CODE HERE ...

            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_FI0010M_HRD");
            oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_FI00101_HRD");

            string strNowDate = B1Connections.diCompany.GetCompanyDate().ToShortDateString();
            strNowDate = FN.SetDateFormatToDB(strNowDate, FN.eDateType.p_YYYYMMDD);
            oDB_M.SetValue("U_DOCDATE", 0, strNowDate.Replace(".", ""));
            oDB_M.SetValue("U_USERID", 0, B1Connections.theAppl.Company.UserName);

            oComboBox = oForm.Items.Item("cboYYYY").Specific;
            oComboBox.Select(FN.Left(strNowDate, 4), BoSearchKey.psk_ByValue);

            oComboBox = oForm.Items.Item("cboTYPE").Specific;
            oComboBox.Select(0, BoSearchKey.psk_Index);
        }
Ejemplo n.º 35
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting() {
            // '// ADD YOUR ACTION CODE HERE ...
            #region Form Setting

            oForm.DataBrowser.BrowseBy = "edtDOCNO";

            oForm.SupportedModes = -1;
            oForm.Settings.EnableRowFormat = false;
            oForm.Settings.Enabled = false;
            oForm.AutoManaged = true;

            #endregion

            oForm.Mode = BoFormMode.fm_ADD_MODE;

            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0280T_HRD");
            oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_SO02801_HRD");

            oComboBox = oForm.Items.Item("cboDEPYM").Specific;

            SO.SO_COMMON_HRD.SetComboValue_YearMonth(ref oComboBox, FN.Enum_WholeTp.m_Nothing, "");

            // 입금계좌번호
            oForm.Items.Item("edtBNKACCT").Specific.value = FN.GetRecordsetValue("SELECT AcctCode FROM OACT WHERE AcctCode = '11101285'");
            oForm.Items.Item("edtBNKATNM").Specific.value = FN.GetRecordsetValue("SELECT AcctName FROM OACT WHERE AcctCode = '11101285'");

            #region Matrix
            oMatrix = oForm.Items.Item("mtx").Specific;
            oMatrix.SelectionMode = BoMatrixSelect.ms_Auto;

            // 요금제
            //FN.SetComboBoxValidValues(oMatrix, "U_PAYCD", "SELECT CODE, NAME FROM [@KIS_SO0050M_HRD]");

            // 지국
            //FN.SetComboBoxValidValues(oMatrix, "U_CENTCD", "SELECT CODE, NAME FROM [@KIS_SO0040M_HRD]");
            FN.SetComboBoxValidValues(oMatrix, "U_CENTGBN", "SELECT U_SMLCD AS CODE, U_SMLNM AS NAME FROM [@KIS_AD00201] WHERE Code = 'SO17' AND U_USEYN = 'Y'");   // 분국구분(직배/지방)

            // 지종
            FN.SetComboBoxValidValues(oMatrix, "U_PAPERTP", "SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO01'");

            //FN.SetMatrixColumnLinkedObject(ref oMatrix, "U_RDCD", BoLinkedObject.lf_None);
            //FN.SetMatrixColumnLinkedObject(ref oMatrix, "U_BRCCD", BoLinkedObject.lf_None);

            FN.SetSumField(ref oMatrix, "U_REQAMT,U_CNT");

            #endregion

            #region SetAutoManagedAttribute

            string AllString = "edtDOCNO,edtJDTDOC,edtRJDTDOC,btnJDT,btnREJDT";
            string AddString = "cboDEPYM,edtCMMAMT";
            string OKString = "btnJDT,btnREJDT";//string.Empty;
            string FindString = "edtDOCNO";

            FN.SetAutoManagedAttribute(ref oForm, AllString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False);
            FN.SetAutoManagedAttribute(ref oForm, AddString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True);
            FN.SetAutoManagedAttribute(ref oForm, OKString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True);
            FN.SetAutoManagedAttribute(ref oForm, FindString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_True);

            FN.SetAutoManagedAttribute(ref oForm, "btnJDT", BoAutoManagedAttr.ama_Visible, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_True);
            FN.SetAutoManagedAttribute(ref oForm, "btnJDT", BoAutoManagedAttr.ama_Visible, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_False);
            FN.SetAutoManagedAttribute(ref oForm, "btnJDT", BoAutoManagedAttr.ama_Visible, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True);
            FN.SetAutoManagedAttribute(ref oForm, "btnJDT", BoAutoManagedAttr.ama_Visible, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_False);

            FN.SetAutoManagedAttribute(ref oForm, "btnREJDT", BoAutoManagedAttr.ama_Visible, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_True);
            FN.SetAutoManagedAttribute(ref oForm, "btnREJDT", BoAutoManagedAttr.ama_Visible, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_False);
            FN.SetAutoManagedAttribute(ref oForm, "btnREJDT", BoAutoManagedAttr.ama_Visible, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True);
            FN.SetAutoManagedAttribute(ref oForm, "btnREJDT", BoAutoManagedAttr.ama_Visible, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_False);

            #endregion   

        }
Ejemplo n.º 36
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting() {
            // '// ADD YOUR ACTION CODE HERE ...

            #region Form Setting

            oForm.DataBrowser.BrowseBy = "DocEntry";

            oForm.SupportedModes = -1;
            oForm.Settings.EnableRowFormat = false;
            oForm.Settings.Enabled = false;
            oForm.AutoManaged = true;
            oForm.PaneLevel = 1;

            #endregion

            oForm.Mode = BoFormMode.fm_ADD_MODE;

            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_FI0010M_HRD");
            oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_FI00101_HRD");

            string strNowDate = B1Connections.diCompany.GetCompanyDate().ToShortDateString();         
            strNowDate = FN.SetDateFormatToDB(strNowDate, FN.eDateType.p_YYYYMMDD);
            oDB_M.SetValue("U_DOCDATE", 0, strNowDate.Replace(".", ""));
            oDB_M.SetValue("U_USERID", 0, B1Connections.theAppl.Company.UserName);
           
            oComboBox = oForm.Items.Item("cboYYYY").Specific;
            FN.SetComboBoxValidValues(oForm, " SELECT YEAR AS CODE, YEAR AS NAME FROM OACP ", "cboYYYY", FN.Enum_WholeTp.m_Nothing);
            oComboBox.Select(FN.Left(strNowDate,4) , BoSearchKey.psk_ByValue);

            oComboBox = oForm.Items.Item("cboTYPE").Specific;
            FN.SetComboBoxValidValues(oForm, " SELECT U_SMLCD,U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'FI01' AND U_USEYN = 'Y' ", "cboTYPE", FN.Enum_WholeTp.m_Nothing);
            oComboBox.Select(0, BoSearchKey.psk_Index);

            #region EditText

            // 코스트센터그룹
            SAPbouiCOM.Conditions oCons = new Conditions();
            FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "edtCOSTFR", "Code", BoFormItemTypes.it_EDIT, oCons);
            FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "edtCOSTTO", "Code", BoFormItemTypes.it_EDIT, oCons);

            // 공통비 코스트센터 그룹
            FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "edtCOMGPCD", "Code", BoFormItemTypes.it_EDIT, oCons);

            // 원가그룹
            FN.SetChooseFromListAdd(oForm, "KIS_CO0100", "edtDISACCD", "Code", BoFormItemTypes.it_EDIT, oCons);
            FN.SetChooseFromListAdd(oForm, "KIS_CO0100", "edtCOPECD", "Code", BoFormItemTypes.it_EDIT, oCons);
            FN.SetChooseFromListAdd(oForm, "KIS_CO0100", "edtCOAMCD", "Code", BoFormItemTypes.it_EDIT, oCons);

            // 계정코드
            #region GLAccounts Conditions
            oCons = new Conditions();
            SAPbouiCOM.Condition oCon = oCons.Add();

            oCon.Alias = "U_CATEGORY";
            oCon.Operation = BoConditionOperation.co_EQUAL;
            oCon.CondVal = "S09";

            #endregion

            FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_GLAccounts).ToString(), "edtCOMPECD", "AcctCode", BoFormItemTypes.it_EDIT, oCons);
            FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_GLAccounts).ToString(), "edtCOMAMCD", "AcctCode", BoFormItemTypes.it_EDIT, oCons);

            #endregion

            #region Matrix
            oMatrix = oForm.Items.Item("mtx").Specific;
            oMatrix.SelectionMode = BoMatrixSelect.ms_None;

            // 메트릭스 
            FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "mtx", "Code", BoFormItemTypes.it_MATRIX, null, "U_PRCCD");

            FN.SetSumField(ref oMatrix, "U_1MON,U_2MON,U_3MON,U_4MON,U_5MON,U_6MON,U_7MON,U_8MON,U_9MON,U_10MON,U_11MON,U_12MON");

            //FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oDB_1, FN.RowSelectMode.SelectedLine, "U_PRCCD");

            #endregion

            #region SetAutoManagedAttribute

            string AllString = "cboYYYY,cboTYPE,edtCOMGPCD,edtDISACCD,edtCOPECD,edtCOAMCD,edtCOMPECD,edtCOMAMCD,mtx,btnFIND";
            string AddString = "cboYYYY,cboTYPE,edtCOMGPCD,edtDISACCD,edtCOPECD,edtCOAMCD,mtx,btnFIND";
            string OKString = "edtCOMGPCD,edtDISACCD,edtCOPECD,edtCOAMCD,mtx,btnFIND";
            string FindString = "cboYYYY,cboTYPE";

            FN.SetAutoManagedAttribute(ref oForm, AllString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False);
            FN.SetAutoManagedAttribute(ref oForm, AddString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True);
            FN.SetAutoManagedAttribute(ref oForm, OKString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True);
            FN.SetAutoManagedAttribute(ref oForm, FindString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_True);

            #endregion    

        }
Ejemplo n.º 37
0
        private void CriarFormularioComplexo()
        {
            SAPbouiCOM.Button    oButton    = null;
            SAPbouiCOM.Folder    oFolder    = null;
            SAPbouiCOM.OptionBtn oOptionBtn = null;
            SAPbouiCOM.CheckBox  oCheckBox  = null;
            SAPbouiCOM.ComboBox  oComboBox  = null;

            SAPbouiCOM.FormCreationParams oCreationParams = null;
            oCreationParams = ((SAPbouiCOM.FormCreationParams)(oApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)));

            oCreationParams.UniqueID    = "frmComplex";
            oCreationParams.FormType    = "frmComplex";
            oCreationParams.BorderStyle = BoFormBorderStyle.fbs_Sizable;

            oForm = oApplication.Forms.AddEx(oCreationParams);


            AddDataSourceNoForm();

            oForm.Title        = "Formulário Complexo";
            oForm.Left         = 300;
            oForm.ClientWidth  = 200;
            oForm.Top          = 100;
            oForm.ClientHeight = 140;

            oItem           = oForm.Items.Add("1", BoFormItemTypes.it_BUTTON);
            oItem.Left      = 5;
            oItem.Width     = 65;
            oItem.Top       = 110;
            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       = 110;
            oItem.Height    = 19;
            oButton         = ((SAPbouiCOM.Button)(oItem.Specific));
            oButton.Caption = "Cancel";

            oItem        = oForm.Items.Add("Rect1", BoFormItemTypes.it_RECTANGLE);
            oItem.Left   = 0;
            oItem.Width  = 194;
            oItem.Top    = 25;
            oItem.Height = 80;


            for (int i = 1; i <= 3; i++)
            {
                oItem        = oForm.Items.Add("Folder" + i.ToString(), BoFormItemTypes.it_FOLDER);
                oItem.Left   = (i - 1) * 100;
                oItem.Width  = 100;
                oItem.Top    = 6;
                oItem.Height = 19;

                oFolder = ((SAPbouiCOM.Folder)(oItem.Specific));

                oFolder.Caption = "Folder" + i.ToString();
                oFolder.DataBind.SetBound(true, "", "FolderDS");

                if (i == 1)
                {
                    oFolder.Select();
                }
                else
                {
                    oFolder.GroupWith("Folder" + Convert.ToString(i - 1));
                }
            }
            for (int i = 1; i <= 3; i++)
            {
                oItem          = oForm.Items.Add("OptBtn" + i.ToString(), BoFormItemTypes.it_OPTION_BUTTON);
                oItem.Left     = 20;
                oItem.Width    = 120;
                oItem.Top      = 30 + (i - 1) * 19;
                oItem.Height   = 19;
                oItem.FromPane = 1;
                oItem.ToPane   = 1;

                oOptionBtn         = ((SAPbouiCOM.OptionBtn)(oItem.Specific));
                oOptionBtn.Caption = string.Format("Botão de Opção {0}", i);

                if (i > 1)
                {
                    oOptionBtn.GroupWith("OptBtn" + Convert.ToString(i - 1));
                }
                oOptionBtn.DataBind.SetBound(true, "", "OptBtnDS");
            }

            for (int i = 1; i <= 3; i++)
            {
                oItem          = oForm.Items.Add("CheckBox" + i.ToString(), BoFormItemTypes.it_CHECK_BOX);
                oItem.Left     = 20;
                oItem.Width    = 100;
                oItem.Top      = 30 + (i - 1) * 19;
                oItem.Height   = 19;
                oItem.FromPane = 2;
                oItem.ToPane   = 2;

                oCheckBox         = ((SAPbouiCOM.CheckBox)(oItem.Specific));
                oCheckBox.Caption = string.Format("Check Box {0}", i);
                oCheckBox.DataBind.SetBound(true, "", string.Format("CheckDS{0}", i));
            }
            for (int i = 1; i <= 3; i++)
            {
                oItem          = oForm.Items.Add("ComboBox" + i.ToString(), BoFormItemTypes.it_COMBO_BOX);
                oItem.Left     = 20;
                oItem.Width    = 100;
                oItem.Top      = 33 + (i - 1) * 19;
                oItem.Height   = 19;
                oItem.FromPane = 3;
                oItem.ToPane   = 3;

                oComboBox = ((SAPbouiCOM.ComboBox)(oItem.Specific));
                oComboBox.ValidValues.Add("0", "Selecione");
                for (int x = 1; x < 10; x++)
                {
                    oComboBox.ValidValues.Add(x.ToString(), string.Format("Item {0}", x));
                }
                oComboBox.Select("0", BoSearchKey.psk_ByValue);
                oItem.DisplayDesc = true;
            }


            oForm.PaneLevel = 1;
        }
Ejemplo n.º 38
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting() {
            // '// ADD YOUR ACTION CODE HERE ...
            StringBuilder sb = new StringBuilder();
            try
            {
                #region Form
                oForm.SupportedModes = 1;
                oForm.Settings.EnableRowFormat = false;
                oForm.Settings.Enabled = false;
                oForm.AutoManaged = true;

                foreach (SAPbouiCOM.Item item in oForm.Items)
                {
                    item.AffectsFormMode = false;

                }
                #endregion

                oForm.DataSources.UserDataSources.Item("edtDOCDTF").Value = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01");
                oForm.DataSources.UserDataSources.Item("edtDOCDTT").Value = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMMdd");

                #region EditText

                //매출처
                #region BusinessPartner Conditions
                SAPbouiCOM.Conditions oCons = new Conditions(); ;
                SAPbouiCOM.Condition oCon = oCons.Add();
                oCons = new Conditions(); ;
                oCon = oCons.Add();

                oCon.Alias = "CardType";
                oCon.Operation = BoConditionOperation.co_EQUAL;
                oCon.CondVal = "C";

                oCon.Relationship = BoConditionRelationship.cr_AND;

                oCon = oCons.Add();
                oCon.Alias = "frozenFor";
                oCon.Operation = BoConditionOperation.co_EQUAL;
                oCon.CondVal = "N";

                #endregion

                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtCARDCDF", "CardCode", BoFormItemTypes.it_EDIT, oCons);
                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtCARDNMF", "CardName", BoFormItemTypes.it_EDIT, oCons);

                //대행사
                #region BusinessPartner Conditions
                oCons = new Conditions(); ;
                oCon = oCons.Add();

                oCon.Alias = "CardType";
                oCon.Operation = BoConditionOperation.co_EQUAL;
                oCon.CondVal = "S";//공급업체

                oCon.Relationship = BoConditionRelationship.cr_AND;

                oCon = oCons.Add();
                oCon.Alias = "frozenFor";
                oCon.Operation = BoConditionOperation.co_EQUAL;
                oCon.CondVal = "N";

                #endregion

                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBPCDF", "CardCode", BoFormItemTypes.it_EDIT, oCons);
                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtBPNMF", "CardName", BoFormItemTypes.it_EDIT, oCons);

                #endregion

                #region ComboBox
                //매출부서
                FN.SetComboBoxValidValues(oForm, "SELECT PrcCode,PrcName FROM OPRC WHERE DimCode = '1' AND Locked = 'N' ORDER BY PrcCode ", "cboPRCCD", FN.Enum_WholeTp.m_TotalTxt);
                oCombo = oForm.Items.Item("cboPRCCD").Specific;
                if (oCombo.ValidValues.Count > 0)
                {
                    oForm.DataSources.UserDataSources.Item("cboPRCCD").Value = oCombo.ValidValues.Item(0).Value;
                }

                //영업사원
                FN.SetComboBoxValidValues(oForm, "SELECT SlpCode,SlpName FROM OSLP WHERE Active = 'Y' AND Locked = 'N' ORDER BY SlpCode ", "cboSLPCD", FN.Enum_WholeTp.m_TotalTxt);
                oCombo = oForm.Items.Item("cboSLPCD").Specific;
                if (oCombo.ValidValues.Count > 0)
                {
                    oForm.DataSources.UserDataSources.Item("cboSLPCD").Value = oCombo.ValidValues.Item(0).Value;
                }

                //간행물
                FN.SetComboBoxValidValues(oForm, "SELECT U_SMLCD,U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SD01' AND U_USEYN = 'Y' ", "cboPUBLICA", FN.Enum_WholeTp.m_TotalTxt);
                oCombo = oForm.Items.Item("cboPUBLICA").Specific;
                if (oCombo.ValidValues.Count > 0)
                {
                    oForm.DataSources.UserDataSources.Item("cboPUBLICA").Value = oCombo.ValidValues.Item(0).Value;
                }

                #endregion

                oForm.DataSources.DataTables.Add("grd");
                SetGridTitle(oForm);

            }
            catch (Exception ex)
            {

                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }

        }
Ejemplo n.º 39
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting(SAPbouiCOM.Form oForm)
        {
            // '// ADD YOUR ACTION CODE HERE ...
            oForm.Settings.EnableRowFormat = false;
            // UDO, 네비게이션 사용하지 않음
            oForm.SupportedModes = (int)BoAutoFormMode.afm_Ok;

            // 작엽년월
            string strYYYYMM = FN.SetDateFormatToDB(DateTimeLibrary.FirstDayOfCurrentMonth(), FN.eDateType.n_YYYYMMDD).Substring(0, 6);
            oComboBox = oForm.Items.Item("cboYYYYMM1").Specific;
            SO.SO_COMMON_HRD.SetComboValue_YearMonth(ref oComboBox, FN.Enum_WholeTp.m_Nothing, strYYYYMM);

            oComboBox = oForm.Items.Item("cboYYYYMM2").Specific;
            SO.SO_COMMON_HRD.SetComboValue_YearMonth(ref oComboBox, FN.Enum_WholeTp.m_Nothing, strYYYYMM);

            SetGridTitle(oForm);
        }
Ejemplo n.º 40
0
        public virtual void ET_cboJOB_AFComboSelect(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oComboBox = ((SAPbouiCOM.ComboBox)(oForm.Items.Item("cboJOB").Specific));
            // ADD YOUR ACTION CODE HERE ...

            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
            oDB_M.SetValue("U_JOBNM", 0, oComboBox.Selected.Description);
        }
Ejemplo n.º 41
0
 public virtual void ET_cboSTATUS_AFComboSelect(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oComboBox = ((SAPbouiCOM.ComboBox)(oForm.Items.Item("cboSTATUS").Specific));
     // ADD YOUR ACTION CODE HERE ...
     //if (oComboBox.Selected.Value == "U09")
     //{
     //    STATE = false;
     //}
 }
Ejemplo n.º 42
0
        }//fin FormDataEvent

        public new void MenuEvent(ref MenuEvent pVal, ref Boolean BubbleEvent)
        {
            //Int32 Entry;
            base.MenuEvent(ref pVal, ref BubbleEvent);
            SAPbobsCOM.Recordset orsx = ((SAPbobsCOM.Recordset)FCmpny.GetBusinessObject(BoObjectTypes.BoRecordset));
            try
            {
                //1281 Buscar;
                //1282 Crear
                //1284 cancelar;
                //1285 Restablecer;
                //1286 Cerrar;
                //1288 Registro siguiente;
                //1289 Registro anterior;
                //1290 Primer Registro;
                //1291 Ultimo Registro;
                if ((pVal.MenuUID != "") && (pVal.BeforeAction == false))
                {
                    //if (ObjType == "203")
                    //    DocSubType = ((System.String)oForm.DataSources.DBDataSources.Item("ODPI").GetValue("DocSubType", 0)).Trim();
                    //else
                    //    DocSubType = ((System.String)oForm.DataSources.DBDataSources.Item("OINV").GetValue("DocSubType", 0)).Trim();

                    if ((pVal.MenuUID == "1288") || (pVal.MenuUID == "1289") || (pVal.MenuUID == "1290") || (pVal.MenuUID == "1291") || (pVal.MenuUID == "1304"))
                    {
                        oForm.Freeze(true);
                        //oForm.Items.Item("VID_Estado").Enabled = false;
                        oComboBox = (ComboBox)(oForm.Items.Item("87").Specific);
                        var sSeries = (System.String)(oComboBox.Value);

                        if (GlobalSettings.RunningUnderSQLServer)
                        {
                            s = @"select LEFT(ISNULL(UPPER(BeginStr),''),1) 'Valor', DocSubType, SUBSTRING(ISNULL(UPPER(BeginStr),''),2,LEN(ISNULL(UPPER(BeginStr),''))) 'Doc', ObjectCode
                                        from NNM1 where Series = {0} --AND ObjectCode = '{1}' ";
                        }
                        else
                        {
                            s = @"select LEFT(IFNULL(UPPER(""BeginStr""),''),1) ""Valor"", ""DocSubType"", SUBSTRING(IFNULL(UPPER(""BeginStr""),''),2,LENGTH(IFNULL(UPPER(""BeginStr""),''))) ""Doc"", ""ObjectCode""
                                        from ""NNM1"" where ""Series"" = {0} --AND ""ObjectCode"" = '{1}' ";
                        }
                        s = String.Format(s, sSeries, oForm.BusinessObject.Type);
                        orsx.DoQuery(s);
                        if (orsx.RecordCount > 0)
                        {
                            if (((System.String)orsx.Fields.Item("Valor").Value).Trim() == "E")
                            {
                                oForm.Items.Item("VID_Estado").Visible = true;
                                oForm.Items.Item("VID_Estado").Enabled = false;
                                oForm.Items.Item("lblEstado").Visible  = true;
                            }
                            else
                            {
                                oForm.Items.Item("VID_Estado").Visible = false;
                                oForm.Items.Item("lblEstado").Visible  = false;
                            }
                        }
                        oForm.Freeze(false);
                    }

                    if ((pVal.MenuUID == "1282") || (pVal.MenuUID == "1281") || (pVal.MenuUID == "1287"))
                    {
                        oForm.Freeze(true);
                        //oForm.Items.Item("VID_Estado").Enabled = false;

                        oComboBox = (ComboBox)(oForm.Items.Item("87").Specific);
                        var sSeries = (System.String)(oComboBox.Value);

                        if (GlobalSettings.RunningUnderSQLServer)
                        {
                            s = @"select LEFT(ISNULL(UPPER(BeginStr),''),1) 'Valor', DocSubType, SUBSTRING(ISNULL(UPPER(BeginStr),''),2,LEN(ISNULL(UPPER(BeginStr),''))) 'Doc', ObjectCode
                                        from NNM1 where Series = {0} --AND ObjectCode = '{1}' ";
                        }
                        else
                        {
                            s = @"select LEFT(IFNULL(UPPER(""BeginStr""),''),1) ""Valor"", ""DocSubType"", SUBSTRING(IFNULL(UPPER(""BeginStr""),''),2,LENGTH(IFNULL(UPPER(""BeginStr""),''))) ""Doc"", ""ObjectCode""
                                        from ""NNM1"" where ""Series"" = {0} --AND ""ObjectCode"" = '{1}' ";
                        }
                        s = String.Format(s, sSeries, oForm.BusinessObject.Type);
                        orsx.DoQuery(s);
                        if (orsx.RecordCount > 0)
                        {
                            if ((System.String)(orsx.Fields.Item("Valor").Value) == "E")
                            {
                                oForm.Items.Item("VID_Estado").Visible = true;
                                oForm.Items.Item("VID_Estado").Enabled = false;
                                oForm.Items.Item("lblEstado").Visible  = true;
                            }
                            else
                            {
                                oForm.Items.Item("VID_Estado").Visible = false;
                                oForm.Items.Item("lblEstado").Visible  = false;
                            }
                        }

                        oForm.Freeze(false);
                    }
                }
            }
            catch (Exception e)
            {
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
                OutLog("MenuEvent: " + e.Message + " ** Trace: " + e.StackTrace);
            }
        }//fin MenuEvent
Ejemplo n.º 43
0
        /// <summary>
        /// 폼(Form)의 아이템들(Items)에 연결이 필요한 데이타소스(DataSource) 형식을 정의합니다.
        /// </summary>
        private void Act2_DataSourcesBinding() {
            // '// ADD YOUR ACTION CODE HERE ...

            #region ComboBox

            string sql = string.Empty;
            //string sql = FN.GetSQL("KIS_SF0360A_001");

            oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
            oRS1 = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);


            // 기수
            oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboYEAR").Specific;
            sql = string.Format(" SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201]  WHERE CODE = 'HR01' AND U_USEYN = 'Y'");
            FN.QComboBind(ref oComboBox, sql, FN.Enum_WholeTp.m_Nothing, null);

            sql = string.Format(" SELECT LEFT(U_SMLNM,4) AS YEAR FROM [@KIS_AD00201]  WHERE CODE = 'HR01' AND U_USEYN = 'Y' AND LEFT(U_SMLNM,4) = '{0}'",DateTime.Now.Year.ToString());
            oRS.DoQuery(sql);
            oComboBox.Select(oRS.Fields.Item("YEAR").Value.ToString(), BoSearchKey.psk_ByValue);

            // 상태
            oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboSTATUS").Specific;
            sql = string.Format(" SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201]  WHERE CODE = 'HR10' AND U_USEYN = 'Y'");
            FN.QComboBind(ref oComboBox, sql, FN.Enum_WholeTp.m_Nothing, null);

            sql = string.Format(" SELECT U_RMK2 FROM [@KIS_AD00201] WHERE CODE = 'HR01' AND U_USEYN = 'Y' AND U_SMLCD = '{0}'",oForm.Items.Item("cboYEAR").Specific.Value);
            oRS.DoQuery(sql);
            oComboBox.Select(oRS.Fields.Item("U_RMK2").Value.ToString(), BoSearchKey.psk_ByValue);

            #endregion

            // 고과대상자
            sql = string.Format(" select COUNT(*) from [@KIS_HR0120M]");
            oRS.DoQuery(sql);
            oForm.Items.Item("edtPERSON").Specific.Value = oRS.Fields.Item(0).Value.ToString();
      
        }
Ejemplo n.º 44
0
        /// <summary>
        /// Eventos de la forma activa
        /// </summary>
        /// <param name="FormUID">Id de la forma</param>
        /// <param name="pVal">Propiedades de la forma</param>
        /// <param name="BubbleEvent">Evento true/false</param>
        public override void eventos(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool bubbleEvent)
        {
            bubbleEvent = true;
            try
            {
                if (pVal.BeforeAction == false && pVal.FormType == FRM_TRANSFERENCIA_DE_STOCK)
                {
                    if (pVal.EventType == BoEventTypes.et_FORM_RESIZE)
                    {
                        _oForm = _Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                        OcultarControlesVentana(_oForm);
                        CrearCamposDeUsuario(_oForm);
                    }

                    if (pVal.EventType == BoEventTypes.et_FORM_CLOSE)
                    {
                        if (_oContadorFormas == 1)
                        {
                            _Application.ItemEvent      -= new _IApplicationEvents_ItemEventEventHandler(SBO_Application_ItemEvent);
                            _Application.StatusBarEvent -= new SAPbouiCOM._IApplicationEvents_StatusBarEventEventHandler(SBO_Application_StatusBarEvent);
                            Dispose();
                            application            = null;
                            company                = null;
                            _oTransferenciaDeStock = false;
                            Addon.typeList.RemoveAll(p => p._forma == formID);
                            return;
                        }
                        else
                        {
                            _oContadorFormas -= 1;
                        }
                    }

                    if (pVal.EventType == BoEventTypes.et_FORM_ACTIVATE)
                    {
                        _oForm = _Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                        CrearCamposDeUsuario(_oForm);
                    }
                }

                if (pVal.BeforeAction == true && pVal.FormType == FRM_TRANSFERENCIA_DE_STOCK)
                {
                    if (pVal.ItemUID == TXT_SERIE && pVal.CharPressed == CHAR_PRESS_ENTER && pVal.EventType == BoEventTypes.et_KEY_DOWN)
                    {
                        _oForm          = _Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                        _oTxtSerie      = _oForm.Items.Item(TXT_SERIE).Specific;
                        _oAlmacenOrigen = _oForm.Items.Item(TXT_ALMACEN_ORIGEN).Specific;
                        _oForm.Select();
                        if (!string.IsNullOrEmpty(_oTxtSerie.Value.ToString()))
                        {
                            _oForm.Select();
                            AgregarArticulo(_oForm, _oTxtSerie.Value.ToString(), _oAlmacenOrigen.Value.ToString());
                            _oForm.Select();
                        }
                        else
                        {
                            _Application.MessageBox("Capture el número de serie");
                        }
                        bubbleEvent = false;
                        return;
                    }

                    if (pVal.EventType == BoEventTypes.et_KEY_DOWN && pVal.ItemUID == GRID_ARTICULOS && pVal.ColUID == COLUMNA_SERIE_INICIO && pVal.CharPressed == CHAR_PRESS_ENTER)
                    {
                        bubbleEvent = false;
                        return;
                    }
                    if (pVal.EventType == BoEventTypes.et_KEY_DOWN && pVal.ItemUID == GRID_ARTICULOS && pVal.ColUID == COLUMNA_SERIE_FIN && pVal.CharPressed == CHAR_PRESS_ENTER)
                    {
                        bubbleEvent = false;
                        return;
                    }

                    if (pVal.EventType == BoEventTypes.et_KEY_DOWN && pVal.ItemUID == GRID_ARTICULOS && pVal.ColUID == COLUMNA_SERIE && pVal.CharPressed == CHAR_PRESS_ENTER)
                    {
                        bubbleEvent = false;
                        return;
                    }

                    if (pVal.EventType == BoEventTypes.et_ITEM_PRESSED && pVal.ItemUID == BTN_CREAR && pVal.InnerEvent == true)
                    {
                        bubbleEvent = false;
                        return;
                    }

                    if (pVal.EventType == BoEventTypes.et_ITEM_PRESSED && pVal.ItemUID == BTN_CREAR && pVal.InnerEvent == false)
                    {
                        _oForm       = _Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                        oBtnCrearSAP = _oForm.Items.Item(BTN_CREAR).Specific;

                        if (oBtnCrearSAP.Caption == "Crear")
                        {
                            string msgError = ValidarStatusSolicitudGrid(_oForm);

                            if (!string.IsNullOrEmpty(msgError))
                            {
                                _Application.MessageBox(msgError);
                                bubbleEvent = false;
                                bubbleEvent = false;
                                return;
                            }
                        }
                    }
                }

                if (pVal.BeforeAction == true && pVal.FormType == -FRM_TRANSFERENCIA_DE_STOCK)
                {
                    if (pVal.EventType == BoEventTypes.et_COMBO_SELECT && pVal.ItemUID == TIPO_MOVIMIENTO)
                    {
                        _oForm = _Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                        _oCmbTipoMovimiento = _oForm.Items.Item(TIPO_MOVIMIENTO).Specific;

                        if (!string.IsNullOrEmpty(_oCmbTipoMovimiento.Value.ToString()))
                        {
                            if (_oForm.Mode == BoFormMode.fm_ADD_MODE)
                            {
                                if (_Application.MessageBox("Estas seguro de cambiar el tipo de movimiento sin crear." + Environment.NewLine + "¿Desea continuar?", 2, "Si", "No") == 1)
                                {
                                    try
                                    {
                                        _oTxtPromotor.Value = "";
                                    }
                                    catch (Exception)
                                    {
                                    }
                                }
                                else
                                {
                                    bubbleEvent = false;
                                }
                            }
                        }
                    }
                }



                if (pVal.BeforeAction == false && pVal.FormType == -FRM_TRANSFERENCIA_DE_STOCK)
                {
                    if (pVal.EventType == BoEventTypes.et_COMBO_SELECT && pVal.ItemUID == TIPO_MOVIMIENTO)
                    {
                        _oForm = _Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                        _oForm.Freeze(true);
                        SAPbouiCOM.Form F1 = _Application.Forms.GetFormByTypeAndCount(Convert.ToInt32(_oForm.TypeEx.TrimStart('-')), _oForm.TypeCount);
                        F1.Freeze(true);
                        _oTxtPromotor       = F1.Items.Item(TXT_PROMOTOR).Specific;
                        _oTxtNombrePromotor = F1.Items.Item(TXT_NOMBRE_PROMOTOR).Specific;
                        _oTxtSerie          = F1.Items.Item(TXT_SERIE).Specific;
                        _oCmbTipoMovimiento = _oForm.Items.Item(TIPO_MOVIMIENTO).Specific;


                        if (!string.IsNullOrEmpty(_oCmbTipoMovimiento.Value.ToString()))
                        {
                            F1.Items.Item(TXT_SERIE).Enabled = true;
                            TipoMovimiento            = _oCmbTipoMovimiento.Value.ToString().TrimEnd(' ');
                            _oTxtFechaContabilizacion = F1.Items.Item(TXT_FECHA_CONTABILIZACION).Specific;
                            _oTxtFechaDocumento       = F1.Items.Item(TXT_FECHA_DOCUMENTO).Specific;

                            if (TipoMovimiento != "PROMOTORES - OFICINAS" && TipoMovimiento != "OFICINAS - PROMOTORES")
                            {
                                if (_oForm.Mode == BoFormMode.fm_ADD_MODE)
                                {
                                    _oTxtPromotor.Value       = Extensor.ObtenerSecretaria(_Company, "U_codigo_secretaria");
                                    _oTxtNombrePromotor.Value = Extensor.ObtenerSecretaria(_Company, "T0.U_nombre_secretaria");
                                }
                            }
                            else
                            {
                                if (_oForm.Mode == BoFormMode.fm_ADD_MODE)
                                {
                                    _oTxtPromotor.Value       = "";
                                    _oTxtNombrePromotor.Value = "";
                                }
                            }

                            if (TipoMovimiento == "PROMOTORES - OFICINAS" || TipoMovimiento == "OFICINAS - PROMOTORES")
                            {
                                if (_oForm.Mode == BoFormMode.fm_ADD_MODE)
                                {
                                    //if (Extensor.ValidarImpresionCorteSolicitudes(_Company))
                                    //{
                                    if (F1.Items.Item(TXT_FECHA_DOCUMENTO).Enabled == true)
                                    {
                                        _oTxtFechaContabilizacion.Value = DateTime.Now.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);
                                        _oTxtFechaDocumento.Value       = DateTime.Now.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);
                                        F1.Items.Item(TXT_FECHA_CONTABILIZACION).Enabled = false;
                                        F1.Items.Item(TXT_PROMOTOR).Click();
                                        F1.Items.Item(TXT_FECHA_DOCUMENTO).Enabled = false;
                                    }
                                    //}
                                    //else
                                    //{
                                    //    if (F1.Items.Item(TXT_FECHA_DOCUMENTO).Enabled == true)
                                    //    {
                                    //        DateTime hoy = DateTime.Now;
                                    //        DateTime mañana = hoy.AddDays(1);
                                    //        _oTxtFechaContabilizacion.Value = hoy.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture).ToString();
                                    //        _oTxtFechaDocumento.Value = mañana.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture).ToString();
                                    //        F1.Items.Item(TXT_FECHA_CONTABILIZACION).Enabled = false;
                                    //        F1.Items.Item(TXT_PROMOTOR).Click();
                                    //        F1.Items.Item(TXT_FECHA_DOCUMENTO).Enabled = false;
                                    //    }
                                    //}
                                }
                            }
                            else
                            {
                                if (_oForm.Mode == BoFormMode.fm_ADD_MODE)
                                {
                                    F1.Items.Item(TXT_PROMOTOR).Click();
                                    F1.Items.Item(TXT_FECHA_CONTABILIZACION).Enabled = true;
                                    _oTxtFechaContabilizacion.Value = DateTime.Now.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);
                                    F1.Items.Item(TXT_PROMOTOR).Click();
                                    F1.Items.Item(TXT_FECHA_DOCUMENTO).Enabled = true;
                                    _oTxtFechaDocumento.Value = DateTime.Now.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);
                                }
                            }
                        }

                        _oForm.Freeze(false);
                        F1.Freeze(false);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en método 'eventos' *clsTransferenciaDeStock* : " + ex.Message);
            }
        }
Ejemplo n.º 45
0
        //고과상태변경
        public virtual bool StatusChange(string Status)
        {
            oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);

            StringBuilder pQuery = new StringBuilder();
            string sQry = string.Empty;

            EXAMCD = oForm.Items.Item("cboYEAR").Specific.Value;

            try
            {

                oComboBox = ((SAPbouiCOM.ComboBox)(oForm.Items.Item("cboSTATUS").Specific));
                if (B1Connections.theAppl.MessageBox(oComboBox.Selected.Description + "로 저장하시겠습니까?", 1, "OK", "NO") == 2)
                {
                    return false;
                }

                if (Status == "U01")
                {
                    #region 고과상태변경
                    pQuery.Clear();
                    pQuery.AppendLine(" UPDATE [@KIS_AD00201] SET U_RMK2 = 'U01'    ");
                    pQuery.AppendLine(" WHERE CODE = 'HR01' AND U_USEYN = 'Y'       ");
                    pQuery.AppendLine(" AND U_SMLCD = '{0}'                         ");
                    sQry = string.Format(pQuery.ToString(), EXAMCD);
                    oRS.DoQuery(sQry);
                    #endregion

                }
                else if (Status == "U02")
                {
                    string Cnt = FN.GetRecordsetValue(string.Format("SELECT * FROM [@KIS_HR0020M_HRD] WHERE U_EXAMCD = '{0}'", EXAMCD));
                    if (Cnt != "")
                    {
                        if (B1Connections.theAppl.MessageBox("고과마스터가 이미 생성되었습니다로 새로 저장하시겠습니까?", 1, "OK", "NO") == 2)
                        {
                            #region 고과상태변경
                            pQuery.Clear();
                            pQuery.AppendLine(" UPDATE [@KIS_AD00201] SET U_RMK2 = 'U02'    ");
                            pQuery.AppendLine(" WHERE CODE = 'HR01' AND U_USEYN = 'Y'       ");
                            pQuery.AppendLine(" AND U_SMLCD = '{0}'                         ");
                            sQry = string.Format(pQuery.ToString(), EXAMCD);
                            oRS.DoQuery(sQry);
                            #endregion

                            return false;
                        }
                    }

                    pQuery.Clear();
                    pQuery.AppendLine(" DELETE FROM [@KIS_HR0020M_HRD] WHERE U_EXAMCD = '{0}'  ");
                    pQuery.AppendLine(" DELETE FROM [@KIS_HR00201_HRD] WHERE U_EXAMCD = '{0}'  ");
                    pQuery.AppendLine(" DELETE FROM [@KIS_HR00202_HRD] WHERE U_EXAMCD = '{0}'  ");
                    pQuery.AppendLine(" DELETE FROM [@KIS_HR00203_HRD] WHERE U_EXAMCD = '{0}'  ");
                    pQuery.AppendLine(" DELETE FROM [@KIS_HR00204_HRD] WHERE U_EXAMCD = '{0}'  ");
                    sQry = string.Format(pQuery.ToString(), EXAMCD);
                    oRS.DoQuery(sQry);

                    // 고과 마스터 생성
                    UDO_Add_Data();

                    #region 고과상태변경
                    pQuery.Clear();
                    pQuery.AppendLine(" UPDATE [@KIS_AD00201] SET U_RMK2 = 'U02'    ");
                    pQuery.AppendLine(" WHERE CODE = 'HR01' AND U_USEYN = 'Y'       ");
                    pQuery.AppendLine(" AND U_SMLCD = '{0}'                         ");
                    sQry = string.Format(pQuery.ToString(), EXAMCD);
                    oRS.DoQuery(sQry);
                    #endregion

                    if (B1Connections.theAppl.MessageBox("고과마스터생성완료", 1, "확인", "", "") == 1)
                    {
                        oForm.Items.Item("btnFIND").Click(BoCellClickType.ct_Regular);
                    }

                }
                else if (Status == "U03")
                {
                    #region 고과상태변경
                    pQuery.Clear();
                    pQuery.AppendLine(" UPDATE [@KIS_AD00201] SET U_RMK2 = 'U03'    ");
                    pQuery.AppendLine(" WHERE CODE = 'HR01' AND U_USEYN = 'Y'       ");
                    pQuery.AppendLine(" AND U_SMLCD = '{0}'                         ");
                    sQry = string.Format(pQuery.ToString(), EXAMCD);
                    oRS.DoQuery(sQry);
                    #endregion
                    B1Connections.theAppl.MessageBox("고과상태 고과시작으로 변경", 1, "확인", "", "");
                }
                else if (Status == "U08")
                {

                    //점수,등급 계산및 업데이트
                    oRS.DoQuery("EXEC KIS_SP_HR0010B1_HRD '1',0,0");
                    #region 고과상태변경
                    pQuery.Clear();
                    pQuery.AppendLine(" UPDATE [@KIS_AD00201] SET U_RMK2 = 'U08'    ");
                    pQuery.AppendLine(" WHERE CODE = 'HR01' AND U_USEYN = 'Y'       ");
                    pQuery.AppendLine(" AND U_SMLCD = '{0}'                         ");
                    sQry = string.Format(pQuery.ToString(), EXAMCD);
                    oRS.DoQuery(sQry);
                    #endregion

                    B1Connections.theAppl.MessageBox("고과상태 고과마감으로 변경", 1, "확인", "", "");
                }
                else if (Status == "U09")
                {
                    if (STATE == false)
                    {
                        B1Connections.theAppl.StatusBar.SetText("조회후 저장해주세요", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                        return false;
                    }
                    else
                    {
                        //인사 KIS_HR00220 업데이트
                        UDO_Add_Data_HR00220();
                        #region 고과상태변경
                        pQuery.Clear();
                        pQuery.AppendLine(" UPDATE [@KIS_AD00201] SET U_RMK2 = 'U09'    ");
                        pQuery.AppendLine(" WHERE CODE = 'HR01' AND U_USEYN = 'Y'       ");
                        pQuery.AppendLine(" AND U_SMLCD = '{0}'                         ");
                        sQry = string.Format(pQuery.ToString(), EXAMCD);
                        oRS.DoQuery(sQry);
                        #endregion

                    }
                }                 
            
            }

            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oRS = null;
                oGrid = null;
            }
            return true;

        }
Ejemplo n.º 46
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting(SAPbouiCOM.Form oForm, string pStrPFormUID)
        {
            // '// ADD YOUR ACTION CODE HERE ...
            string strDEPDOM = string.Empty;

            try
            {
                #region Form Setting
                oForm.SupportedModes = -1;
                oForm.Settings.EnableRowFormat = false;
                oForm.Settings.Enabled = false;
                oForm.AutoManaged = false;

                if (oForm.Mode != BoFormMode.fm_ADD_MODE && oForm.Mode != BoFormMode.fm_VIEW_MODE)
                {
                    oForm.Mode = BoFormMode.fm_OK_MODE;
                }
                #endregion

                oForm.DataSources.UserDataSources.Item("pFormUID").Value = pStrPFormUID;

                // 신청접수년월
                oComboBox = oForm.Items.Item("cboTAKEYM").Specific;
                SO.SO_COMMON_HRD.SetComboValue_YearMonth(ref oComboBox, FN.Enum_WholeTp.m_Space, "");

                oForm.DataSources.DataTables.Add("grd");
                
                //FindData(oForm);
                this.SetGridTitle(oForm);

            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
Ejemplo n.º 47
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting() {
            // '// ADD YOUR ACTION CODE HERE ...

            try
            {
                #region Form Setting

                oForm.SupportedModes = 1;
                oForm.Settings.EnableRowFormat = false;
                oForm.Settings.Enabled = false;
                oForm.AutoManaged = true;

                #endregion

                #region ComboBox

                string sql = string.Empty;

                // 콜유형
                oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboCALLTP").Specific;
                // 2014.06.13 주소변경 후속작업에 추가
                sql = string.Format(" SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = {0} AND U_USEYN = 'Y'AND U_SMLCD IN ('U20','U30','U60','U70') ORDER BY U_SMLCD ", FN.SetSingleQuotes("SO12"));
                FN.QComboBind(ref oComboBox, sql, FN.Enum_WholeTp.m_Space, null);

                oForm.DataSources.UserDataSources.Item("edtFRRECDT").Value = B1Connections.diCompany.GetCompanyDate().ToShortDateString();
                oForm.DataSources.UserDataSources.Item("edtTORECDT").Value = B1Connections.diCompany.GetCompanyDate().ToShortDateString();

                // 처리상태
                oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboPROSTAT").Specific;
                oComboBox.ValidValues.Add("", "전체");
                oComboBox.ValidValues.Add("N", "미결");
                oComboBox.ValidValues.Add("O", "완료");
                //FN.QComboBind(ref oComboBox, sql, FN.Enum_WholeTp.m_Space, null);

                #endregion

                #region EditText

                SAPbouiCOM.Conditions oCons = new SAPbouiCOM.Conditions();
                //oCons = FN.GetConditionsWithQuery("Type == S && Status == P && (U_WRKODYN ~~ || (U_WRKODYN !~ && U_WRKODYN == N))");

                // 독자코드
                oCons = null; FN.SetChooseFromListAdd(oForm, "KIS_SO0030_HRD", "edtFRRDCD", "Code", BoFormItemTypes.it_EDIT, oCons);
                oCons = null; FN.SetChooseFromListAdd(oForm, "KIS_SO0030_HRD", "edtTORDCD", "Code", BoFormItemTypes.it_EDIT, oCons);

                //// 배달코드
                oCons = null; FN.SetChooseFromListAdd(oForm, "KIS_SO0030_HRD", "edtFRDELCD", "Code", BoFormItemTypes.it_EDIT, oCons);
                oCons = null; FN.SetChooseFromListAdd(oForm, "KIS_SO0030_HRD", "edtTODELCD", "Code", BoFormItemTypes.it_EDIT, oCons);

                //// 작업자
                oCons = FN.GetConditionsWithQuery("U_USERGBN == 10,20,30");
                FN.SetChooseFromListAdd(oForm, "KIS_SO0010_HRD", "edtRECVID", "Code", BoFormItemTypes.it_EDIT, oCons);
                
                #endregion

                oForm.DataSources.DataTables.Add("grd");

                SetGridTitle(oForm);

                foreach (SAPbouiCOM.Item item in oForm.Items)
                {
                    item.AffectsFormMode = false;
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
       
        }
Ejemplo n.º 48
0
        public virtual bool ET_cboTAKEYM_BFClick(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oComboBox = ((SAPbouiCOM.ComboBox)(oForm.Items.Item("cboTAKEYM").Specific));
            
            // ADD YOUR ACTION CODE HERE ...
            if (!string.IsNullOrEmpty(oComboBox.Value.ToString()))
                SO.SO_COMMON_HRD.SetComboValue_YearMonth(ref oComboBox, FN.Enum_WholeTp.m_Space, oComboBox.Value.Trim());

            return true;
        }
Ejemplo n.º 49
0
        /// <summary>
        /// 폼(Form)의 아이템들(Items)에 연결이 필요한 데이타소스(DataSource) 형식을 정의합니다.
        /// </summary>
        private void Act2_DataSourcesBinding() {
            // '// ADD YOUR ACTION CODE HERE ...

            #region EditText
            string ItemUID = "";

            ItemUID = "edtEMPNO"; oForm.DataSources.UserDataSources.Add(ItemUID, BoDataType.dt_SHORT_TEXT, 30); FN.SetUserDataBind(oForm, ItemUID);//사원코드
            ItemUID = "edtEMPNM"; oForm.DataSources.UserDataSources.Add(ItemUID, BoDataType.dt_SHORT_TEXT, 30); FN.SetUserDataBind(oForm, ItemUID);//사원코드

            #endregion

            #region ComboBox

            string sql = string.Empty;
            //string sql = FN.GetSQL("KIS_SF0360A_001");

            oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);

            // 기수
            oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboYEAR").Specific;
            sql = string.Format(" SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201]  WHERE CODE = 'HR01' AND U_USEYN = 'Y'");
            FN.QComboBind(ref oComboBox, sql, FN.Enum_WholeTp.m_Nothing, null);

            sql = string.Format(" SELECT LEFT(U_SMLNM,4) AS YEAR FROM [@KIS_AD00201]  WHERE CODE = 'HR01' AND U_USEYN = 'Y' AND LEFT(U_SMLNM,4) = '" + DateTime.Now.Year.ToString() + "'");
            oRS.DoQuery(sql);
            oComboBox.Select(oRS.Fields.Item("YEAR").Value.ToString(), BoSearchKey.psk_ByValue);

            // 부서
            oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboDEPT").Specific;
            sql = string.Format(" SELECT U_DEPTCD,U_DEPTNM FROM [@KIS_HR00401] WHERE U_USEYN = 'Y'");
            oComboBox.ValidValues.Add("", "");
            FN.QComboBind(ref oComboBox, sql, FN.Enum_WholeTp.m_Nothing, null);

            #endregion

            #region ChooseFromList

            SAPbouiCOM.Conditions oCons = new SAPbouiCOM.Conditions();
            //oCons = FN.GetConditionsWithQuery("CARDTYPE == S");
            oCons = null;

            FN.SetChooseFromListAdd(oForm, "KIS_HR0120", "edtEMPNO", "U_EMPNO", BoFormItemTypes.it_EXTEDIT, oCons);

            #endregion      
        }
Ejemplo n.º 50
0
        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;

            Param       = new TFunctions();
            Param.SBO_f = FSBOf;

            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_GELibro.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("TipoLibro", BoDataType.dt_SHORT_TEXT);
                oComboBox = (ComboBox)(oForm.Items.Item("TipoLibro").Specific);
                oComboBox.DataBind.SetBound(true, "", "TipoLibro");
                oComboBox.ValidValues.Add("V", "Venta");
                oComboBox.ValidValues.Add("C", "Compra");
                oComboBox.Select("V", BoSearchKey.psk_ByValue);

                oForm.DataSources.UserDataSources.Add("Periodo", BoDataType.dt_SHORT_TEXT);
                oComboBox = (ComboBox)(oForm.Items.Item("Periodo").Specific);
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    oRecordSet.DoQuery("select CAST(AbsEntry AS VARCHAR(20)) Code, Code 'Name'  from OFPR where YEAR(F_RefDate) >= YEAR(GETDATE())-1  AND YEAR(T_RefDate) <= YEAR(GETDATE())");
                }
                else
                {
                    oRecordSet.DoQuery(@"select TO_VARCHAR(""AbsEntry"") ""Code"", ""Code"" ""Name""  from ""OFPR"" where YEAR(""F_RefDate"") >= YEAR(NOW())-1  AND YEAR(""T_RefDate"") <= YEAR(NOW()) ");
                }
                FSBOf.FillCombo((ComboBox)(oForm.Items.Item("Periodo").Specific), ref oRecordSet, false);
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select AbsEntry from OFPR where GETDATE() BETWEEN F_RefDate AND T_RefDate";
                }
                else
                {
                    s = @"select ""AbsEntry"" from ""OFPR"" where NOW() BETWEEN ""F_RefDate"" AND ""T_RefDate"" ";
                }
                oRecordSet.DoQuery(s);
                oComboBox.Select(((System.Int32)oRecordSet.Fields.Item("AbsEntry").Value).ToString(), BoSearchKey.psk_ByValue);


                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select ISNULL(U_MultiSoc,'N') MultiSoc from [@VID_FEPARAM]";
                }
                else
                {
                    s = @"select IFNULL(""U_MultiSoc"",'N') ""MultiSoc"" from ""@VID_FEPARAM"" ";
                }
                oRecordSet.DoQuery(s);
                if (oRecordSet.RecordCount > 0)
                {
                    if (((System.String)oRecordSet.Fields.Item("MultiSoc").Value) == "Y")
                    {
                        bMultiSoc = true;
                    }
                }

                if (bMultiSoc)
                {
                    oForm.Items.Item("LInstituto").Visible = true;
                    oForm.Items.Item("Instituto").Visible  = true;
                    oComboBox = (ComboBox)(oForm.Items.Item("Instituto").Specific);
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"select DocEntry, U_Sociedad 'Sociedad' from [@VID_FEMULTISOC] where isnull(U_Habilitada,'N') = 'Y'";
                    }
                    else
                    {
                        s = @"select ""DocEntry"", ""U_Sociedad"" ""Sociedad"" from ""@VID_FEMULTISOC"" where IFNULL(""U_Habilitada"",'N') = 'Y' ";
                    }
                    oRecordSet.DoQuery(s);
                    while (!oRecordSet.EoF)
                    {
                        oComboBox.ValidValues.Add(((System.Int32)oRecordSet.Fields.Item("DocEntry").Value).ToString(), ((System.String)oRecordSet.Fields.Item("Sociedad").Value).Trim());
                        oRecordSet.MoveNext();
                    }
                }
                else
                {
                    oForm.Items.Item("LInstituto").Visible = false;
                    oForm.Items.Item("Instituto").Visible  = false;
                }
            }
            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
Ejemplo n.º 51
0
 public virtual void ET_cboMTCHO_AFComboSelect(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oComboBox = ((SAPbouiCOM.ComboBox)(oForm.Items.Item("cboMTCHO").Specific));
     // ADD YOUR ACTION CODE HERE ...
     FindData3(oForm);
 }
Ejemplo n.º 52
0
        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_GLibro.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("TipoLibro", BoDataType.dt_SHORT_TEXT);
                oComboBox = (ComboBox)(oForm.Items.Item("TipoLibro").Specific);
                oComboBox.DataBind.SetBound(true, "", "TipoLibro");
                oComboBox.ValidValues.Add("V", "Venta");
                oComboBox.ValidValues.Add("C", "Compra");
                oComboBox.ValidValues.Add("B", "Boletas");
                oComboBox.ValidValues.Add("G", "Guias");
                oComboBox.Select("V", BoSearchKey.psk_ByValue);

                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");

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select ISNULL(U_MultiSoc,'N') MultiSoc from [@VID_FEPARAM]";
                }
                else
                {
                    s = @"select IFNULL(""U_MultiSoc"",'N') ""MultiSoc"" from ""@VID_FEPARAM"" ";
                }
                oRecordSet.DoQuery(s);
                if (oRecordSet.RecordCount > 0)
                {
                    if (((System.String)oRecordSet.Fields.Item("MultiSoc").Value) == "Y")
                    {
                        bMultiSoc = true;
                    }
                }

                if (bMultiSoc)
                {
                    oForm.Items.Item("LInstituto").Visible = true;
                    oForm.Items.Item("Instituto").Visible  = true;
                    oComboBox = (ComboBox)(oForm.Items.Item("Instituto").Specific);
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"select DocEntry, U_Sociedad 'Sociedad' from [@VID_FEMULTISOC] where isnull(U_Habilitada,'N') = 'Y'";
                    }
                    else
                    {
                        s = @"select ""DocEntry"", ""U_Sociedad"" ""Sociedad"" from ""@VID_FEMULTISOC"" where IFNULL(""U_Habilitada"",'N') = 'Y' ";
                    }
                    oRecordSet.DoQuery(s);
                    while (!oRecordSet.EoF)
                    {
                        oComboBox.ValidValues.Add(((System.Int32)oRecordSet.Fields.Item("DocEntry").Value).ToString(), ((System.String)oRecordSet.Fields.Item("Sociedad").Value).Trim());
                        oRecordSet.MoveNext();
                    }
                }
                else
                {
                    oForm.Items.Item("LInstituto").Visible = false;
                    oForm.Items.Item("Instituto").Visible  = false;
                }
            }
            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
Ejemplo n.º 53
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();
        }
        private void CriarFormulario()
        {
            SAPbouiCOM.Item oItem = null;
            //SAPbouiCOM.Button oButton = null;
            SAPbouiCOM.StaticText oStaticText = null;
            SAPbouiCOM.ComboBox   oComboBox   = null;
            SAPbouiCOM.EditText   oEditText   = null;

            try
            {
                this.oForm = this.oApplication.Forms.Add("frmStatusBar", BoFormTypes.ft_Fixed, -1);
            }
            catch (COMException ex)
            {
                //if (ex.ErrorCode == -7010)
                //{
                //    this.oForm = this.oApplication.Forms.Add("frmStatusBar");


                //}
                //else
                //{
                System.Windows.Forms.MessageBox.Show(
                    ex.Message
                    , "Erro"
                    , System.Windows.Forms.MessageBoxButtons.OK
                    , System.Windows.Forms.MessageBoxIcon.Error
                    );
                System.Environment.Exit(0);

                //}
            }

            ConfiguraForm(
                "Exemplo Status Bar"
                , 400
                , 350
                , 100
                , 80
                );
            //add botao ok
            this.oButtonOK            = UIHelper.AddBotaoAoFormulario(this.oForm, "1", 6, 65, 53, 19, "OK");
            this.oButtonMenssagem     = UIHelper.AddBotaoAoFormulario(this.oForm, "BTN_STATUS", 90, 150, 53, 19, "Mostrar Mensagem");
            this.oItemRect            = UIHelper.AddRectAoFormulario(this.oForm, "Rect1", 0, 344, 1, 45);
            this.oComboBoxTypeMessage = UIHelper.AddComboBoxAoFormulario(this.oForm, "ComboBox1", 157, 163, 24, 14);
            this.oEditTextMessage     = UIHelper.AddEditTextAoFormulario(this.oForm, "edtMessage", 157, 163, 8, 14);



            this.oStaticTextMensagem     = UIHelper.AddStaticTextAoFormulario(this.oForm, "st01", 7, 148, 8, 14, "Mensagem de texto:", "edtMessage");
            this.oStaticTextTipoMensagem = UIHelper.AddStaticTextAoFormulario(this.oForm, "st02", 7, 148, 8, 14, "Mensagem de texto:", "ComboBox1");

            this.AddDataSources();


            this.oComboBoxTypeMessage.ValidValues.Add(Convert.ToString(BoStatusBarMessageType.smt_Warning), "Warning");
            this.oComboBoxTypeMessage.ValidValues.Add(Convert.ToString(BoStatusBarMessageType.smt_Error), "Error");
            this.oComboBoxTypeMessage.ValidValues.Add(Convert.ToString(BoStatusBarMessageType.smt_None), "None");
            this.oComboBoxTypeMessage.ValidValues.Add(Convert.ToString(BoStatusBarMessageType.smt_Success), "Sucess");

            this.oComboBoxTypeMessage.Select(0, BoSearchKey.psk_Index);
        }
Ejemplo n.º 55
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();
        }
Ejemplo n.º 56
0
        private String sConnection()
        {
            String sMultiSoc;

            try
            {
                if (bMultiSoc == true)
                {
                    oComboBox = (ComboBox)(oForm.Items.Item("Instituto").Specific);
                    sMultiSoc = oComboBox.Selected.Value;

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"select U_Servidor, U_Base, U_Usuario, U_Password
                                from [@VID_FEMULTISOC] WITH (NOLOCK)
                               where DocEntry = {0}";
                    }
                    else
                    {
                        s = @"select ""U_Servidor"", ""U_Base"", ""U_Usuario"", ""U_Password""
                                       from ""@VID_FEMULTISOC""
                                      where ""DocEntry"" = {0} ";
                    }
                    s = String.Format(s, sMultiSoc);
                }
                else
                {
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"Select U_Servidor
                                    ,U_Base
                                    ,U_Usuario
                                    ,U_Password
                               from [@VID_FEPARAM] ";
                    }
                    else
                    {
                        s = @"Select ""U_Servidor""
                                    ,""U_Base""
                                    ,""U_Usuario""
                                    ,""U_Password""
                               from ""@VID_FEPARAM"" ";
                    }
                }
                oRecordSet.DoQuery(s);
                if (oRecordSet.RecordCount > 0)
                {
                    if (bMultiSoc == true)
                    {
                        User = (System.String)(oRecordSet.Fields.Item("U_Usuario").Value).ToString().Trim();
                        Pass = (System.String)(oRecordSet.Fields.Item("U_Password").Value).ToString().Trim();
                    }
                    else
                    {
                        User = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_Usuario").Value).ToString().Trim());
                        Pass = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_Password").Value).ToString().Trim());
                    }
                    return(Param.sConexion((System.String)(oRecordSet.Fields.Item("U_Servidor").Value), (System.String)(oRecordSet.Fields.Item("U_Base").Value), User, Pass));
                }
                else
                {
                    return("");
                }
            }
            catch (Exception e)
            {
                return("");
            }
        }
Ejemplo n.º 57
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting(SAPbouiCOM.Form oForm)
        {
            // '// ADD YOUR ACTION CODE HERE ...
            oForm.Settings.EnableRowFormat = false;
            // UDO, 네비게이션 사용하지 않음
            oForm.SupportedModes = 1;

            FN.SetOptionBtn(ref oForm, "optALL(A),optREAD(R),optCENT(C)", "optALL");
            string strYYYYMM = FN.SetDateFormatToDB(DateTimeLibrary.FirstDayOfCurrentMonth(), FN.eDateType.n_YYYYMMDD).Substring(0, 6);

            // 청구년월 시작
            oComboBox = oForm.Items.Item("cboREQYM_F").Specific;
            SO.SO_COMMON_HRD.SetComboValue_YearMonth(ref oComboBox, FN.Enum_WholeTp.m_Nothing, strYYYYMM);

            // 청구년월 종료
            oComboBox = oForm.Items.Item("cboREQYM_T").Specific;
            SO.SO_COMMON_HRD.SetComboValue_YearMonth(ref oComboBox, FN.Enum_WholeTp.m_Nothing, strYYYYMM);

            // 계산서발행구분
            FN.SetComboBoxValidValues(oForm, " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO15' AND U_SMLCD IN ('U0', 'U1', 'U3', 'U5') ", "cboBILLTP", FN.Enum_WholeTp.m_Space);

            #region 독자마스터 Condition
            SAPbouiCOM.Conditions oCons = new Conditions(); ;
            SAPbouiCOM.Condition oCon = oCons.Add();

            oCon.Alias = "U_VATGRUP"; //계산서발행구분 
            oCon.Operation = BoConditionOperation.co_EQUAL;
            oCon.CondVal = "U0"; // 발행(전자)

            oCon.Relationship = BoConditionRelationship.cr_OR;

            oCon = oCons.Add();
            oCon.Alias = "U_VATGRUP"; 
            oCon.Operation = BoConditionOperation.co_EQUAL;
            oCon.CondVal = "U1"; // 발행(종이)

            oCon.Relationship = BoConditionRelationship.cr_OR;

            oCon = oCons.Add();
            oCon.Alias = "U_VATGRUP"; 
            oCon.Operation = BoConditionOperation.co_EQUAL;
            oCon.CondVal = "U3"; // 수기발행(선납)

            oCon.Relationship = BoConditionRelationship.cr_OR;

            oCon = oCons.Add();
            oCon.Alias = "U_VATGRUP"; 
            oCon.Operation = BoConditionOperation.co_EQUAL;
            oCon.CondVal = "U5"; // 발행(전자타사)

            #endregion
            FN.SetChooseFromListAdd(oForm, "KIS_SO0030_HRD", "edtREAD_F", "Code", BoFormItemTypes.it_EDIT, oCons, "edtREAD_F");
            FN.SetChooseFromListAdd(oForm, "KIS_SO0030_HRD", "edtREAD_T", "Code", BoFormItemTypes.it_EDIT, oCons, "edtREAD_T");


            #region 지국마스터 Condition
            oCons = new Conditions(); ;
            oCon = oCons.Add();

            oCon.Alias = "U_BILLGBN"; //계산서발행구분 
            oCon.Operation = BoConditionOperation.co_EQUAL;
            oCon.CondVal = "U0"; // 발행(전자)

            oCon.Relationship = BoConditionRelationship.cr_OR;

            oCon = oCons.Add();
            oCon.Alias = "U_BILLGBN"; // 발행(종이)
            oCon.Operation = BoConditionOperation.co_EQUAL;
            oCon.CondVal = "U1";

            oCon.Relationship = BoConditionRelationship.cr_OR;

            oCon = oCons.Add();
            oCon.Alias = "U_BILLGBN"; // 발행(종이)
            oCon.Operation = BoConditionOperation.co_EQUAL;
            oCon.CondVal = "U3";

            oCon.Relationship = BoConditionRelationship.cr_OR;

            oCon = oCons.Add();
            oCon.Alias = "U_BILLGBN"; // 발행(종이)
            oCon.Operation = BoConditionOperation.co_EQUAL;
            oCon.CondVal = "U5";

            #endregion
            FN.SetChooseFromListAdd(oForm, "KIS_SO0040_HRD", "edtCENT_F", "Code", BoFormItemTypes.it_EDIT, oCons, "edtCENT_F");
            FN.SetChooseFromListAdd(oForm, "KIS_SO0040_HRD", "edtCENT_T", "Code", BoFormItemTypes.it_EDIT, oCons, "edtCENT_T");

            SetGridTitle(oForm);

            SAPbouiCOM.Item oItem = oForm.Items.Item("fld01");
            oItem.Click();
        }
Ejemplo n.º 58
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 = "";
        }
Ejemplo n.º 59
0
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            Int32 CantRol;

            SAPbouiCOM.Folder oFolder;
            SAPbouiCOM.Item   oItem;
            SAPbouiCOM.Item   oItemB;
            Boolean           Flag;


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

            oRecordSet      = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
            Funciones.SBO_f = FSBOf;
            try
            {
                Lista = new List <string>();
                oForm = FSBOApp.Forms.Item(uid);
                Flag  = false;
                oForm.Freeze(true);

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = "select ISNULL(TaxIdNum,'') TaxIdNum from OADM ";
                }
                else
                {
                    s = @"select IFNULL(""TaxIdNum"",'') ""TaxIdNum"" from ""OADM"" ";
                }

                oRecordSet.DoQuery(s);
                if (oRecordSet.RecordCount == 0)
                {
                    throw new Exception("Debe ingresar RUC de Emisor, Gestión -> Inicialización Sistema -> Detalle Sociedad -> Datos de Contabilidad -> ID fiscal general 1");
                }
                else
                {
                    RUC = ((System.String)oRecordSet.Fields.Item("TaxIdNum").Value).Trim();
                }


                //Campo con el estado de DTE
                oItemB          = oForm.Items.Item("53");
                oItem           = oForm.Items.Add("lblEstado", SAPbouiCOM.BoFormItemTypes.it_STATIC);
                oItem.Left      = oItemB.Left;
                oItem.Width     = oItemB.Width;
                oItem.Top       = oItemB.Top + oItemB.Height + 5;
                oItem.Height    = oItem.Height;
                oItem.LinkTo    = "VID_FEEstado";
                oStatic         = (StaticText)(oForm.Items.Item("lblEstado").Specific);
                oStatic.Caption = "Estado Doc. Electronico";

                oItemB            = oForm.Items.Item("52");
                oItem             = oForm.Items.Add("VID_Estado", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX);
                oItem.Left        = oItemB.Left;
                oItem.Width       = oItemB.Width;
                oItem.Top         = oItemB.Top + oItemB.Height + 5;
                oItem.Height      = oItem.Height;
                oItem.DisplayDesc = true;
                oItem.Enabled     = false;
                oComboBox         = (ComboBox)(oForm.Items.Item("VID_Estado").Specific);

                //colocar folder con los campos necesarios en FE PERU
                //oForm.DataSources.UserDataSources.Add("VID_FEDCTO", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1);
                //oItem = oForm.Items.Add("VID_FEDCTO", SAPbouiCOM.BoFormItemTypes.it_FOLDER);

                //oItemB = oForm.Items.Item("1320002137");

                //oItem.Left = oItemB.Left + 30;
                //oItem.Width = oItemB.Width;
                //oItem.Top = oItemB.Top;
                //oItem.Height = oItem.Height;
                //oFolder = (Folder)((oItem.Specific));
                //oFolder.Caption = "Factura Electrónica";
                //oFolder.Pane = 333;
                //oFolder.DataBind.SetBound(true, "", "VID_FEDCTO");
                //para SAP 882 en adelante
                //oFolder.GroupWith("1320002137");

                //cargar campos de usuarios
                oItemB       = oForm.Items.Item("lblEstado");
                oItem        = oForm.Items.Add("lblPTSC", SAPbouiCOM.BoFormItemTypes.it_STATIC);
                oItem.Left   = oItemB.Left;
                oItem.Width  = oItemB.Width;
                oItem.Top    = oItemB.Top + oItemB.Height + 5;
                oItem.Height = oItemB.Height;
                //oItem.FromPane = 333;
                //oItem.ToPane = 333;
                oItem.LinkTo    = "VID_FEPTSC";
                oStatic         = (StaticText)(oForm.Items.Item("lblPTSC").Specific);
                oStatic.Caption = "Serie del documento";

                oItemB       = oForm.Items.Item("VID_Estado");
                oItem        = oForm.Items.Add("VID_FEPTSC", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                oItem.Left   = oItemB.Left;
                oItem.Width  = 90; // oItemB.Width;
                oItem.Top    = oItemB.Top + oItemB.Height + 5;
                oItem.Height = oItemB.Height;
                //oItem.FromPane = 333;
                //oItem.ToPane = 333;
                oItem.RightJustified = true;
                oEditText            = (EditText)(oForm.Items.Item("VID_FEPTSC").Specific);
                oEditText.DataBind.SetBound(true, "OVPM", "U_BPP_PTSC");

                //--
                oItemB       = oForm.Items.Item("lblPTSC");
                oItem        = oForm.Items.Add("lblPTCC", SAPbouiCOM.BoFormItemTypes.it_STATIC);
                oItem.Left   = oItemB.Left;
                oItem.Width  = oItemB.Width;
                oItem.Top    = oItemB.Top + oItemB.Height + 5;
                oItem.Height = oItemB.Height;
                //oItem.FromPane = 333;
                //oItem.ToPane = 333;
                oItem.LinkTo    = "VID_FEPTCC";
                oStatic         = (StaticText)(oForm.Items.Item("lblPTCC").Specific);
                oStatic.Caption = "Correlativo del documento";

                oItemB       = oForm.Items.Item("VID_FEPTSC");
                oItem        = oForm.Items.Add("VID_FEPTCC", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                oItem.Left   = oItemB.Left;
                oItem.Width  = 90; // oItemB.Width;
                oItem.Top    = oItemB.Top + oItemB.Height + 5;
                oItem.Height = oItemB.Height;
                //oItem.FromPane = 333;
                //oItem.ToPane = 333;
                oItem.RightJustified = true;
                oEditText            = (EditText)(oForm.Items.Item("VID_FEPTCC").Specific);
                oEditText.DataBind.SetBound(true, "OVPM", "U_BPP_PTCC");
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            finally
            {
                if (oForm != null)
                {
                    oForm.Visible = true;
                    oForm.Freeze(false);
                }
            }


            return(Result);
        }//fin InitForm
Ejemplo n.º 60
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);

            // Program.objHrmsUI.ExecQuery("Update B1_SCHMDT set u_upd='Y' where isnull(u_upd,'N') = 'N'", "Finalizing temp");
            Program.objHrmsUI.ExecQuery("delete from [@B1_SCHMDT]  where isnull(u_upd,'N') = 'N'", "Finalizing temp");
            Program.objHrmsUI.ExecQuery("delete from [@B1_SCHMDY]  where isnull(u_upd,'N') = 'N'", "Finalizing temp");
            Program.objHrmsUI.ExecQuery("delete from [@B1_SO]  where isnull(u_upd,'N') = 'N'", "Finalizing temp");
            Program.objHrmsUI.ExecQuery("delete from [@B1_SCHOT]  where isnull(u_upd,'N') = 'N'", "Finalizing temp");


            cardCFL = (SAPbouiCOM.ChooseFromList)oForm.ChooseFromLists.Item("cflCRD");
            SAPbouiCOM.Conditions oCons = cardCFL.GetConditions();
            SAPbouiCOM.Condition  oCon  = oCons.Add();
            oCon.Alias     = "CardType";
            oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
            oCon.CondVal   = "C";
            cardCFL.SetConditions(oCons);

            dtHead = oForm.DataSources.DataTables.Item("dtHead");
            dtItem = oForm.DataSources.DataTables.Item("dtItem");
            dtDate = oForm.DataSources.DataTables.Item("dtDate");
            dtDays = oForm.DataSources.DataTables.Item("dtDays");
            dtOSCN = oForm.DataSources.DataTables.Item("dtOSCN");
            dtOT   = oForm.DataSources.DataTables.Item("dtOT");

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

            mtDate = (SAPbouiCOM.Matrix)oForm.Items.Item("mtDate").Specific;
            mtDay  = (SAPbouiCOM.Matrix)oForm.Items.Item("mtDays").Specific;
            mtOSCN = (SAPbouiCOM.Matrix)oForm.Items.Item("mtOSCN").Specific;
            mtOT   = (SAPbouiCOM.Matrix)oForm.Items.Item("mtOT").Specific;


            dtHead.Rows.Add(1);
            dtHead.SetValue("tsActive", 0, "Y");


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

            txICode  = (SAPbouiCOM.EditText)oForm.Items.Item("txICode").Specific;
            txOMDT   = (SAPbouiCOM.EditText)oForm.Items.Item("txOMDT").Specific;
            txOICODE = (SAPbouiCOM.EditText)oForm.Items.Item("txOICODE").Specific;
            imgImage = (SAPbouiCOM.PictureBox)oForm.Items.Item("imgImage").Specific;
            txSL     = (SAPbouiCOM.EditText)oForm.Items.Item("txSL").Specific;



            cbSP    = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbSP").Specific;
            cbDays  = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbDays").Specific;
            cbWeeks = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbWeeks").Specific;

            cbHH  = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbHH").Specific;
            cbMM  = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbMM").Specific;
            cbAP  = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbAP").Specific;
            cbEWN = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbEWN").Specific;

            cbOTHH = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbOTHH").Specific;
            cbOTMM = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbOTMM").Specific;
            cbOTAP = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbOTAP").Specific;



            opOD = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opOD").Specific;
            opOW = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opOW").Specific;
            opOM = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opOM").Specific;
            OMDY = (SAPbouiCOM.OptionBtn)oForm.Items.Item("OMDY").Specific;
            OMDT = (SAPbouiCOM.OptionBtn)oForm.Items.Item("OMDT").Specific;

            opOW.GroupWith("opOD");
            opOM.GroupWith("opOD");

            OMDY.GroupWith("OMDT");
            opOD.Selected = true;
            OMDT.Selected = true;
            tbSO          = (SAPbouiCOM.Folder)oForm.Items.Item("tbSO").Specific;
            tbTS          = (SAPbouiCOM.Folder)oForm.Items.Item("tbTS").Specific;

            tbTS.Select();
            fillCBs();
            oForm.Freeze(false);

            txCode.Active = true;
        }