예제 #1
0
        /// <summary>
        /// Checkea y descheckea todas las columnas de la matrix variedades
        /// </summary>
        public static void EjecutarChecking(SAPbouiCOM.Form oForm)
        {
            SAPbouiCOM.Button oButton    = oForm.Items.Item("bt_chk").Specific;
            SAPbouiCOM.Matrix oMatrix    = oForm.Items.Item("matrixVar").Specific;
            SAPbouiCOM.Matrix oMatrixCrt = oForm.Items.Item("matrixCrt").Specific;

            oForm.Freeze(true);

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

            oForm.Freeze(false);
        }
예제 #2
0
        //public static klib.Values GetKeyValue(ref SAPbouiCOM.Form Form)
        //{

        //    // TODO : Chenge to read in xml
        //    //var xmlstring = Form.BusinessObject.Key;
        //    //var xml = new klib.xml.Read(xmlstring);



        //    var repository = new Repositories.SAPTableRepository();
        //    var sapTables = repository.GetByForm(Form);

        //    if (sapTables._IsNull || String.IsNullOrEmpty(sapTables.LogTable))
        //        return Values.Null;
        //    else
        //        return GetValue(ref Form, sapTables.Table, sapTables.PrKey);//SF.UIHelper.Form.GetValue(ref Form, sapTables.FormFiKey);
        //}

        /// <summary>
        /// The method will try to get the key in the form.
        /// Case is not possible, it will return null;
        /// </summary>
        /// <param name="FormUID"></param>
        /// <returns></returns>
        //public static string TryGetKeyValue(string FormUID)
        //{
        //    try
        //    {
        //        var oForm = SF.Conn.UI.Forms.GetForm(FormUID, 0);
        //        return GetKeyValue(ref oForm).ToString();
        //    }
        //    catch
        //    {
        //        return null;
        //    }

        //}
        #endregion
        #region setters
        //public static DIHelper.Models.UDSources SetUDValues<T>(ref SAPbouiCOM.Form Form, T values) where T : DIHelper.Models.UDSources
        //{

        //    var propertiesInfo = typeof(T).GetProperties();

        //    foreach (var property in propertiesInfo)
        //    {
        //        try
        //        {
        //            var value = SF.UIHelper.Form.GetUDSValue(ref Form, property.Name);

        //            Type type = values.GetType();
        //            PropertyInfo pi = type.GetProperty(property.Name);
        //            SF.UIHelper.Form.SetDSValue(ref Form, property.Name, pi.GetValue(values));
        //        }
        //        catch
        //        {

        //        }
        //    }

        //    return values;

        //}

        public static void SetValue(ref SAPbouiCOM.Form Form, string uid, object value)
        {
            Form.Freeze(true);

            try
            {
                var oItem = Form.Items.Item(uid);

                bool enabled = Form.Items.Item(uid).Enabled;
                value = String.IsNullOrEmpty(value.ToString()) ? "" : value;

                oItem.Enabled = true;

                switch (oItem.Type)
                {
                case SAPbouiCOM.BoFormItemTypes.it_EDIT:
                case SAPbouiCOM.BoFormItemTypes.it_EXTEDIT:
                    ((SAPbouiCOM.EditText)oItem.Specific).Value = value.ToString(); break;

                case SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX:
                    ((SAPbouiCOM.ComboBox)oItem.Specific).Select(value.ToString(), SAPbouiCOM.BoSearchKey.psk_ByValue); break;

                default:
                    throw new SUIException(1, $"The item {oItem.UniqueID} not exist."); break;
                }

                oItem.Enabled = enabled;
            }
            finally
            {
                Form.Freeze(false);
            }
        }
