Esempio n. 1
0
        private void AddChooseFromListStockTransfer()
        {
            oForm.DataSources.UserDataSources.Add("CFL_1", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 254);
            SAPbouiCOM.ChooseFromListCollection     oCFLs = oForm.ChooseFromLists;
            SAPbouiCOM.ChooseFromListCreationParams lObjCFLCreationParams = null;
            lObjCFLCreationParams = (SAPbouiCOM.ChooseFromListCreationParams)SAPbouiCOM.Framework.Application.SBO_Application.CreateObject
                                        (SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams);

            //  Adding 2 CFL, one for the button and one for the edit text.
            //string strCFLID = oCFLCreationParams.UniqueID
            lObjCFLCreationParams.MultiSelection = false;
            lObjCFLCreationParams.ObjectType     = "1250000001";
            lObjCFLCreationParams.UniqueID       = "CFLDOC";
            mObjChooseFromList = oCFLs.Add(lObjCFLCreationParams);
            oCons = mObjChooseFromList.GetConditions();

            oCon           = oCons.Add();
            oCon.Alias     = "DocStatus";
            oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
            oCon.CondVal   = "O";

            mObjChooseFromList.SetConditions(oCons);

            EditText1.DataBind.SetBound(true, "", "CFL_1");
            EditText1.ChooseFromListUID   = mObjChooseFromList.UniqueID;
            EditText1.ChooseFromListAlias = "DocNum";
        }
        private void AddChooseFromList()
        {
            SAPbouiCOM.ChooseFromListCollection oCFls = null;

            SAPbouiCOM.Conditions oCons = null;
            SAPbouiCOM.Condition  oCon  = null;

            oCFls = oForm.ChooseFromLists;
            SAPbouiCOM.ChooseFromList oCFl = null;
            SAPbouiCOM.ChooseFromListCreationParams oCFLCreationParams = null;
            oCFLCreationParams = ((SAPbouiCOM.ChooseFromListCreationParams)(oApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)));

            oCFLCreationParams.MultiSelection = false;
            oCFLCreationParams.ObjectType     = "2";
            oCFLCreationParams.UniqueID       = "CFL1";

            oCFl = oCFls.Add(oCFLCreationParams);

            oCons = oCFl.GetConditions();

            oCon           = oCons.Add();
            oCon.Alias     = "CardType";
            oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
            oCon.CondVal   = "C";

            oCFl.SetConditions(oCons);

            oCFLCreationParams.MultiSelection = false;
            oCFLCreationParams.ObjectType     = "2";
            oCFLCreationParams.UniqueID       = "CFL2";
            oCFl = oCFls.Add(oCFLCreationParams);
        }
Esempio n. 3
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);
            }
        }
