Exemple #1
0
        //SetValue
        private void SetDataTableValuesAuction(List <InvoiceExpDTO> pLstAuctionDTO)
        {
            try
            {
                DtMatrixInvoice = this.UIAPIRawForm.DataSources.DataTables.Item("DT_NC");
                DtMatrixInvoice.Rows.Clear();
                int i = 0;

                foreach (InvoiceExpDTO lObjInvoiceExp in pLstAuctionDTO)
                {
                    DtMatrixInvoice.Rows.Add();
                    DtMatrixInvoice.SetValue("#", i, i + 1);
                    DtMatrixInvoice.SetValue("C_BP", i, lObjInvoiceExp.BussinesPartner);
                    DtMatrixInvoice.SetValue("C_Cert", i, lObjInvoiceExp.Certificate);
                    DtMatrixInvoice.SetValue("C_Inv", i, lObjInvoiceExp.DocNum);
                    DtMatrixInvoice.SetValue("C_HeadInv", i, lObjInvoiceExp.HeadInvoice);
                    DtMatrixInvoice.SetValue("C_HeadExp", i, lObjInvoiceExp.HeatExport);
                    DtMatrixInvoice.SetValue("C_HeadNoCr", i, lObjInvoiceExp.HeadNoCruz);
                    DtMatrixInvoice.SetValue("C_Amount", i, lObjInvoiceExp.Amount);
                    DtMatrixInvoice.SetValue("C_DocEntry", i, lObjInvoiceExp.DocEntry);
                    DtMatrixInvoice.SetValue("C_Paid", i, lObjInvoiceExp.PaidToDate);
                    i++;
                }
            }
            catch (Exception ex)
            {
                UIApplication.ShowError("frm (BindDataMatrix) " + ex.Message);
                LogService.WriteError("frm (BindDataMatrix) " + ex.Message);
                LogService.WriteError(ex);
            }
        }
Exemple #2
0
        private void InitiallizeForm()
        {
            Program.objHrmsUI.loadSettings();
            oForm.Freeze(true);



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

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

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

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

            oForm.Freeze(false);
        }
Exemple #3
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;
        }
Exemple #4
0
 public override void etAfterCfl(ref ItemEvent pVal, ref bool BubbleEvent)
 {
     base.etAfterCfl(ref pVal, ref BubbleEvent);
     SAPbouiCOM.IChooseFromListEvent oCFLEvento = (SAPbouiCOM.IChooseFromListEvent)pVal;
     SAPbouiCOM.DataTable            dtSel      = oCFLEvento.SelectedObjects;
     if (pVal.ItemUID == txCode.Item.UniqueID)
     {
         if (dtSel.Rows.Count > 0)
         {
             string strCode = "";
             string strName = "";
             if (oCFLEvento.ChooseFromListUID == "cflCode")
             {
                 strCode = dtSel.GetValue("ItemCode", 0).ToString();
                 strName = dtSel.GetValue("ItemName", 0).ToString();
             }
             if (oCFLEvento.ChooseFromListUID == "cflGroup")
             {
                 strCode = dtSel.GetValue("ItmsGrpCod", 0).ToString();
                 strName = dtSel.GetValue("ItmsGrpNam", 0).ToString();
             }
             dtHead.SetValue("Code", 0, strCode);
             dtHead.SetValue("Name", 0, strName);
         }
     }
 }
Exemple #5
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);

            initiallizing = true;

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

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

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

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

            getDocs();
            initiallizing = false;
        }