예제 #3
0
        /// <summary>
        /// Injects the Bonus to the SAP Form.
        /// </summary>
        private void AddBonusButton()
        {
            string lStrCopyId = "10000330";

            mFrmInvoice.Freeze(true);
            try
            {
                if (mItmBtnBonus == null)
                {
                    mItmBtnBonus        = mFrmInvoice.Items.Add("btnBonus", SAPbouiCOM.BoFormItemTypes.it_BUTTON);
                    mItmBtnBonus.Top    = mFrmInvoice.Items.Item(lStrCopyId).Top;
                    mItmBtnBonus.Left   = mFrmInvoice.Items.Item(lStrCopyId).Left - 150;
                    mItmBtnBonus.Width  = 150;
                    mItmBtnBonus.LinkTo = lStrCopyId;
                    (mItmBtnBonus.Specific as SAPbouiCOM.Button).Caption      = "Devolución/Bonificación";
                    (mItmBtnBonus.Specific as SAPbouiCOM.Button).ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.mItmBtnBonus_ClickBefore);
                }
            }
            catch (Exception lObjException)
            {
                LogUtility.WriteError(string.Format("[BonusModal - AddBonusButton] Error al agregar el botón de Bonificacion: {0}", lObjException.Message));
                UIApplication.ShowMessageBox(string.Format("Error al agregar el botón de Bonificación: {0}", lObjException.Message));
            }
            finally
            {
                mFrmInvoice.Freeze(false);
            }
        }
예제 #4
0
 private void GetCodeFormatterString(int Row)
 {
     SAPbouiCOM.Form oForm = default(SAPbouiCOM.Form);
     try
     {
         oForm = this.CurrentForm;
         oForm.Freeze(true);
         SAPbouiCOM.Grid oGridScheme = oForm.Items.Item(GRID_SCHEME).Specific;
         IList <Scheme>  schemes = Scheme;
         string          formatterString = default(string), temp = default(string);
         if (schemes != null)
         {
             oGridScheme.DataTable.Rows.Offset = Row;
             foreach (var item in schemes)
             {
                 temp             = Convert.ToString(oGridScheme.DataTable.GetValue(item.RuleSchmsID, oGridScheme.DataTable.Rows.Offset));
                 temp             = item.Padding ? temp.PadLeft(item.RuleSchmsLen, Convert.ToChar(item.PadString)) : temp;
                 formatterString += temp;
             }
         }
         oForm.DataSources.UserDataSources.Item(UDS_FORMAT).Value = formatterString;
     }
     catch (Exception ex) { throw ex; }
     finally { oForm.Freeze(false); }
 }
예제 #5
0
        private void LoadSchemeCodes()
        {
            SAPbouiCOM.Form oForm = default(SAPbouiCOM.Form);
            try
            {
                oForm = this.CurrentForm;
                oForm.Freeze(true);
                SAPbobsCOM.Recordset oRs  = SBOCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
                string sql_GetSchemeCodes = @"select * from ""@AVA_FM_OCRS"" where ""U_Active"" = N'Y' ";
                oRs.DoQuery(sql_GetSchemeCodes);
                SAPbouiCOM.ComboBox cbxSchemes = oForm.Items.Item(CBX_SCHEMECODE).Specific;
                while (cbxSchemes.ValidValues.Count > 0)
                {
                    cbxSchemes.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index);
                }
                for (int iRSRowCounter = 0; iRSRowCounter < oRs.RecordCount; iRSRowCounter++)
                {
                    cbxSchemes.ValidValues.Add(oRs.Fields.Item("Code").Value, oRs.Fields.Item("Name").Value);
                    oRs.MoveNext();
                }
                if (cbxSchemes.ValidValues.Count > 0)
                {
                    cbxSchemes.Select(0, SAPbouiCOM.BoSearchKey.psk_Index);
                    LoadScheme(cbxSchemes.Selected.Value);
                }
            }
            catch (Exception ex) { throw ex; }
            finally { oForm.Freeze(false); }

            #endregion
        }