Esempio n. 4
0
        public void getDataFromDataSource()
        {
            SAPbouiCOM.Matrix     oMatrix;
            SAPbouiCOM.Conditions oCons = null;
            SAPbouiCOM.Condition  oCon  = null;

            try
            {
                oMatrix = (SAPbouiCOM.Matrix)forma.Items.Item("matrix1").Specific;
                oCons   = new SAPbouiCOM.Conditions();

                oCon = oCons.Add();
                oCon.BracketOpenNum = 2;
                oCon.Alias          = "U_CardCode";
                if ("" == cardCode)
                {
                    oCon.Operation = SAPbouiCOM.BoConditionOperation.co_IS_NULL;
                    oCon.CondVal   = cardCode;
                }
                else
                {
                    oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                    oCon.CondVal   = cardCode;
                }
                oCon.BracketCloseNum = 1;
                oCon.Relationship    = SAPbouiCOM.BoConditionRelationship.cr_AND;

                oCon = oCons.Add();
                oCon.BracketOpenNum  = 1;
                oCon.Alias           = "Status";
                oCon.Operation       = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                oCon.CondVal         = "O";
                oCon.BracketCloseNum = 2;

                oMatrix.Clear();
                forma.DataSources.DBDataSources.Item("@ZTV").Query(oCons);
                oMatrix.LoadFromDataSource();
                oMatrix.AutoResizeColumns();
                oMatrix.SelectRow(1, true, true);
            }
            catch (Exception e)
            {
                app.StatusBar.SetText("ListaSolicitud_method_getDataFromDataSource -> " + e.Message, SAPbouiCOM.BoMessageTime.bmt_Short,
                                      SAPbouiCOM.BoStatusBarMessageType.smt_Warning);
            }
        }
        public void crearChooseFromList()
        {
            SAPbouiCOM.ChooseFromList oCfl  = null;
            SAPbouiCOM.Conditions     oCons = null;
            SAPbouiCOM.Condition      oCon  = null;

            try
            {
                // se carga el objeto con la data del cfl que se utilizara
                // este se encuentra en la forma que se cargo  del xml
                // codigo del suplidor
                oCfl  = (SAPbouiCOM.ChooseFromList)forma.ChooseFromLists.Item("cflCodProv");
                oCons = oCfl.GetConditions();
                oCon  = oCons.Add();

                // se toma este alias como el campo que se utilizara para
                // filtrar la info
                oCon.Alias = "CardType";

                // en este caso la info del campo cardtype debe ser igual para
                // que se muestre la data
                oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;

                // el valor de la condicion debe se S que significa del tipo suplidor
                oCon.CondVal = "S";

                // se asignan las condiciones al cfl
                oCfl.SetConditions(oCons);

                //nombre del suplidor
                oCfl           = (SAPbouiCOM.ChooseFromList)forma.ChooseFromLists.Item("cflNmbProv");
                oCons          = oCfl.GetConditions();
                oCon           = oCons.Add();
                oCon.Alias     = "CardType";
                oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                oCon.CondVal   = "S";
                oCfl.SetConditions(oCons);
            }
            catch (Exception e)
            {
                app.StatusBar.SetText("solicitud_method_crearChooseFromList " + e.Message, SAPbouiCOM.BoMessageTime.bmt_Short,
                                      SAPbouiCOM.BoStatusBarMessageType.smt_Warning);
            }
        }
        private void AddConditionSupervisorCFL(SAPbouiCOM.ChooseFromList pCFL)
        {
            SAPbouiCOM.Condition  lObjCon  = null;
            SAPbouiCOM.Conditions lObjCons = new SAPbouiCOM.Conditions();

            lObjCon           = lObjCons.Add();
            lObjCon.Alias     = "position";
            lObjCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
            lObjCon.CondVal   = "4";

            lObjCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

            lObjCon           = lObjCons.Add();
            lObjCon.Alias     = "dept";
            lObjCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
            lObjCon.CondVal   = "12";

            pCFL.SetConditions(lObjCons);
        }
Esempio n. 7
0
        private void AddConditionClientCFL(SAPbouiCOM.ChooseFromList pCFL)
        {
            SAPbouiCOM.Condition  lObjCon  = null;
            SAPbouiCOM.Conditions lObjCons = new SAPbouiCOM.Conditions();

            lObjCon           = lObjCons.Add();
            lObjCon.Alias     = "CardType";
            lObjCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
            lObjCon.CondVal   = "C";

            lObjCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

            lObjCon           = lObjCons.Add();
            lObjCon.Alias     = "validFor";
            lObjCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
            lObjCon.CondVal   = "Y";

            pCFL.SetConditions(lObjCons);
        }
Esempio n. 8
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);

            initiallizing = true;
            dtNote        = oForm.DataSources.DataTables.Item("dtNote");

            dtDetail = oForm.DataSources.DataTables.Item("dtDetail");

            dtHead = oForm.DataSources.DataTables.Item("dtHead");
            dtHead.Rows.Add(1);

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

            cbNote  = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbNote").Specific;
            cbValOf = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbValOf").Specific;
            cbCS    = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbCS").Specific;
            cbPRJ   = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbPRJ").Specific;

            txCell    = (SAPbouiCOM.EditText)oForm.Items.Item("txCell").Specific;
            txTxt     = (SAPbouiCOM.EditText)oForm.Items.Item("txTxt").Specific;
            txHCD     = (SAPbouiCOM.EditText)oForm.Items.Item("26").Specific;
            btAddAcct = (SAPbouiCOM.Button)oForm.Items.Item("btAddAcct").Specific;
            btAddFV   = (SAPbouiCOM.Button)oForm.Items.Item("btAddFV").Specific;
            btAddTXT  = (SAPbouiCOM.Button)oForm.Items.Item("btAddTXT").Specific;
            btRemove  = (SAPbouiCOM.Button)oForm.Items.Item("btRemove").Specific;

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

            fillCb();
            cbValOf.ValidValues.Add("01", "Closing");
            cbValOf.ValidValues.Add("02", "Change");
            cbValOf.ValidValues.Add("03", "Opening");

            cbNote.Select(0, SAPbouiCOM.BoSearchKey.psk_Index);

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

            SAPbouiCOM.Conditions oCons = cflAcct.GetConditions();
            SAPbouiCOM.Condition  oCon  = oCons.Add();
            oCon.Alias     = "Postable";
            oCon.Operation = SAPbouiCOM.BoConditionOperation.co_START;
            oCon.CondVal   = "Y";

            cflAcct.SetConditions(oCons);

            oForm.Freeze(false);

            initiallizing = false;
        }