Exemple #6
0
        public override void etAfterCfl(ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent)
        {
            base.etAfterCfl(ref pVal, ref BubbleEvent);
            SAPbouiCOM.IChooseFromListEvent oCFLEvento = (SAPbouiCOM.IChooseFromListEvent)pVal;
            SAPbouiCOM.DataTable            dtSel      = oCFLEvento.SelectedObjects;

            if (pVal.ItemUID == "txCode")
            {
                string CardCode = "";
                string CardName = "";
                if (dtSel != null && dtSel.Rows.Count > 0)
                {
                    for (int i = 0; i < dtSel.Rows.Count; i++)
                    {
                        CardCode = dtSel.GetValue("CardCode", i).ToString();
                        CardName = dtSel.GetValue("CardName", i).ToString();
                    }
                    // mtCus.SetLineData(pVal.Row);
                    dtHead.Rows.Remove(0);
                    dtHead.Rows.Add(1);

                    dtHead.SetValue("CardCode", 0, CardCode);
                    dtHead.SetValue("CardName", 0, CardName);

                    AddNewCardSche(CardCode);
                    getSchedule();
                }
            }
            if (pVal.ItemUID == "txICode")
            {
                if (dtSel != null && dtSel.Rows.Count > 0)
                {
                    string ItemCode = "", ItemName = "";
                    for (int i = 0; i < dtSel.Rows.Count; i++)
                    {
                        ItemCode = dtSel.GetValue("ItemCode", i).ToString();
                        ItemName = dtSel.GetValue("ItemName", i).ToString();
                    }
                    // mtCus.SetLineData(pVal.Row);
                    dtHead.SetValue("ItemCode", 0, ItemCode);
                    dtHead.SetValue("ItemName", 0, ItemName);
                }
            }

            if (pVal.ItemUID == "txOICODE")
            {
                if (dtSel != null && dtSel.Rows.Count > 0)
                {
                    string ItemCode = "", ItemName = "";
                    for (int i = 0; i < dtSel.Rows.Count; i++)
                    {
                        ItemCode = dtSel.GetValue("ItemCode", i).ToString();
                        ItemName = dtSel.GetValue("ItemName", i).ToString();
                    }
                    // mtCus.SetLineData(pVal.Row);
                    dtHead.SetValue("OSCNCode", 0, ItemCode);
                    dtHead.SetValue("OSCNName", 0, ItemName);
                }
            }
        }