예제 #6
0
        private void cambiarHabilitacionCeldas(bool mostrar)
        {
            try
            {
                mForm.Freeze(true);

                for (int i = 0; i < mtxDet.DataTable.Rows.Count; i++)
                {
                    mtxDet.CommonSetting.SetCellEditable(i + 1, 3, mostrar);
                    mtxDet.CommonSetting.SetCellEditable(i + 1, 4, mostrar);
                    mtxDet.CommonSetting.SetCellEditable(i + 1, 5, mostrar);
                    mtxDet.CommonSetting.SetCellEditable(i + 1, 6, mostrar);
                    mtxDet.CommonSetting.SetCellEditable(i + 1, 7, mostrar);
                    mtxDet.CommonSetting.SetCellEditable(i + 1, 8, mostrar);
                }
            }
            catch (Exception ex)
            {
                StatusMessageError("cambiarHabilitacionCeldas() > " + ex.Message);
            }
            finally
            {
                mForm.Freeze(false);
            }
        }
예제 #7
0
        /// <summary>
        /// Injects the comission button in the form
        /// </summary>
        private void AddComissionButton()
        {
            string lStrMatrixId = "38";
            string lStrTotalId  = "29";

            try
            {
                mObjForm.Freeze(true);
                if (mItmBtnCard == null)
                {
                    mItmBtnCard          = mObjForm.Items.Add("btnBnk", SAPbouiCOM.BoFormItemTypes.it_BUTTON);
                    mItmBtnCard.Top      = mObjForm.Items.Item(lStrMatrixId).Top + 168;
                    mItmBtnCard.Left     = mObjForm.Items.Item(lStrMatrixId).Left;
                    mItmBtnCard.FromPane = 1;
                    mItmBtnCard.ToPane   = 1;
                    mItmBtnCard.Width    = 145;
                    (mItmBtnCard.Specific as SAPbouiCOM.Button).Caption      = "Comisión por pago con tarjeta";
                    (mItmBtnCard.Specific as SAPbouiCOM.Button).ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.mItmBtnCard_ClickBefore);
                }
                mEdtTotal = (mObjForm.Items.Item(lStrTotalId).Specific as SAPbouiCOM.EditText);
                mMtxLines = (mObjForm.Items.Item(lStrMatrixId).Specific as SAPbouiCOM.Matrix);
            }
            finally
            {
                mObjForm.Freeze(false);
            }
        }
예제 #8
0
    private void HandleExportSOSelectAll(SAPbouiCOM.Form form, String MatxStr, SAPbouiCOM.DataTable oDataTable)
    {
        bool flgChange = false;

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

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

                //    oMatrixBpExport.FlushToDataSource();
            }
        }
        catch (Exception ex)
        {
            errorLog(ex.Message);
        }
    }
예제 #9
0
 /// <summary>
 /// Method initFormXml
 /// Initialize modal form
 /// </summary>
 /// <remarks>@author RCordova-2017/08/15</remarks>
 private void InitFormXml()
 {
     mObjModalForm.Freeze(true);
     SetItems();
     ConfigForm();
     SetValues();
     mObjModalForm.Freeze(false);
 }
예제 #10
0
 private void InitializeXmlForm()
 {
     lObjModalForm.Freeze(true);
     SetItems();
     InitializeEvents();
     InitialForm();
     lObjModalForm.Freeze(false);
 }
예제 #11
0
파일: mfrmCFL.cs 프로젝트: radtek/UGRS_Full
        private void InitializeXmlForm()
        {
            lObjCFLModalForm.Freeze(true);
            SetItems();
            InitializeEvents();
            SelectMtxDataSource();

            lObjCFLModalForm.Freeze(false);
        }
예제 #12
0
        private void OutgoingPayments(string pStrBP, string pStrAuction)
        {
            initOutgoingPayments();

            mObjPayRForm.Freeze(true);
            mObjOptB.Item.Click();
            mObjtxtCardCode.Value = pStrBP;
            mObjcbAuxType.Select(1, SAPbouiCOM.BoSearchKey.psk_Index);
            mObjtxtAuctNum.Value = pStrAuction;
            mObjPayRForm.Freeze(false);
        }