Esempio n. 9
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);

            initiallizing = true;


            BOQD  = oForm.DataSources.DataTables.Item("BOQD");
            BOQH  = oForm.DataSources.DataTables.Item("BOQH");
            BOQID = oForm.DataSources.DataTables.Item("BOQID");

            BOQH.Rows.Add(1);

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

            SAPbouiCOM.Column col = mtDC.Columns.Item("cType");
            col.ValidValues.Add("S", "Service");
            col.ValidValues.Add("I", "Item");
            col.DisplayDesc = true;
            txCode          = (SAPbouiCOM.EditText)oForm.Items.Item("txCode").Specific;
            txName          = (SAPbouiCOM.EditText)oForm.Items.Item("txName").Specific;
            txDCB           = (SAPbouiCOM.EditText)oForm.Items.Item("txDCB").Specific;
            txICB           = (SAPbouiCOM.EditText)oForm.Items.Item("txICB").Specific;
            txTCB           = (SAPbouiCOM.EditText)oForm.Items.Item("txTCB").Specific;
            txDCA           = (SAPbouiCOM.EditText)oForm.Items.Item("txDCA").Specific;
            cbRule          = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbRule").Specific;
            txACode         = (SAPbouiCOM.EditText)oForm.Items.Item("txACode").Specific;
            txAName         = (SAPbouiCOM.EditText)oForm.Items.Item("txAName").Specific;

            txRemarks = (SAPbouiCOM.EditText)oForm.Items.Item("txRemarks").Specific;
            cflOitm   = (SAPbouiCOM.ChooseFromList)oForm.ChooseFromLists.Item("cflOitm");
            cmdDR     = (SAPbouiCOM.Button)oForm.Items.Item("cmdDR").Specific;

            SAPbouiCOM.Conditions oCons = cflOitm.GetConditions();
            SAPbouiCOM.Condition  oCon  = oCons.Add();
            oCon.Alias     = "ItemType";
            oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
            oCon.CondVal   = "F";
            cflOitm.SetConditions(oCons);
            fillCB();
            oForm.Freeze(false);

            initiallizing = false;
        }
        private void ChosFrmList_Before(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            __Form      = __app.Forms.GetForm(pVal.FormTypeEx, pVal.FormTypeCount);

            try
            {
                if (pVal.ItemUID == "Item_0")
                {
                    SAPbouiCOM.IChooseFromListEvent chl  = (SAPbouiCOM.IChooseFromListEvent)pVal;
                    SAPbouiCOM.ChooseFromList       oCFL = null;
                    string cflID = chl.ChooseFromListUID;
                    oCFL = __Form.ChooseFromLists.Item(cflID);
                    oCFL.SetConditions(null);
                    SAPbouiCOM.Conditions oCons = oCFL.GetConditions();
                    SAPbouiCOM.Condition  c     = null;
                    c = oCons.Add();
                    c.BracketOpenNum  = 1;
                    c.Alias           = "CardType";
                    c.Operation       = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                    c.CondVal         = "C";
                    c.BracketCloseNum = 1;
                    oCFL.SetConditions(oCons);
                }
            }
            catch (SqlException e)
            {
                __app.SetStatusBarMessage(e + "...", SAPbouiCOM.BoMessageTime.bmt_Medium, true);
                BubbleEvent = false;
            }
            catch (COMException e)
            {
                __app.SetStatusBarMessage(e + "...", SAPbouiCOM.BoMessageTime.bmt_Medium, true);
                BubbleEvent = false;
            }
            catch (Exception e)
            {
                __app.SetStatusBarMessage(e + "...", SAPbouiCOM.BoMessageTime.bmt_Medium, true);
                BubbleEvent = false;
            }
        }