Exemple #7
0
        private void ChooseFromListAfterEvent(ItemEvent pObjValEvent)
        {
            try
            {
                if (pObjValEvent.Action_Success)
                {
                    SAPbouiCOM.IChooseFromListEvent lObjCFLEvent = (SAPbouiCOM.IChooseFromListEvent)pObjValEvent;
                    if (lObjCFLEvent.SelectedObjects != null)
                    {
                        SAPbouiCOM.DataTable lObjDataTable = lObjCFLEvent.SelectedObjects;

                        if (lObjDataTable != null)
                        {
                            this.UIAPIRawForm.DataSources.UserDataSources.Item(lObjDataTable.UniqueID).ValueEx = System.Convert.ToString(lObjDataTable.GetValue(0, 0));

                            switch (lObjDataTable.UniqueID)
                            {
                            case "CFL_Area":
                                //txtArea.Value = lObjDataTable.GetValue(0, 0).ToString();
                                this.UIAPIRawForm.DataSources.UserDataSources.Item("CFL_Area").ValueEx = lObjDataTable.GetValue(0, 0).ToString();
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogService.WriteError("(ChooseFromListAfterEvent): " + ex.Message);
                LogService.WriteError(ex);
            }
        }
        private void CargarGrid()
        {
            try
            {
                ogrid = ((Grid)oForm.Items.Item("ogrid").Specific);
                odt   = ogrid.DataTable;
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"SELECT DocEntry, U_CardCode, U_CardName, U_Activado FROM [@VID_FELISTANE]";
                }
                else
                {
                    s = @"SELECT ""DocEntry"", ""U_CardCode"", ""U_CardName"", ""U_Activado"" FROM ""@VID_FELISTANE"" ";
                }
                ogrid.DataTable.ExecuteQuery(s);

                ogrid.Columns.Item("DocEntry").Type = BoGridColumnType.gct_EditText;
                var oColumn = ((GridColumn)ogrid.Columns.Item("DocEntry"));
                ((EditTextColumn)oColumn).Editable            = false;
                ((EditTextColumn)oColumn).TitleObject.Caption = "DocEntry";
                ((EditTextColumn)oColumn).Visible             = false;

                ogrid.Columns.Item("U_CardCode").Type = BoGridColumnType.gct_EditText;
                oColumn = ((GridColumn)ogrid.Columns.Item("U_CardCode"));
                ((EditTextColumn)oColumn).Editable            = true;
                ((EditTextColumn)oColumn).TitleObject.Caption = "Codigo SN";
                ((EditTextColumn)oColumn).Visible             = true;
                ((EditTextColumn)oColumn).LinkedObjectType    = "2";
                ((EditTextColumn)oColumn).ChooseFromListUID   = "CFL0";
                ((EditTextColumn)oColumn).ChooseFromListAlias = "CardCode";

                ogrid.Columns.Item("U_CardName").Type = BoGridColumnType.gct_EditText;
                oColumn = ((GridColumn)ogrid.Columns.Item("U_CardName"));
                ((EditTextColumn)oColumn).Editable            = false;
                ((EditTextColumn)oColumn).TitleObject.Caption = "Razón Social";
                ((EditTextColumn)oColumn).Visible             = true;

                ogrid.Columns.Item("U_Activado").Type = BoGridColumnType.gct_CheckBox;
                var oColumnchx = ((GridColumn)ogrid.Columns.Item("U_Activado"));
                ((CheckBoxColumn)oColumnchx).Editable            = true;
                ((CheckBoxColumn)oColumnchx).TitleObject.Caption = "Activo";
                ((CheckBoxColumn)oColumnchx).Visible             = true;

                ogrid.AutoResizeColumns();
                if (((System.String)odt.GetValue("U_CardCode", 0)).Trim() != "")
                {
                    odt.Rows.Add();
                }

                FSBOApp.StatusBar.SetText("Lista Negra cargada", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success);
            }
            catch (Exception e)
            {
                FSBOApp.StatusBar.SetText(e.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                OutLog("CargarGrid: " + e.Message + " ** Trace: " + e.StackTrace);
            }
        }
        /// <summary>
        /// Fill Livestock Matrix Data By Parallel Loopps
        /// </summary>
        /// <param name="tableID"></param>
        /// <param name="dataTable"></param>
        /// <param name="client"></param>
        /// <param name="type"></param>
        private void FillMatrix1(string tableID, SAPbouiCOM.DataTable dataTable, string client, string type)
        {
            try {
                dataTable.Rows.Clear();
                livestock = massInvoicingDAO.GetDistributedLiveStock(client, type);

                var columns = new List <string>(columnsExit.Keys);

                if (livestock.Count > 0)
                {
                    Parallel.For(0, livestock.Count, row => {
                        dataTable.Rows.Add();
                    });

                    Task.Factory.StartNew(() => {
                        Parallel.For(0, livestock.Count, row => {
                            dataTable.SetValue("C_#", row, row + 1);
                        });
                    });

                    Parallel.ForEach(Partitioner.Create(0, livestock.Count), (range, state) => {
                        for (int i = range.Item1; i < range.Item2; i++)
                        {
                            Parallel.ForEach(columns.Skip(1), column => {
                                dataTable.SetValue(column, i, livestock[i].GetType().GetProperty(column.Replace("C_", String.Empty)).GetValue(livestock[i], null));
                            });
                        }
                    });

                    BindDataMatrix(mtx1, tableID, columns);

                    if (type.Equals("N"))
                    {
                        Task.Factory.StartNew(() => {
                            batches           = massInvoicingDAO.GetBatches(client, user.WhsCode, type);
                            floorServiceLines = massInvoicingDAO.GetFloorServiceLines(client, user.WhsCode, type);
                        });
                    }
                }
                else
                {
                    ClearMtx(mtx1);
                }
            }
            catch (AggregateException ae) {
                ae.Handle(e => {
                    HandleException(e, "(AE)");
                    return(true);
                });
            }
            catch (Exception ex) {
                HandleException(ex, "(FillMatrix2)");
            }
        }
Exemple #10
0
        private void InitiallizeForm()
        {
            Program.objHrmsUI.loadSettings();
            Program.isDemo = Program.objHrmsUI.settings["IsDemo"].ToString() == "Y" ? true : false;


            oForm.Freeze(true);

            initiallizing = true;



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


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

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

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

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

            ini_controls();

            oForm.Freeze(false);

            initiallizing = false;
        }
        /// <summary>
        /// Fill Client Matrix Data By Parallel Loopps
        /// </summary>
        /// <param name="tableID"></param>
        /// <param name="dataTable"></param>
        private void FillMatrix0(string tableID, SAPbouiCOM.DataTable dataTable, string type)
        {
            try {
                dataTable.Rows.Clear();

                var columns = new List <string>(columnsClient.Keys);
                pendingInvoices = massInvoicingDAO.GetInvoicesPending(type);

                if (pendingInvoices.Count > 0)
                {
                    //add empty rows to datatable
                    Parallel.For(0, pendingInvoices.Count, row => {
                        dataTable.Rows.Add();
                    });

                    //add the index column in a separate task
                    Task.Factory.StartNew(() => {
                        Parallel.For(0, pendingInvoices.Count, row => {
                            dataTable.SetValue("C_#", row, row + 1);
                        });
                    });

                    //popolate the empty rows of the matrix
                    Parallel.ForEach(Partitioner.Create(0, pendingInvoices.Count), (range, state) => {
                        for (int i = range.Item1; i < range.Item2; i++)
                        {
                            Parallel.ForEach(columns.Skip(1), column => {
                                dataTable.SetValue(column, i, pendingInvoices[i].GetType().GetProperty(column.Replace("C_", String.Empty)).GetValue(pendingInvoices[i], null));
                            });
                        }
                    });

                    //bind datatable with matrix
                    BindDataMatrix(mtx0, tableID, columns);
                    LogService.WriteInfo("(frmDelivery) Matriz Cargada correctamente");
                }
                else
                {
                    ClearMtx(mtx0);
                }
            }
            catch (AggregateException ae) {
                ae.Handle(e => {
                    HandleException(e, "(AE)");
                    return(true);
                });
            }
            catch (Exception ex) {
                if (!invoicedFlag)
                {
                    HandleException(ex, "(FillMatrix0)");
                }
            }
        }
        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_FECTASAP.srf", uid);
                oForm = FSBOApp.Forms.Item(uid);
                oForm.Freeze(true);
                oForm.AutoManaged = true;

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"SELECT COUNT(*) AS cant FROM [@VID_FEPLANCTA] WHERE DocEntry = {0}";
                }
                else
                {
                    s = @"SELECT COUNT(*) ""cant"" FROM ""@VID_FEPLANCTA"" WHERE ""DocEntry"" = {0} ";
                }
                s = String.Format(s, DocEntry);
                oRecordSet.DoQuery(s);
                oForm.SupportedModes = (((System.Int32)oRecordSet.Fields.Item("cant").Value) > 0 ? 1 : 3);
                oForm.Mode           = (((System.Int32)oRecordSet.Fields.Item("cant").Value) > 0 ? BoFormMode.fm_OK_MODE : BoFormMode.fm_ADD_MODE);

                oDBDSDetalle = oForm.DataSources.DBDataSources.Add("@VID_FEPLANCTAD");

                odt                 = oForm.DataSources.DataTables.Add("Cuentas");
                oGrid               = ((SAPbouiCOM.Grid)oForm.Items.Item("grid").Specific);
                oGrid.DataTable     = odt;
                oGrid.SelectionMode = BoMatrixSelect.ms_Single;

                AddChooseFromList();
                CargarGrilla();
            }
            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
        public static String CrearXMLDiccionario(String Periodo, SAPbouiCOM.DataTable odt, SAPbouiCOM.Application FSBOApp)
        {
            String NomCol;

            try
            {
                s = @"<LceCoCierre version=""1.0""><LceDiccionario version=""1.0""><DocumentoDiccionario ID=""DICC{0}"">";
                s = String.Format(s, Periodo.Replace("-", "."));

                NomCol = odt.Columns.Item(0).Name;
                var Col = NomCol.Split('/');
                s = s + @"<{0}><{1}>{2}</{1}>";
                s = String.Format(s, Col[0], Col[1], ((System.String)odt.GetValue(0, 0)).Trim());

                NomCol = odt.Columns.Item(1).Name;
                Col    = NomCol.Split('/');
                s      = s + @"<{1}>{2}</{1}></{0}>";
                s      = String.Format(s, Col[0], Col[1], ((System.String)odt.GetValue(1, 0)).Trim());

                for (Int32 i = 0; i < odt.Rows.Count; i++)
                {
                    NomCol = odt.Columns.Item(2).Name;
                    Col    = NomCol.Split('/');
                    var sFin = Col[0];
                    s = s + @"<{0}>";
                    s = String.Format(s, sFin);

                    for (Int32 c = 2; c < odt.Columns.Count - 1; c++)
                    {
                        NomCol = odt.Columns.Item(c).Name;
                        Col    = NomCol.Split('/');
                        s      = s + @"<{0}>{1}</{0}>";
                        s      = String.Format(s, Col[1], ((System.String)odt.GetValue(c, i)).Trim());
                    }

                    s = s + @"</{0}>";
                    s = String.Format(s, sFin);
                }

                s = s + @"</DocumentoDiccionario></LceDiccionario></LceCoCierre>";

                return(s);
            }
            catch (Exception z)
            {
                FSBOApp.StatusBar.SetText(z.Message + " ** Trace: " + z.StackTrace, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                //OutLog("CrearXMLDiccionario: " + z.Message + " ** Trace: " + z.StackTrace);
                return("");
            }
        }
Exemple #14
0
        private void ChooseFromListAfterEvent(SAPbouiCOM.ItemEvent pObjValEvent)
        {
            if (pObjValEvent.Action_Success)
            {
                SAPbouiCOM.IChooseFromListEvent lObjCFLEvento = (SAPbouiCOM.IChooseFromListEvent)pObjValEvent;
                SAPbouiCOM.DataTable            lObjDataTable = lObjCFLEvento.SelectedObjects;
                if (lObjCFLEvento.SelectedObjects == null)
                {
                    return;
                }

                this.UIAPIRawForm.DataSources.UserDataSources.Item("CFL_Client").ValueEx = Convert.ToString(lObjDataTable.GetValue(0, 0));
            }
        }
Exemple #15
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();
        }
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            SAPbouiCOM.ComboBox oComboBox;
            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_FERESFOL.srf", uid);
                //EnableCrystal := true;
                oForm = FSBOApp.Forms.Item(uid);
                oForm.Freeze(true);
                oForm.AutoManaged    = false;
                oForm.SupportedModes = -1;       // afm_All
                oForm.EnableMenu("1281", false); //Buscar
                oForm.EnableMenu("1282", false); //Crear

                //VID_DelRow := true;
                //VID_DelRowOK := true;

                //        oForm.DataBrowser.BrowseBy := "Code";
                //        oDBDSCAF := oForm.DataSources.DBDataSources.Add("@VID_FECAF");
                //        oDBDSDISTH := oForm.DataSources.DBDataSources.Add("@VID_FEDIST");
                //        oDBDSDISTD := oForm.DataSources.DBDataSources.Add("@VID_FEDISTD");
                ogrid      = (Grid)(oForm.Items.Item("grid").Specific);
                oDataTable = oForm.DataSources.DataTables.Add("dt");

                ogrid.DataTable = oDataTable;

                FSBOApp.StatusBar.SetText("Actualizando estado de folios asignados", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Warning);
                ActualizarRegistros();

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

                oForm.Mode = BoFormMode.fm_OK_MODE;
            }
            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
        }//fin MenuEvent

        private void BorrarLinea()
        {
            Int32   sCode;
            Boolean bPaso;

            try
            {
                bPaso = false;
                ogrid = ((Grid)oForm.Items.Item("ogrid").Specific);
                odt   = ogrid.DataTable;
                for (Int32 iCont_1 = 0; iCont_1 < odt.Rows.Count; iCont_1++)
                {
                    if (((System.String)odt.GetValue("U_CardCode", iCont_1)).Length > 0)
                    {
                        if (ogrid.Rows.IsSelected(iCont_1))
                        {
                            sCode = ((System.Int32)odt.GetValue("DocEntry", iCont_1));
                            if (sCode != 0)
                            {
                                if (Funciones.DelDataSource("D", "VID_FELISTANE", "", sCode))
                                {
                                    odt.Rows.Remove(iCont_1);
                                    oForm.Mode = BoFormMode.fm_OK_MODE;
                                    FSBOApp.StatusBar.SetText("Linea eliminada correctamente", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success);
                                    bPaso = true;
                                    break;
                                }
                            }
                            else
                            {
                                odt.Rows.Remove(iCont_1);
                                FSBOApp.StatusBar.SetText("Linea eliminada correctamente", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success);
                                bPaso = true;
                            }
                        }
                    }
                }

                if (bPaso == false)
                {
                    FSBOApp.StatusBar.SetText("Debe seleccionar una linea", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Warning);
                }
            }
            catch (Exception g)
            {
                FSBOApp.StatusBar.SetText(g.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                OutLog("BorrarLinea: " + g.Message + " ** Trace: " + g.StackTrace);
            }
        }
Exemple #18
0
        public override void etAfterCfl(ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent)
        {
            base.etAfterCfl(ref pVal, ref BubbleEvent);
            SAPbouiCOM.IChooseFromListEvent oCFLEvento = (SAPbouiCOM.IChooseFromListEvent)pVal;
            SAPbouiCOM.DataTable            dtSel      = oCFLEvento.SelectedObjects;
            if (pVal.ItemUID == txDfltExp.Item.UniqueID)
            {
                if (dtSel != null && dtSel.Rows.Count > 0)
                {
                    string strCode = dtSel.GetValue("AcctCode", 0).ToString();
                    string strName = dtSel.GetValue("AcctName", 0).ToString();
                    dtSetting.SetValue("dfltExp", 0, strCode);

                    oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE;
                }
            }
        }
Exemple #19
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);

            initiallizing = true;


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


            loadSetting();

            oForm.Freeze(false);

            initiallizing = false;
        }