예제 #13
0
        private static void LoadInfo(SAPbouiCOM.Form oForm)
        {
            SAPbobsCOM.Recordset oRecordset = null;
            SAPbouiCOM.Matrix    oMatrix    = null;
            SAPbouiCOM.Matrix    oMatrixMm  = null;

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

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

                    oMatrixMm.AddRow();
                    ((SAPbouiCOM.EditText)(oMatrixMm.Columns.Item("Col_0").Cells.Item(1).Specific)).Value = "0";
                    ((SAPbouiCOM.EditText)(oMatrixMm.Columns.Item("Col_1").Cells.Item(1).Specific)).Value = "0";
                }
                //oForm.Items.Item("Mtx1").Visible = false;
                oForm.Freeze(false);
            }
            catch (Exception ex)
            {
                oForm.Freeze(false);
            }
        }
 private void Form_DataUpdateAfter(ref SAPbouiCOM.BusinessObjectInfo pVal)
 {
     try
     {
         oForm.Freeze(true);
         Matrix0.Columns.Item("Col_2").Editable = false;
         LoadDataMatrix();
     }
     catch (Exception) { }
     finally { oForm.Freeze(false); }
 }
예제 #15
0
 private void LoadScheme(string SchemeCode)
 {
     SAPbouiCOM.Form oForm = default(SAPbouiCOM.Form);
     try
     {
         oForm = this.CurrentForm;
         oForm.Freeze(true);
         SAPbouiCOM.Grid oGrid = oForm.Items.Item(GRID_SCHEME).Specific;
         oGrid.DataTable.Clear();
         SAPbobsCOM.Recordset oRs = SBOCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
         string sql_GetScheme     = @"select * from ""@AVA_FM_CRS1"" where ""Code"" = N'{0}'";
         sql_GetScheme = string.Format(sql_GetScheme, SchemeCode);
         oRs.DoQuery(sql_GetScheme);
         if (oRs.RecordCount > 0)
         {
             IList <Scheme> schemes = new List <Scheme>();
             Scheme         temp    = default(Scheme);
             for (int iRSRowCounter = 0; iRSRowCounter < oRs.RecordCount; iRSRowCounter++)
             {
                 temp = new Scheme(oRs.Fields.Item("U_RuleSchmsID").Value,
                                   oRs.Fields.Item("U_RuleSchmsDesc").Value,
                                   oRs.Fields.Item("U_RuleSchmsType").Value,
                                   oRs.Fields.Item("U_RuleSchmsLen").Value,
                                   oRs.Fields.Item("U_RuleSchmsDefault").Value,
                                   oRs.Fields.Item("U_Padding").Value == "Y" ? true : false,
                                   oRs.Fields.Item("U_PadString").Value);
                 oGrid.DataTable.Columns.Add(oRs.Fields.Item("U_RuleSchmsID").Value,
                                             oRs.Fields.Item("U_RuleSchmsType").Value == "I" ? SAPbouiCOM.BoFieldsType.ft_Integer : SAPbouiCOM.BoFieldsType.ft_AlphaNumeric,
                                             oRs.Fields.Item("U_RuleSchmsLen").Value);
                 oGrid.Columns.Item(oRs.Fields.Item("U_RuleSchmsID").Value).TitleObject.Caption = oRs.Fields.Item("U_RuleSchmsDesc").Value;
                 schemes.Add(temp);
                 oRs.MoveNext();
             }
             Scheme = schemes;
             oGrid.DataTable.Rows.Add();
             foreach (var item in schemes)
             {
                 if (string.IsNullOrEmpty(item.RuleSchmsDefault))
                 {
                     continue;
                 }
                 else if (item.RuleSchmsDefault.ToUpper().Equals("NULL"))
                 {
                     continue;
                 }
                 oGrid.DataTable.SetValue(item.RuleSchmsID, oGrid.DataTable.Rows.Offset, item.RuleSchmsDefault);
             }
             oGrid.RowHeaders.Width = 20;
         }
     }
     catch (Exception ex) { throw ex; }
     finally { oForm.Freeze(false); }
 }