Esempio n. 11
0
    public static void AddChooseFromList(SAPbouiCOM.Form frm, string ObjectType, string ParamsID, string ConAlias, string CondVal)
    {
        try
        {
            SAPbouiCOM.ChooseFromListCollection oCFLs = null;
            SAPbouiCOM.Conditions oCons = null;
            SAPbouiCOM.Condition  oCon  = null;

            oCFLs = frm.ChooseFromLists;

            SAPbouiCOM.ChooseFromList oCFL = null;
            SAPbouiCOM.ChooseFromListCreationParams oCFLCreationParams = null;
            oCFLCreationParams = ((SAPbouiCOM.ChooseFromListCreationParams)(SubMain.SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)));

            //  Adding 2 CFL, one for the button and one for the edit text.
            oCFLCreationParams.MultiSelection = false;
            oCFLCreationParams.ObjectType     = ObjectType;
            oCFLCreationParams.UniqueID       = ParamsID;

            oCFL = oCFLs.Add(oCFLCreationParams);

            //  Adding Conditions to CFL1
            if (ConAlias != "")
            {
                oCons = oCFL.GetConditions();

                oCon           = oCons.Add();
                oCon.Alias     = ConAlias;
                oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                oCon.CondVal   = CondVal;
                oCFL.SetConditions(oCons);
            }
            //oCFLCreationParams.UniqueID = "CFL2";
            //oCust = oCFLs.Add(oCFLCreationParams);
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 12
0
        private void AddChooseFromList()
        {
            try {
                SAPbouiCOM.ChooseFromListCollection oCFLs = null;
                SAPbouiCOM.Conditions oCons = null;
                SAPbouiCOM.Condition  oCon  = null;

                oCFLs = oForm.ChooseFromLists;

                SAPbouiCOM.ChooseFromList oCFL = null;
                SAPbouiCOM.ChooseFromListCreationParams oCFLCreationParams = null;
                oCFLCreationParams = ((SAPbouiCOM.ChooseFromListCreationParams)(SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)));

                //  Adding 2 CFL, one for the button and one for the edit text.
                oCFLCreationParams.MultiSelection = false;
                oCFLCreationParams.ObjectType     = "2";
                oCFLCreationParams.UniqueID       = "CFL1";

                oCFL = oCFLs.Add(oCFLCreationParams);

                //  Adding Conditions to CFL1

                oCons = oCFL.GetConditions();

                oCon           = oCons.Add();
                oCon.Alias     = "CardType";
                oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                oCon.CondVal   = "C";
                oCFL.SetConditions(oCons);

                oCFLCreationParams.UniqueID = "CFL2";
                oCFL = oCFLs.Add(oCFLCreationParams);
            }
            catch  {
                Interaction.MsgBox(Information.Err().Description, (Microsoft.VisualBasic.MsgBoxStyle)(0), null);
            }
        }
