Esempio n. 1
0
        /// <summary>
        /// Carga los valores del form desde el XML (SRF)
        /// </summary>
        private void CargarXML()
        {
            XmlDocument oXmlDoc = null;

            try
            {
                oXmlDoc = new XmlDocument();

                String xml = "";
                xml  = Application.StartupPath.ToString();
                xml += "\\";
                xml  = xml + "Formularios\\" + "FormNominas.srf";
                oXmlDoc.Load(xml);

                string sXML = oXmlDoc.InnerXml.ToString();
                Conexion_SBO.m_SBO_Appl.LoadBatchActions(ref sXML);
                Conexion_SBO.m_SBO_Appl.Forms.Item("SEI_NOM").Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE;
            }

            catch (Exception ex)
            {
                result = Msj_Appl.Errores(14, "CargarXML > SEI_FormNominas.cs " + ex.Message);
                Conexion_SBO.m_SBO_Appl.StatusBar.SetText(result.Mensaje, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// funcion carga el XML del formulario
        /// </summary>
        public static void CargarXML()
        {
            XmlDocument   oXmlDoc      = null;
            ResultMessage result       = new ResultMessage();
            bool          bFormAbierto = false;

            SAPbouiCOM.Form oForm = null;
            int             index;

            try
            {
                for (index = 0; index < Conexion_SBO.m_SBO_Appl.Forms.Count; index++)
                {
                    SAPbouiCOM.Form oFormAbierto = Conexion_SBO.m_SBO_Appl.Forms.Item(index);
                    if (oFormAbierto.UniqueID.Equals("SET_VAL"))
                    {
                        bFormAbierto = true;
                        break;
                    }
                }

                // Si el form no esta abierto se abre
                if (!bFormAbierto)
                {
                    oXmlDoc = new XmlDocument();

                    String xml = "";
                    xml  = Application.StartupPath.ToString();
                    xml += "\\";
                    xml  = xml + "Formularios\\" + "FormSeting.srf";
                    oXmlDoc.Load(xml);

                    String sXML = oXmlDoc.InnerXml.ToString();
                    SAPbouiCOM.FormCreationParams creationPackage = null;
                    creationPackage          = (SAPbouiCOM.FormCreationParams)Conexion_SBO.m_SBO_Appl.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams);
                    creationPackage.UniqueID = "SET_VAL";
                    creationPackage.FormType = "SET_VAL";
                    creationPackage.Modality = SAPbouiCOM.BoFormModality.fm_Modal;
                    creationPackage.XmlData  = sXML;
                    oForm         = Conexion_SBO.m_SBO_Appl.Forms.AddEx(creationPackage);
                    oForm.Visible = true;

                    //bool check = ((SAPbouiCOM.CheckBox)(oForm.Items.Item("Item_0").Specific)).Checked;



                    LoadInfo(oForm);
                }
                // Si no traer al frente
                else
                {
                    Conexion_SBO.m_SBO_Appl.Forms.Item(index).Select();
                }
            }
            catch (Exception ex)
            {
                result = Msj_Appl.Errores(14, "CargarXML > SEI_FormSetVal.cs " + ex.Message);
                Conexion_SBO.m_SBO_Appl.StatusBar.SetText(result.Mensaje, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Interviene los eventos de los item del form.
        /// </summary>
        public static void m_SBO_Appl_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            SAPbouiCOM.Form oForm = Conexion_SBO.m_SBO_Appl.Forms.Item(FormUID);
            ResultMessage   rslt  = new ResultMessage();

            try
            {
                if (pVal.BeforeAction && pVal.EventType.Equals(SAPbouiCOM.BoEventTypes.et_CLICK) && pVal.ItemUID.Equals("bt_chk"))
                {
                    EjecutarChecking(oForm);
                }
                if (pVal.BeforeAction && pVal.EventType.Equals(SAPbouiCOM.BoEventTypes.et_CLICK) && pVal.ItemUID.Equals("bt_SLR"))
                {
                    //AsignadosHec.ListaAsignacionHec.Clear();
                    oForm.Close();
                }
                if (pVal.BeforeAction && pVal.EventType.Equals(SAPbouiCOM.BoEventTypes.et_CLICK) && pVal.ItemUID.Equals("bt_ASG"))
                {
                    rslt = ValidarDatosAsignados(oForm);

                    if (rslt.Success)
                    {
                        //rslt = AsignarDatos(oForm);
                        if (rslt.Success)
                        {
                            oForm.Close();
                            Conexion_SBO.m_SBO_Appl.StatusBar.SetText(rslt.Mensaje, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success);
                        }
                        else
                        {
                            BubbleEvent = false;
                            Conexion_SBO.m_SBO_Appl.StatusBar.SetText(rslt.Mensaje, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning);
                        }
                    }
                    else
                    {
                        BubbleEvent = false;
                        Conexion_SBO.m_SBO_Appl.StatusBar.SetText(rslt.Mensaje, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning);
                    }
                }
                if (pVal.BeforeAction && pVal.EventType.Equals(SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) && pVal.ItemUID.Equals("matrixVar") && pVal.ColUID.Equals("co_Chk"))
                {
                    DataBindCuarteles(oForm);
                }
                if (pVal.BeforeAction && pVal.EventType.Equals(SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) && pVal.ItemUID.Equals("matrixCrt") && pVal.ColUID.Equals("co_Chk"))
                {
                    SetButtonCheckCuarteles(oForm);
                }
            }
            catch (Exception ex)
            {
                Msj_Appl.Errores(14, "m_SBO_Appl_ItemEvent() > SEI_FormINGMH.cs " + ex.Message);
                Conexion_SBO.m_SBO_Appl.StatusBar.SetText("m_SBO_Appl_ItemEvent() > SEI_FormINGMH.cs " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Carga el formulario de ingreso múltiple a traves de su XML
        /// </summary>
        public static void CargarXML()
        {
            XmlDocument   oXmlDoc      = null;
            ResultMessage result       = new ResultMessage();
            Boolean       bFormAbierto = false;
            Int32         index;

            try
            {
                for (index = 0; index < Conexion_SBO.m_SBO_Appl.Forms.Count; index++)
                {
                    SAPbouiCOM.Form oFormAbierto = Conexion_SBO.m_SBO_Appl.Forms.Item(index);
                    if (oFormAbierto.UniqueID.Equals("SEI_INGMH"))
                    {
                        bFormAbierto = true;
                        break;
                    }
                }

                // Si el form no esta abierto se abre
                if (!bFormAbierto)
                {
                    oXmlDoc = new XmlDocument();

                    String xml = "";
                    xml  = Application.StartupPath.ToString();
                    xml += "\\";
                    xml  = xml + "Formularios\\" + "FormIngMultipleHec.srf";
                    oXmlDoc.Load(xml);

                    String sXML = oXmlDoc.InnerXml.ToString();
                    Conexion_SBO.m_SBO_Appl.LoadBatchActions(ref sXML);
                }
                // Si no traer al frente
                else
                {
                    Conexion_SBO.m_SBO_Appl.Forms.Item(index).Select();
                }
            }
            catch (Exception ex)
            {
                result = Msj_Appl.Errores(14, "CargarXML > SEI_FormINGMH.cs " + ex.Message);
                Conexion_SBO.m_SBO_Appl.StatusBar.SetText(result.Mensaje, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
        }