예제 #16
0
        private void InitForm()
        {
            _oForm.Freeze(true);
            try
            {
                _oForm.DataSources.UserDataSources.Item("txtPSTDT").ValueEx = DateTime.Now.ToString("yyyyMMdd");
                //_oForm.DataSources.UserDataSources.Item("txtDUEDT").ValueEx = DateTime.Now.ToString("yyyyMMdd");
                _oForm.DataSources.UserDataSources.Item("txtDOCDT").ValueEx = DateTime.Now.ToString("yyyyMMdd");

                _grid_Vendor.DataTable = _dt_VendorGrid;

                SAPbouiCOM.ChooseFromList oCFL  = _oForm.ChooseFromLists.Item("cflVendor");
                SAPbouiCOM.Conditions     oCons = oCFL.GetConditions();
                SAPbouiCOM.Condition      oCon  = oCons.Add();
                oCon.Alias     = "CardType";
                oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                oCon.CondVal   = "S";

                oCFL.SetConditions(oCons);
            }
            catch (Exception Ex)
            {
                eCommon.SBO_Application.MessageBox(Ex.Message);
            }
            finally
            {
                _oForm.Freeze(false);
            }
        }
        private static void Cargar_Datos_Matrix()
        {
            try
            {
                //oForm = Application.SBO_Application.Forms.ActiveForm;
                oDTTable = oForm.DataSources.DataTables.Item("DT_SQL1");
                SAPbouiCOM.DBDataSource source = oForm.DataSources.DBDataSources.Item("@ZDFER");

                oForm.Freeze(true);

                string sql = "SELECT * FROM [@ZDFER] ORDER BY U_Fecha";

                oDTTable.ExecuteQuery(sql);

                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("3").Specific;
                oMatrix.FlushToDataSource();
                source.Clear();
                oMatrix.Clear();

                for (int i = 0; i < oDTTable.Rows.Count; i++)
                {
                    source.InsertRecord(source.Size);
                    source.Offset = source.Size - 1;
                    source.SetValue("Code", source.Size - 1, Convert.ToString(oDTTable.GetValue("Code", i)));
                    //DateTime fecha = (DateTime)oDTTable.GetValue("U_Fecha", i);
                    source.SetValue("U_Fecha", source.Size - 1, Convert.ToDateTime(oDTTable.GetValue("U_Fecha", i)).ToString("yyyyMMdd"));
                    source.SetValue("U_Descripcion", source.Size - 1, Convert.ToString(oDTTable.GetValue("U_Descripcion", i)));
                    source.SetValue("DocEntry", source.Size - 1, Convert.ToString(oDTTable.GetValue("DocEntry", i)));
                }

                sql = "SELECT MAX(CAST(Code as int)) + 1 as Proximo FROM [@ZDFER]";
                oDTTable.ExecuteQuery(sql);

                source.InsertRecord(source.Size);
                source.Offset = source.Size - 1;
                source.SetValue("Code", source.Size - 1, Convert.ToString(oDTTable.GetValue("Proximo", 0)));
                source.SetValue("DocEntry", source.Size - 1, Convert.ToString(oDTTable.GetValue("Proximo", 0)));

                oMatrix.LoadFromDataSource();
                oMatrix.AutoResizeColumns();
            }
            catch (Exception)
            {
            }
            finally
            {
                oForm.Freeze(false);
            }
        }