Esempio n. 13
0
        private void OnCustomInitialize()
        {
            LoadEvents();
            mCFLClient = InitChooseFromLists(false, "2", "CFL_Client", this.UIAPIRawForm.ChooseFromLists);
            mEdtCardCode.DataBind.SetBound(true, "", mCFLClient.UniqueID);
            mEdtCardCode.ChooseFromListUID = mCFLClient.UniqueID;

            SAPbouiCOM.Conditions lObjCons = mCFLClient.GetConditions();
            SAPbouiCOM.Condition  lObjCon  = lObjCons.Add();
            lObjCon.Alias     = "CardType";
            lObjCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
            lObjCon.CondVal   = "C";
            mCFLClient.SetConditions(lObjCons);

            mCFLPayMethod = InitChooseFromLists(false, "147", "CFL_PyMthd", this.UIAPIRawForm.ChooseFromLists);
            mEdtPaymentMethod.DataBind.SetBound(true, "", mCFLPayMethod.UniqueID);
            mEdtPaymentMethod.ChooseFromListUID = mCFLPayMethod.UniqueID;

            mCFLPayGroup = InitChooseFromLists(false, "40", "CFL_PayGrp", this.UIAPIRawForm.ChooseFromLists);
            mEdtPaymentGroup.DataBind.SetBound(true, "", mCFLPayGroup.UniqueID);
            mEdtPaymentGroup.ChooseFromListUID = mCFLPayGroup.UniqueID;

            mCFLItemCode = InitChooseFromLists(false, "4", "CFL_ItmCod", this.UIAPIRawForm.ChooseFromLists);
            mEdtItemCode.DataBind.SetBound(true, "", mCFLItemCode.UniqueID);
            mEdtItemCode.ChooseFromListUID = mCFLItemCode.UniqueID;

            lObjCons          = mCFLItemCode.GetConditions();
            lObjCon           = lObjCons.Add();
            lObjCon.Alias     = "SellItem";
            lObjCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
            lObjCon.CondVal   = "Y";
            mCFLItemCode.SetConditions(lObjCons);

            mCFLItemTax = InitChooseFromLists(false, "128", "CFL_ItmTax", this.UIAPIRawForm.ChooseFromLists);
            mEdtItemTax.DataBind.SetBound(true, "", mCFLItemTax.UniqueID);
            mEdtItemTax.ChooseFromListUID = mCFLItemTax.UniqueID;

            lObjCons          = mCFLItemTax.GetConditions();
            lObjCon           = lObjCons.Add();
            lObjCon.Alias     = "ValidForAR";
            lObjCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
            lObjCon.CondVal   = "Y";
            mCFLItemTax.SetConditions(lObjCons);

            mCFLItemWarehouse = InitChooseFromLists(false, "64", "CFL_ItmWhs", this.UIAPIRawForm.ChooseFromLists);
            mEdtItemWarehouse.DataBind.SetBound(true, "", mCFLItemWarehouse.UniqueID);
            mEdtItemWarehouse.ChooseFromListUID = mCFLItemWarehouse.UniqueID;

            mCFLItemCosting = InitChooseFromLists(false, "62", "CFL_ItmOcr", this.UIAPIRawForm.ChooseFromLists);
            mEdtItemCosting.DataBind.SetBound(true, "", mCFLItemCosting.UniqueID);
            mEdtItemCosting.ChooseFromListUID = mCFLItemCosting.UniqueID;

            mCFLEdocFormat = InitChooseFromLists(false, "410000005", "CFL_EForm", this.UIAPIRawForm.ChooseFromLists);
            mEdtEdocFormat.DataBind.SetBound(true, "", mCFLEdocFormat.UniqueID);
            mEdtEdocFormat.ChooseFromListUID = mCFLEdocFormat.UniqueID;

            lObjCons          = mCFLEdocFormat.GetConditions();
            lObjCon           = lObjCons.Add();
            lObjCon.Alias     = "Type";
            lObjCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
            lObjCon.CondVal   = "CFDD";
            mCFLEdocFormat.SetConditions(lObjCons);
        }
Esempio n. 14
0
        private void AddChooseFromList2()
        {
            try
            {
                SAPbouiCOM.Conditions oConditions;
                SAPbouiCOM.Condition oCondition;

                SAPbouiCOM.ChooseFromListCollection oCFLs = null;
                oCFLs = oForm.ChooseFromLists;

                SAPbouiCOM.ChooseFromList oCFL = null;
                SAPbouiCOM.ChooseFromListCreationParams oCFLCreationParams = null;
                oCFLCreationParams = ((SAPbouiCOM.ChooseFromListCreationParams)(SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)));

                //  Filtro pelo cadastro de itens.
                oCFLCreationParams.MultiSelection = false;
                oCFLCreationParams.ObjectType = "2";
                oCFLCreationParams.UniqueID = "CFL2";

                oConditions = new SAPbouiCOM.Conditions();
                oCondition = oConditions.Add();
                oCondition.BracketOpenNum = 1;
                oCondition.Alias = "CardType";
                oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                oCondition.CondVal = "S";
                oCondition.BracketCloseNum = 1;

                oCFL = oCFLs.Add(oCFLCreationParams);
                oCFL.SetConditions(oConditions);
            }
            catch (Exception ex)
            {
                SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");
            }
        }