Exemple #20
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);

            initiallizing = true;

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

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

            dtHead.Rows.Add(1);


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

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


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


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



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


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

            initiallizing = false;
            getCodes();
        }
Exemple #21
0
        public override void etAfterCfl(ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent)
        {
            base.etAfterCfl(ref pVal, ref BubbleEvent);
            SAPbouiCOM.IChooseFromListEvent oCFLEvento = (SAPbouiCOM.IChooseFromListEvent)pVal;
            SAPbouiCOM.DataTable            dtSel      = oCFLEvento.SelectedObjects;
            try
            {
                if (pVal.ItemUID == txSupplier.Item.UniqueID)
                {
                    if (dtSel != null && dtSel.Rows.Count > 0)
                    {
                        string strCode = dtSel.GetValue("CardCode", 0).ToString();
                        string strName = dtSel.GetValue("CardName", 0).ToString();
                        oForm.DataSources.UserDataSources.Item("txSupplier").ValueEx = strCode;
                        oForm.DataSources.UserDataSources.Item("txPD").ValueEx       = DateTime.Now.Date.ToString("yyyyMMdd");

                        // oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE;
                    }
                }
            }
            catch { }
        }
        private void ChooseFromListAfterEvent(ItemEvent pObjValEvent)
        {
            try
            {
                if (pObjValEvent.Action_Success)
                {
                    SAPbouiCOM.IChooseFromListEvent lObjCFLEvento = (SAPbouiCOM.IChooseFromListEvent)pObjValEvent;
                    if (lObjCFLEvento.SelectedObjects != null)
                    {
                        SAPbouiCOM.DataTable lObjDataTable = lObjCFLEvento.SelectedObjects;

                        if (lObjDataTable != null)
                        {
                            this.UIAPIRawForm.DataSources.UserDataSources.Item(lObjDataTable.UniqueID).ValueEx = System.Convert.ToString(lObjDataTable.GetValue(0, 0));

                            switch (lObjDataTable.UniqueID)
                            {
                            case "CFL_Area":
                                string lStrArea = lObjDataTable.GetValue(0, 0).ToString();
                                this.UIAPIRawForm.DataSources.UserDataSources.Item("CFL_Area").ValueEx   = lStrArea;
                                this.UIAPIRawForm.DataSources.UserDataSources.Item("CFL_Employ").ValueEx = "";
                                AddConditionChoseFromListEmployee(mObjCFLEmployee, mObjPurchasesServiceFactory.GetPurchaseService().GetDepartment(lStrArea));
                                break;

                            case "CFL_Employ":
                                this.UIAPIRawForm.DataSources.UserDataSources.Item("CFL_Employ").ValueEx = lObjDataTable.GetValue(2, 0).ToString() + " " + lObjDataTable.GetValue(3, 0).ToString() + lObjDataTable.GetValue(1, 0).ToString();
                                mStrEmployeId = lObjDataTable.GetValue(0, 0).ToString();
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogService.WriteError("frmSearchRefunds (ChooseFromListAfterEvent) " + ex.Message);
                LogService.WriteError(ex);
            }
        }
        public static SAPbouiCOM.Grid AddGridAoFormulario(
            SAPbouiCOM.Form pForm
            , string pUID
            , int pLeft
            , int pWidth
            , int pTop
            , int pHeight
            , SAPbouiCOM.BoMatrixSelect pBoMatrixSelect
            , SAPbouiCOM.DataTable pDataTable)
        {
            SAPbouiCOM.Grid oGrid;

            SAPbouiCOM.Item oItem = pForm.Items.Add(pUID, SAPbouiCOM.BoFormItemTypes.it_GRID);
            oGrid               = ((SAPbouiCOM.Grid)(oItem.Specific));
            oGrid.Item.Left     = pLeft;
            oGrid.Item.Top      = pTop;
            oGrid.Item.Height   = pHeight;
            oGrid.Item.Width    = pWidth;
            oGrid.SelectionMode = pBoMatrixSelect;
            oGrid.DataTable     = pDataTable;

            return(oGrid);
        }
Exemple #24
0
        private void ChooseFromListAfterEvent(SAPbouiCOM.ItemEvent pObjValEvent)
        {
            if (pObjValEvent.Action_Success)
            {
                SAPbouiCOM.IChooseFromListEvent lObjCFLEvento = (SAPbouiCOM.IChooseFromListEvent)pObjValEvent;
                SAPbouiCOM.DataTable            lObjDataTable = lObjCFLEvento.SelectedObjects;
                if (lObjCFLEvento.SelectedObjects == null)
                {
                    return;
                }

                if (lObjDataTable.UniqueID == "CFL_Item")
                {
                    txtCode.Value = Convert.ToString(lObjDataTable.GetValue(0, 0));
                    this.UIAPIRawForm.DataSources.UserDataSources.Item("CFL_Item").ValueEx = Convert.ToString(lObjDataTable.GetValue(1, 0));
                    requireBagsField = lObjDistributionDAO.GetIsBagRequired(txtCode.Value);
                }
                else if (lObjDataTable.UniqueID == "CFL_Whs")
                {
                    this.UIAPIRawForm.DataSources.UserDataSources.Item("CFL_Whs").ValueEx = Convert.ToString(lObjDataTable.GetValue(0, 0));
                }
            }
        }
Exemple #25
0
        private void InitiallizeForm()
        {
            //  dtHead = oForm.DataSources.DataTables.Item("dtHead");
            // dtHead.Rows.Add(1);

            oForm.Freeze(true);

            dtDetail = oForm.DataSources.DataTables.Item("dtDetail");
            dtHead   = oForm.DataSources.DataTables.Item("dtHead");
            dtDetail.Rows.Add(1);
            mtDet = oForm.Items.Item("mtDet").Specific;

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



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

            mtDet.LoadFromDataSource();

            oForm.Freeze(false);
        }
        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
Exemple #27
0
        private static void flushAll()
        {
            SAPbouiCOM.Grid oGrid;
            oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("4").Specific;
            SAPbouiCOM.DataTable dtHistory = oGrid.DataTable;
            oSOForm.Freeze(true);

            try
            {
                using (var progress = SboProgressBar.Create("Please Wait while system prepare sales order for selected item(s) ", 100, oForm, 400))
                {
                    System.Data.DataTable dtSelItems = new System.Data.DataTable();
                    dtSelItems.Columns.Add("ItemCode");
                    dtSelItems.Columns.Add("Quantity");
                    dtSelItems.Columns.Add("Price");
                    dtSelItems.Columns.Add("UOM");



                    int rowCount = 1;

                    for (int dtrown = 0; dtrown < dtHistory.Rows.Count; dtrown++)
                    {
                        string strQty = dtHistory.GetValue("Order Qty", dtrown).ToString().Trim();

                        if (strQty != "0" && strQty != "")
                        {
                            string strItemCode = oGrid.DataTable.GetValue("ItemCode", dtrown).ToString().Trim();
                            string strPrice    = oGrid.DataTable.GetValue("Current Purchase Price", dtrown).ToString().Trim();
                            string strUoM      = oGrid.DataTable.GetValue("UoM", dtrown).ToString().Trim();

                            dtSelItems.Rows.Add(strItemCode, strQty, strPrice, strUoM);



                            rowCount++;
                        }
                    }

                    if (dtSelItems.Rows.Count > 0)
                    {
                        for (int m = oMatrix.RowCount; m >= 1; m--)
                        {
                            oMatrix.DeleteRow(1);
                        }

                        progress.Value += 10;

                        rowCount = 1;
                        oMatrix.AddRow(dtSelItems.Rows.Count);
                        int incrmentVal = 90 / dtSelItems.Rows.Count;

                        foreach (System.Data.DataRow dr in dtSelItems.Rows)
                        {
                            if (progress.Value <= 100)
                            {
                                progress.Value += incrmentVal;
                            }
                            progress.Text = "Please Wait while system prepare document for selected item(s) " + dr["ItemCode"].ToString();
                            ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("1", rowCount)).Value  = dr["ItemCode"].ToString();
                            ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("11", rowCount)).Value = dr["Quantity"].ToString();
                            try
                            {
                                ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("1470002145", rowCount)).Value = dr["UOM"].ToString();
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("14", rowCount)).Value = dr["Price"].ToString();
                            }
                            catch (Exception)
                            {
                            }

                            rowCount++;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                oSOForm.Freeze(false);
            }
        }
Exemple #28
0
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

            try
            {
                oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
                FSBOf.LoadForm(xmlPath, "VID_FEIMPADIC.srf", uid);
                oForm                = FSBOApp.Forms.Item(uid);
                oForm.AutoManaged    = false;
                oForm.SupportedModes = -1;             // afm_All
                Flag = false;
                oForm.Freeze(true);

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select count(*) Cont from [@VID_FEIMPADIC]";
                }
                else
                {
                    s = @"select count(*) ""Cont"" from ""@VID_FEIMPADIC"" ";
                }
                oRecordSet.DoQuery(s);
                if ((System.Int32)(oRecordSet.Fields.Item("Cont").Value) > 0)
                {
                    oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                }
                else
                {
                    oForm.Mode = BoFormMode.fm_ADD_MODE;
                }


                oGrid       = (Grid)(oForm.Items.Item("3").Specific);
                oDBDSHeader = oForm.DataSources.DBDataSources.Add("@VID_FEIMPADIC");

                oDataTable = oForm.DataSources.DataTables.Add("Tax");
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select Code, U_CodImpto, U_Desc, U_Porc from [@VID_FEIMPADIC]
                          UNION ALL 
                          select CAST('' as varchar(20)), CAST('' as varchar(20)), CAST('' as varchar(50)), 0";
                }
                else
                {
                    s = @"select ""Code"", ""U_CodImpto"", ""U_Desc"", ""U_Porc"" from ""@VID_FEIMPADIC""
                          UNION ALL
                          select CAST('' as varchar(20)), CAST('' as varchar(20)), CAST('' as varchar(50)), 0 FROM DUMMY ";
                }

                oDataTable.ExecuteQuery(s);
                oGrid.DataTable = oDataTable;

                oGrid.Columns.Item("Code").Type = BoGridColumnType.gct_ComboBox;
                oColumn = (GridColumn)(oGrid.Columns.Item("Code"));
                var oComboCol = (ComboBoxColumn)(oColumn);
                oComboCol.Editable            = true;
                oComboCol.TitleObject.Caption = "Impuesto SAP";

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select Code, Name from OSTA
                          UNION ALL
                          select WTCode 'Code', WTName 'Name' from OWHT where Inactive = 'N'";
                }
                else
                {
                    s = @"select ""Code"", ""Name"" from ""OSTA""
                          UNION ALL
                          select ""WTCode"" ""Code"", ""WTName"" ""Name"" from ""OWHT"" where ""Inactive"" = 'N' ";
                }

                oRecordSet.DoQuery(s);
                FSBOf.FillComboGrid((GridColumn)(oGrid.Columns.Item("Code")), ref oRecordSet, true);

                oGrid.Columns.Item("U_CodImpto").Type = BoGridColumnType.gct_EditText;
                oColumn = (GridColumn)(oGrid.Columns.Item("U_CodImpto"));
                var oEditCol = (EditTextColumn)(oColumn);
                oEditCol.Editable            = true;
                oEditCol.TitleObject.Caption = "Código Impto. SII";


                oGrid.Columns.Item("U_Desc").Type = BoGridColumnType.gct_EditText;
                oColumn                      = (GridColumn)(oGrid.Columns.Item("U_Desc"));
                oEditCol                     = (EditTextColumn)(oColumn);
                oEditCol.Editable            = true;
                oEditCol.TitleObject.Caption = "Descripción Impuesto";

                oGrid.Columns.Item("U_Porc").Type = BoGridColumnType.gct_EditText;
                oColumn                      = (GridColumn)(oGrid.Columns.Item("U_Porc"));
                oEditCol                     = (EditTextColumn)(oColumn);
                oEditCol.Editable            = true;
                oEditCol.TitleObject.Caption = "Porcentaje Retencion";
                oEditCol.RightJustified      = true;

                oGrid.AutoResizeColumns();
            }
            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
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            //SAPbouiCOM.ComboBox oCombo;
            SAPbouiCOM.GridColumn oColumn;
            bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

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

                FSBOf.LoadForm(xmlPath, "VID_FECAF.srf", uid);
                //EnableCrystal := true;
                oForm = FSBOApp.Forms.Item(uid);
                oForm.Freeze(true);
                oForm.AutoManaged    = false;
                oForm.SupportedModes = -1;       // afm_All
                oForm.EnableMenu("1281", false); //Buscar
                oForm.EnableMenu("1282", false); //Crear

                //        VID_DelRow := true;
                //        VID_DelRowOK := true;

                //        oForm.DataBrowser.BrowseBy := "Code";
                oDBDSH     = oForm.DataSources.DBDataSources.Add("@VID_FECAF");
                ogrid      = (Grid)(oForm.Items.Item("grid").Specific);
                oDataTable = oForm.DataSources.DataTables.Add("dt");

                ogrid.DataTable = oDataTable;

                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).Trim() == "Y")
                    {
                        bMultiSoc = true;
                    }
                    else
                    {
                        bMultiSoc = false;
                    }
                }
                else
                {
                    bMultiSoc = false;
                }


                ActualizarGrilla();
                // Ok Ad  Fnd Vw Rq Sec
                //        Lista.Add('TipoDoc   , f,  t,  t,  f, r, 1');
                //        FSBOf.SetAutoManaged(var oForm, Lista);

                oForm.Mode = BoFormMode.fm_OK_MODE;
            }
            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
Exemple #30
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");
        }