예제 #18
0
 private void InitForm()
 {
     _oForm.Freeze(true);
     try
     {
     }
     catch (Exception Ex)
     {
         eCommon.SBO_Application.MessageBox(Ex.Message);
     }
     finally
     {
         _oForm.Freeze(false);
     }
 }
 private void CreatePendEmail()
 {
     try
     {
         SendPendingEmailflgDocInitiallization = false;
         AddXMLForm("Presentation_Layer.SendPendingEmail.xml");
         FormSendPendingEmail.Freeze(true);
         SendPendingEmailInit();
         FormSendPendingEmail.Freeze(false);
         flStatePendEmail = true;
     }
     catch (Exception ex)
     {
         errorLog(ex);
     }
 }
 private void CreateExportItem()
 {
     try
     {
         ItemExportflgDocInitiallization = false;
         AddXMLForm("Presentation_Layer.ExportItem.xml");
         theExportItemForm.Freeze(true);
         InitializeFormExportItem();
         theExportItemForm.Freeze(false);
         flStateExportItem = true;
     }
     catch (Exception ex)
     {
         errorLog(ex);
     }
 }
예제 #21
0
 private void InitForm()
 {
     _oForm.Freeze(true);
     try
     {
         _grid_Inv.DataTable = _dt_grid_Inv;
     }
     catch (Exception Ex)
     {
         eCommon.SBO_Application.MessageBox(Ex.Message);
     }
     finally
     {
         _oForm.Freeze(false);
     }
 }
 private void CreateRecPay()
 {
     try
     {
         flgDocInitRecPay = false;
         AddXMLForm("Presentation_Layer.SendReceivedEmail.xml");
         FormRecPay.Freeze(true);
         RecPayInit();
         FormRecPay.Freeze(false);
         FlgdtRecPay = true;
     }
     catch (Exception ex)
     {
         errorLog(ex);
     }
 }
예제 #23
0
        private static void CopyInfo(SAPbouiCOM.Form oForm)
        {
            string sDescripcion = null;
            string sCuenta      = null;
            string sDim1        = null;
            string sDim2        = null;
            string sDim3        = null;
            string sDim4        = null;
            string sDim5        = null;

            SAPbouiCOM.Matrix oMatrix = null;
            try
            {
                oMatrix = oForm.Items.Item("MatrixIM").Specific;
                oForm.Freeze(true);
                for (int i = 1; i <= oMatrix.RowCount; i++)
                {
                    if (i == 1)
                    {
                        sDescripcion = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Col_0").Cells.Item(i).Specific).Value;
                        sCuenta      = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Col_1").Cells.Item(i).Specific).Value;
                        sDim1        = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Col_2").Cells.Item(i).Specific).Value;
                        sDim2        = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Col_3").Cells.Item(i).Specific).Value;
                        sDim3        = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Col_4").Cells.Item(i).Specific).Value;
                        sDim4        = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Col_5").Cells.Item(i).Specific).Value;
                        sDim5        = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Col_6").Cells.Item(i).Specific).Value;
                    }
                    else
                    {
                        ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Col_0").Cells.Item(i).Specific).Value = sDescripcion;
                        ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Col_1").Cells.Item(i).Specific).Value = sCuenta;
                        ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Col_2").Cells.Item(i).Specific).Value = sDim1;
                        ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Col_3").Cells.Item(i).Specific).Value = sDim2;
                        ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Col_4").Cells.Item(i).Specific).Value = sDim3;
                        ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Col_5").Cells.Item(i).Specific).Value = sDim4;
                        ((SAPbouiCOM.EditText)oMatrix.Columns.Item("Col_6").Cells.Item(i).Specific).Value = sDim5;
                    }
                }


                oForm.Freeze(false);
            }
            catch (Exception ex)
            {
                oForm.Freeze(false);
            }
        }