Esempio n. 15
0
        private void AddChooseFromList()//aqui break point
        {
            lObjFormXml.DataSources.UserDataSources.Add("UDCFL", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 254);
            string Cbx = lObjComboBox.Value.Trim();

            try
            {
                SAPbouiCOM.ChooseFromListCollection oCFLs = null;
                SAPbouiCOM.Conditions oCons   = null;
                SAPbouiCOM.Condition  oCon    = null;
                SAPbouiCOM.Column     oColumn = null;

                oCFLs = lObjFormXml.ChooseFromLists;

                SAPbouiCOM.ChooseFromListCreationParams lObjCFLCreationParams = null;
                lObjCFLCreationParams = (SAPbouiCOM.ChooseFromListCreationParams)SAPbouiCOM.Framework.Application.SBO_Application.CreateObject
                                            (SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams);

                //  Adding 2 CFL, one for the button and one for the edit text.
                //string strCFLID = oCFLCreationParams.UniqueID
                lObjCFLCreationParams.MultiSelection = false;
                if (lStrDocType.Equals("Servicios"))
                {
                    lObjCFLCreationParams.ObjectType = "1";
                }
                else
                {
                    lObjCFLCreationParams.ObjectType = "4";
                }
                lObjCFLCreationParams.UniqueID = "CFLACT";

                pObjChooseFromList = oCFLs.Add(lObjCFLCreationParams);

                //  Adding Conditions to CFL1
                oCons = pObjChooseFromList.GetConditions();

                //Onlu Postable Accounts
                if (lStrDocType.Equals("Servicios") && lStrFormType != "65301")
                {
                    if (Cbx == "MXP")
                    {
                        #region MXP
                        oCon           = oCons.Add();
                        oCon.Alias     = "Postable";
                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                        oCon.CondVal   = "Y";

                        oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

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

                        oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

                        oCon           = oCons.Add();
                        oCon.Alias     = "ActCurr";
                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_NOT_EQUAL;
                        oCon.CondVal   = "EUR";

                        oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

                        oCon           = oCons.Add();
                        oCon.Alias     = "ActCurr";
                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_NOT_EQUAL;
                        oCon.CondVal   = "USD";
                        #endregion
                    }
                    else if (Cbx == "USD")
                    {
                        #region USD
                        oCon           = oCons.Add();
                        oCon.Alias     = "Postable";
                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                        oCon.CondVal   = "Y";

                        oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

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

                        oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

                        oCon           = oCons.Add();
                        oCon.Alias     = "ActCurr";
                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_NOT_EQUAL;
                        oCon.CondVal   = "EUR";

                        oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

                        oCon           = oCons.Add();
                        oCon.Alias     = "ActCurr";
                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_NOT_EQUAL;
                        oCon.CondVal   = "MXP";
                        #endregion
                    }
                    else if (Cbx == "EUR")
                    {
                        #region EUR
                        oCon           = oCons.Add();
                        oCon.Alias     = "Postable";
                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                        oCon.CondVal   = "Y";

                        oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

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

                        oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

                        oCon           = oCons.Add();
                        oCon.Alias     = "ActCurr";
                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_NOT_EQUAL;
                        oCon.CondVal   = "USD";

                        oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

                        oCon           = oCons.Add();
                        oCon.Alias     = "ActCurr";
                        oCon.Operation = SAPbouiCOM.BoConditionOperation.co_NOT_EQUAL;
                        oCon.CondVal   = "MXP";
                        #endregion
                    }
                }
                else if (lStrDocType.Equals("Servicios") && lStrFormType == "65301")
                {
                    #region advances to suppliers
                    oCon           = oCons.Add();
                    oCon.Alias     = "AcctCode";
                    oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                    oCon.CondVal   = "11410000";
                    #endregion
                }
                else
                {
                    oCon           = oCons.Add();
                    oCon.Alias     = "validFor";
                    oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                    oCon.CondVal   = "Y";
                }
                pObjChooseFromList.SetConditions(oCons);


                if (oMatrix.RowCount > 0)
                {
                    for (int i = oMatrix.RowCount; i >= 1; i--)
                    {
                        if (oMatrix.RowCount == 1)
                        {
                            oMatrix.ClearRowData(i);
                            oMatrix.DeleteRow(i);
                        }
                        else
                        {
                            oMatrix.DeleteRow(i);
                        }
                    }
                }

                oColumn = oMatrix.Columns.Item("Col_0");

                try {
                    oColumn.DataBind.SetBound(true, "", "UDCFL");
                }
                catch (Exception)
                {
                }
                oColumn.ChooseFromListUID = pObjChooseFromList.UniqueID;
                if (lStrDocType.Equals("Servicios"))
                {
                    oColumn.ChooseFromListAlias = "AcctCode";
                }
                else
                {
                    oColumn.ChooseFromListAlias = "ItemCode";
                }
            }
            catch (Exception ex)
            {
                SAPbouiCOM.Framework.Application.SBO_Application.MessageBox(string.Format("InitCustomerChooseFromListException: {0}", ex.Message));
            }
        }