예제 #24
0
        private void cargarRuta()
        {
            String fechaD, fechaH;

            try
            {
                oForm.Freeze(true);

                if (CBoxtpoRuta.ValidValues.Count > 0)
                {
                    for (int i = CBoxtpoRuta.ValidValues.Count - 1; i >= 0; i--)
                    {
                        CBoxtpoRuta.ValidValues.Remove(i, SAPbouiCOM.BoSearchKey.psk_Index);
                    }
                }

                fechaD = ((System.String)((SAPbouiCOM.EditText)oForm.Items.Item("FechaD").Specific).Value);
                fechaH = ((System.String)((SAPbouiCOM.EditText)oForm.Items.Item("FechaH").Specific).Value);

                s = @"SELECT T0.""U_RUTA"" ""Code"" , T0.""U_RUTA"" ""Name""
                        FROM ""ORDR"" T0
                        WHERE T0.""U_RUTA"" IS NOT NULL
                        AND T0.""DocDueDate"" BETWEEN '{0}' AND  '{1}'
                        GROUP BY T0.""U_RUTA""
                        ORDER BY T0.""U_RUTA""";
                s = String.Format(s, fechaD, fechaH);

                oRecordSet.DoQuery(s);
                oRecordSet.MoveFirst();

                int a = oRecordSet.RecordCount;

                while (!oRecordSet.EoF)
                {
                    string code = (String)(oRecordSet.Fields.Item("Code").Value);
                    string name = (String)(oRecordSet.Fields.Item("Name").Value);
                    CBoxtpoRuta.ValidValues.Add(code, name);
                    oRecordSet.MoveNext();

                    ;
                }
                if (CBoxtpoRuta.ValidValues.Count > 0)
                {
                    CBoxtpoRuta.ValidValues.Add("Todos", "Todos");
                    //oRecordSet.MoveNext();
                }
            }
            catch (Exception e)
            {
                Application.SBO_Application.StatusBar.SetText(e.Message + " ** Trace: " + e.StackTrace, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                log.AddLog(e.Message + " ** Trace: ");
            }
            finally
            {
                oForm.Freeze(false);
            }
        }
 internal void ActivateForm(SAPbouiCOM.Form f, string defaultBrowser)
 {
     f.Freeze(true);
     f.EnableMenu("1288", true);
     f.EnableMenu("1289", true);
     f.EnableMenu("1290", true);
     f.EnableMenu("1291", true);
     f.EnableMenu("1292", false);
     f.EnableMenu("1293", false);
     f.EnableMenu("6913", false);
     f.EnableMenu("1283", false);
     f.Freeze(false);
     f.Update();
     //f.DefButton = "1";
     f.DataBrowser.BrowseBy = defaultBrowser;
     f.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE;
 }
예제 #26
0
    public void SBO_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
    {
        BubbleEvent = true;

        //cfl
        SubMain.GetCFL_EDIT(FormUID, ref pVal, out BubbleEvent, "txCardCode", "cfl2");
        SubMain.GetCFL_EDIT(FormUID, ref pVal, out BubbleEvent, "txEntry", "cfl17");


        if (pVal.Before_Action == false)
        {
            return;
        }

        try
        {
            if (FormUID == FUID)
            {
                if (pVal.ItemUID == "10")
                {
                    if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_CLICK)
                    {
                        try
                        {
                            f17.Freeze(true);
                            string cmd = GetCmd();
                            oDT.ExecuteQuery(cmd);
                            InitGridCol();
                        }
                        catch (Exception ex)
                        {
                        }
                        finally
                        {
                            f17.Freeze(false);
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
            SubMain.SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");
        }
    }
예제 #27
0
 private void InitForm()
 {
     _oForm.Freeze(true);
     try
     {
         _txtPath.Value = SBOAddon_DB.Settings_xml_Path;
         _cbPO.Checked  = SBOAddon_DB.Settings_Save_PO_Draft;
         _cbSO.Checked  = SBOAddon_DB.Settings_Save_SO_Draft;
     }
     catch (Exception Ex)
     {
         eCommon.SBO_Application.MessageBox(Ex.Message);
     }
     finally
     {
         _oForm.Freeze(false);
     }
 }
예제 #28
0
        private void ReadFileTxt_Banamex(string pStrPath)
        {
            mObjForm.Freeze(true);
            string[] ArrStrWords;
            mIntCountCarga = 0;
            mIntTotalCarga = 0;

            try
            {
                ArrStrWords     = System.IO.File.ReadAllLines(pStrPath);
                mObjProgressBar = new ProgressBarManager(Application.SBO_Application, "Cargando extractos bancarios", ArrStrWords.Length);
                foreach (ExtractBanking lObjlObjExtractBanking in GetBanamexExtractBanking(ArrStrWords))
                {
                    mObjBankPage = PopulateBankPages(lObjlObjExtractBanking);
                    int result = mObjBankPage.Add();
                    mIntTotalCarga++;
                    if (result == 0)
                    {
                        mIntCountCarga++;
                    }
                    if (result != 0)
                    {
                        string r = mObjCompany.GetLastErrorDescription();
                        //Application.SBO_Application.MessageBox("No se cargo el movimiento número: " + mIntTotalCarga);
                        Application.SBO_Application.StatusBar.SetText("No se cargo el movimiento número: " + mIntTotalCarga, SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    }
                    mObjProgressBar.NextPosition();
                }
                ((SAPbouiCOM.EditText)mObjForm.Items.Item("18").Specific).Value = "";
                ((SAPbouiCOM.EditText)mObjForm.Items.Item("18").Specific).Value = lStrAccountCode;
            }
            catch (Exception ex)
            {
                Application.SBO_Application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                BankStatementsLogService.WriteError(ex.Message);
            }
            finally
            {
                mObjForm.Freeze(false);
                MemoryUtility.ReleaseComObject(mObjBankPage);
            }
            Application.SBO_Application.MessageBox("Proceso Terminado. Se cargaron " + mIntCountCarga + " de " + mIntTotalCarga + " movimientos bancarios.");
        }
예제 #29
0
 private void FormFreeze(SAPbouiCOM.Form form, bool bFreeze)
 {
     try
     {
         if (form != null)
         {
             form.Freeze(bFreeze);
         }
     }
     catch (Exception) { }
 }
예제 #30
0
        public static void LinkedObjectForm(string FormUniqueID, string ActivateMenuItem, string FindItemUID, string FindItemUIDValue)
        {
            try
            {
                SAPbouiCOM.Form      oForm     = null;
                SAPbouiCOM.IEditText oEditText = null;
                bool Bool = false;

                //For frm As Integer = 0 To Application.SBO_Application.Forms.Count - 1
                // Dim sCad As String = Application.SBO_Application.Forms.Item(frm).UniqueID
                // If Application.SBO_Application.Forms.Item(frm). = FormUniqueID Then
                // 'Application.SBO_Application.Forms.Item(pVal.FormUID)
                // oForm = Application.SBO_Application.Forms.Item(FormUniqueID)
                // oForm.Close()

                // Exit For

                // End If

                //Next


                if (Bool == false)
                {
                    Application.SBO_Application.ActivateMenuItem(ActivateMenuItem);

                    Application.SBO_Application.Forms.ActiveForm.Freeze(true);

                    oForm = Application.SBO_Application.Forms.ActiveForm;

                    oForm.Select();

                    oForm.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE;

                    oForm.Items.Item(FindItemUID).Enabled = true;

                    oEditText       = (SAPbouiCOM.IEditText)oForm.Items.Item(FindItemUID).Specific;
                    oEditText.Value = FindItemUIDValue.Trim();

                    oForm.Items.Item("1").Click();

                    oForm.Freeze(false);
                }
            }
            catch (Exception)
            {
                Application.SBO_Application.MessageBox(oCompany.GetLastErrorDescription());
            }
            finally
            {
            }
        }