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
        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_FEListaNegra.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

                ogrid           = ((Grid)oForm.Items.Item("ogrid").Specific);
                oDBDSHeader     = ((DBDataSource)oForm.DataSources.DBDataSources.Item("@VID_FELISTANE"));
                ogrid.DataTable = oForm.DataSources.DataTables.Add("dt");

                AddChooseFromList();
                CargarGrid();
            }
            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
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            //SAPbouiCOM.ComboBox oComboBox;
            SAPbouiCOM.Column oColumn;

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

            try
            {
                oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));

                //Lista    := New list<string>;

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

                oForm.EnableMenu("1281", false); //Actualizar
                oForm.EnableMenu("1282", false); //Crear

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

                oForm.DataSources.UserDataSources.Add("Hasta", BoDataType.dt_DATE, 10);
                oEditText = (EditText)(oForm.Items.Item("Hasta").Specific);
                oEditText.DataBind.SetBound(true, "", "Hasta");
                oEditText.Value = DateTime.Now.ToString("yyyyMMdd");
            }
            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
Beispiel #4
0
        public virtual void CreateForm(SAPbouiCOM.Application SboApp, string strXml, SAPbobsCOM.Company cmp, string frmId)
        {
            formId       = frmId;
            frmXml       = strXml;
            oCompany     = cmp;
            oApplication = SboApp;

            oApplication.ItemEvent       += new _IApplicationEvents_ItemEventEventHandler(oApplication_ItemEvent);
            oApplication.RightClickEvent += new _IApplicationEvents_RightClickEventEventHandler(oApplication_RightClickEvent);
            oApplication.AppEvent        += new _IApplicationEvents_AppEventEventHandler(oApplication_AppEvent);
            oApplication.MenuEvent       += new _IApplicationEvents_MenuEventEventHandler(oApplication_MenuEvent);

            UDClass clsudo = Program.objHrmsUI;

            setFilter();
            try
            {
                clsudo.AddXML(strXml);
                oForm = oApplication.Forms.Item(frmId);
            }
            catch (Exception ex)
            {
                try
                {
                    oForm = oApplication.Forms.Item(frmId);
                    oForm.Select();
                }
                catch (Exception ex1)
                {
                    oApplication.StatusBar.SetText(ex1.Message);
                }
            }
            oForm.EnableMenu("1282", true);  // Add New Record
            oForm.EnableMenu("1288", true);  // Next Record
            oForm.EnableMenu("1289", true);  // Pevious Record
            oForm.EnableMenu("1290", true);  // First Record
            oForm.EnableMenu("1291", true);  // Last record
            oForm.EnableMenu("1281", true);  // Find record

            string mnuId = frmId.Replace("frm", "mnu");

            //isFormReadOnly(mnuId);
        }
Beispiel #5
0
 public virtual void ET_AFRightClick(ContextMenuInfo pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     // ADD YOUR ACTION CODE HERE ...
     oForm.EnableMenu("1283", true); //제거
 }
Beispiel #6
0
        public virtual bool ET_BFRightClick(ContextMenuInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            // ADD YOUR ACTION CODE HERE ...

            if ((oForm.Mode == BoFormMode.fm_OK_MODE) && ((oForm.Items.Item("edtJDTDOC").Specific.value == "") || (oForm.Items.Item("edtRJDTDOC").Specific.value != "")))
                oForm.EnableMenu("1283", true); //제거
            else
                oForm.EnableMenu("1283", false); //제거

            return true;
        }
Beispiel #7
0
        public virtual bool ET_mtx2_DUMY_BFClick(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx2_DUMY").Specific));
            // ADD YOUR ACTION CODE HERE ...

            string USERID = string.Empty;

            if (oForm.Mode == BoFormMode.fm_ADD_MODE || oForm.Mode == BoFormMode.fm_UPDATE_MODE || oForm.Mode == BoFormMode.fm_OK_MODE)
            {
                USERID = B1Connections.diCompany.UserName.ToString();
                if ((oMatrix.VisualRowCount > 0) && (pVal.Row > 0))
                {
                    if (oMatrix.GetCellSpecific("U_RECVID", pVal.Row).Value.Trim() != USERID)
                    {
                        oForm.EnableMenu("1293", false); //행삭제
                    }
                    else
                    {
                        oForm.EnableMenu("1293", true); //행삭제
                    }
                }
                else
                    oForm.EnableMenu("1293", false); //행삭제
          
                oForm.EnableMenu("1292", true);//행추가
                gRowIdx = pVal.Row;
                gSelMtx = pVal.ItemUID;
            }
            return true;
        }
Beispiel #8
0
        public virtual void ET_mtx1_AFRightClick(ContextMenuInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
            // ADD YOUR ACTION CODE HERE ...

            iRightRowIndex = -1;

            try
            {

                if (B1Connections.theAppl.Menus.Item("1293").Enabled == true)
                {
                    oForm.EnableMenu("1293", false);//행삭제 비활성
                }
                if (B1Connections.theAppl.Menus.Exists("SUB_BASEDOC"))
                {
                    B1Connections.theAppl.Menus.RemoveEx("SUB_BASEDOC");//기준전표 메뉴 삭제
                }
                if (B1Connections.theAppl.Menus.Exists("SUB_TARGETDOC"))
                {
                    B1Connections.theAppl.Menus.RemoveEx("SUB_TARGETDOC");//대상전표 메뉴 삭제
                }

            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
Beispiel #9
0
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            //SAPbouiCOM.ComboBox oComboBox;
            SAPbouiCOM.Column oColumn;

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

            try
            {
                oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));

                //Lista    := New list<string>;

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

                oForm.EnableMenu("1281", false); //Actualizar
                oForm.EnableMenu("1282", false); //Crear

                oForm.DataSources.UserDataSources.Add("TipoLibro", BoDataType.dt_SHORT_TEXT);
                oComboBox = (ComboBox)(oForm.Items.Item("TipoLibro").Specific);
                oComboBox.DataBind.SetBound(true, "", "TipoLibro");
                oComboBox.ValidValues.Add("V", "Venta");
                oComboBox.ValidValues.Add("C", "Compra");
                oComboBox.ValidValues.Add("B", "Boletas");
                oComboBox.ValidValues.Add("G", "Guias");
                oComboBox.Select("V", BoSearchKey.psk_ByValue);

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

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

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

                if (bMultiSoc)
                {
                    oForm.Items.Item("LInstituto").Visible = true;
                    oForm.Items.Item("Instituto").Visible  = true;
                    oComboBox = (ComboBox)(oForm.Items.Item("Instituto").Specific);
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"select DocEntry, U_Sociedad 'Sociedad' from [@VID_FEMULTISOC] where isnull(U_Habilitada,'N') = 'Y'";
                    }
                    else
                    {
                        s = @"select ""DocEntry"", ""U_Sociedad"" ""Sociedad"" from ""@VID_FEMULTISOC"" where IFNULL(""U_Habilitada"",'N') = 'Y' ";
                    }
                    oRecordSet.DoQuery(s);
                    while (!oRecordSet.EoF)
                    {
                        oComboBox.ValidValues.Add(((System.Int32)oRecordSet.Fields.Item("DocEntry").Value).ToString(), ((System.String)oRecordSet.Fields.Item("Sociedad").Value).Trim());
                        oRecordSet.MoveNext();
                    }
                }
                else
                {
                    oForm.Items.Item("LInstituto").Visible = false;
                    oForm.Items.Item("Instituto").Visible  = false;
                }
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            oForm.Freeze(false);
            return(Result);
        }//fin InitForm
Beispiel #10
0
        public virtual bool ET_BFRowDataMenu_Delete(MenuEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.ActiveForm;
            // ADD YOUR ACTION CODE HERE ...

            //oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0420T_HRD");
            string strSTATUS = oForm.DataSources.UserDataSources.Item("U_STATUS").Value;
            if (strSTATUS == "R")
                return false;
            else
            {
                oForm.EnableMenu(SO.MenuProperty.DeleteRow, false);
                return true;
            }            
        }       
Beispiel #11
0
        public virtual bool ET_mtx1_BFRightClick(ContextMenuInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
            // ADD YOUR ACTION CODE HERE ...

            iRightRowIndex = pVal.Row;

            try
            {
                if (oForm.Mode == BoFormMode.fm_ADD_MODE || oForm.Mode == BoFormMode.fm_OK_MODE || oForm.Mode == BoFormMode.fm_UPDATE_MODE)
                {
                    if (pVal.Row > 0 && pVal.Row <= oMatrix.VisualRowCount)
                    {
                        oForm.EnableMenu("1293", true);//행삭제
                    }


                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            return true;
        }
        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));

                //Lista    := New list<string>;

                FSBOf.LoadForm(xmlPath, "VID_FEDetalleLog.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

                //oForm.DataBrowser.BrowseBy := "DocNum";

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

                //s := '1';
                //oCombo.Select(s, BoSearchKey.psk_ByValue);

                oForm.Items.Item("grid").Enabled = false;
                ogrid           = (Grid)(oForm.Items.Item("grid").Specific);
                dt              = oForm.DataSources.DataTables.Add("dt");
                ogrid.DataTable = dt;

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select U_TipoDoc
                              ,LTRIM(STR(U_FolioNum,18,0)) 'U_FolioNum'
                              ,U_ID_Log
                              ,U_Glosa
                              ,U_FechaIn
                          from [@VID_FELOG] T0
                          join [@VID_FELOGD] T1 ON T1.DocEntry = T0.DocEntry
                         where T0.DocEntry = {0}
                         order by T1.LineId DESC";
                }
                else
                {
                    s = @"select ""U_TipoDoc""
                              ,LTRIM(ROUND(""U_FolioNum"",0)) ""U_FolioNum""
                              ,""U_ID_Log""
                              ,""U_Glosa""
                              ,""U_FechaIn""
                          from ""@VID_FELOG"" T0 
                          join ""@VID_FELOGD"" T1 ON T1.""DocEntry"" = T0.""DocEntry""
                         where T0.""DocEntry"" = {0}
                         order by T1.""LineId"" DESC ";
                }

                s = String.Format(s, prmKey);
                dt.ExecuteQuery(s);
                ogrid.AutoResizeColumns();

                ogrid.Columns.Item("U_TipoDoc").Type = BoGridColumnType.gct_EditText;
                oColumn = (GridColumn)(ogrid.Columns.Item("U_TipoDoc"));
                var oEditColumn = (EditTextColumn)(oColumn);
                oEditColumn.Editable            = false;
                oEditColumn.TitleObject.Caption = "Tipo Documento";
                oEditColumn.RightJustified      = true;

                ogrid.Columns.Item("U_FolioNum").Type = BoGridColumnType.gct_EditText;
                oColumn                         = (GridColumn)(ogrid.Columns.Item("U_FolioNum"));
                oEditColumn                     = (EditTextColumn)(oColumn);
                oEditColumn.Editable            = false;
                oEditColumn.TitleObject.Caption = "Número Folio";
                oEditColumn.RightJustified      = true;

                ogrid.Columns.Item("U_ID_Log").Type = BoGridColumnType.gct_EditText;
                oColumn                         = (GridColumn)(ogrid.Columns.Item("U_ID_Log"));
                oEditColumn                     = (EditTextColumn)(oColumn);
                oEditColumn.Editable            = false;
                oEditColumn.TitleObject.Caption = "ID Log Portal";
                oEditColumn.RightJustified      = true;

                ogrid.Columns.Item("U_Glosa").Type = BoGridColumnType.gct_EditText;
                oColumn                         = (GridColumn)(ogrid.Columns.Item("U_Glosa"));
                oEditColumn                     = (EditTextColumn)(oColumn);
                oEditColumn.Editable            = false;
                oEditColumn.TitleObject.Caption = "Glosa";
                oEditColumn.RightJustified      = false;

                ogrid.Columns.Item("U_FechaIn").Type = BoGridColumnType.gct_EditText;
                oColumn                         = (GridColumn)(ogrid.Columns.Item("U_FechaIn"));
                oEditColumn                     = (EditTextColumn)(oColumn);
                oEditColumn.Editable            = false;
                oEditColumn.TitleObject.Caption = "Fecha Movimiento";
                oEditColumn.RightJustified      = false;

                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
Beispiel #13
0
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            //SAPbouiCOM.ComboBox oComboBox;
            //SAPbouiCOM.Column oColumn;

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

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

            try
            {
                oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));

                //Lista    := New list<string>;

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

                oForm.EnableMenu("1281", false); //Actualizar
                oForm.EnableMenu("1282", false); //Crear

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

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


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

                if (bMultiSoc)
                {
                    oForm.Items.Item("LInstituto").Visible = true;
                    oForm.Items.Item("Instituto").Visible  = true;
                    oComboBox = (ComboBox)(oForm.Items.Item("Instituto").Specific);
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"select DocEntry, U_Sociedad 'Sociedad' from [@VID_FEMULTISOC] where isnull(U_Habilitada,'N') = 'Y'";
                    }
                    else
                    {
                        s = @"select ""DocEntry"", ""U_Sociedad"" ""Sociedad"" from ""@VID_FEMULTISOC"" where IFNULL(""U_Habilitada"",'N') = 'Y' ";
                    }
                    oRecordSet.DoQuery(s);
                    while (!oRecordSet.EoF)
                    {
                        oComboBox.ValidValues.Add(((System.Int32)oRecordSet.Fields.Item("DocEntry").Value).ToString(), ((System.String)oRecordSet.Fields.Item("Sociedad").Value).Trim());
                        oRecordSet.MoveNext();
                    }
                }
                else
                {
                    oForm.Items.Item("LInstituto").Visible = false;
                    oForm.Items.Item("Instituto").Visible  = false;
                }
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            oForm.Freeze(false);
            return(Result);
        }//fin InitForm
Beispiel #14
0
        public virtual void ET_grd_AFRightClick(ContextMenuInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oGrid = ((SAPbouiCOM.Grid)(oForm.Items.Item("grd").Specific));
            // ADD YOUR ACTION CODE HERE ...
            oForm.EnableMenu(SO.MenuProperty.AddRow, false);

            if (B1Connections.theAppl.Menus.Exists("SUB_RECALC"))
            {
                B1Connections.theAppl.Menus.RemoveEx("SUB_RECALC");//기준전표 메뉴 삭제
            }
        }
Beispiel #15
0
        public virtual bool ET_grd_BFRightClick(ContextMenuInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oGrid = ((SAPbouiCOM.Grid)(oForm.Items.Item("grd").Specific));
            // ADD YOUR ACTION CODE HERE ...
            if (BeforModifyData_CheckDocumentStatus(oForm))
            {
                oForm.EnableMenu(SO.MenuProperty.AddRow, true);

            }

            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0150T_HRD");
            if (pVal.Row > -1)
            {
                string strCloseYymm = oDB_M.GetValue("U_YYYYMM", 0).Trim();
                string strSaleYyMm = FN.GetGridCellValue(ref oGrid, "U_SALYM", pVal.Row);
                string strStatus = FN.GetGridCellValue(ref oGrid, "ROWSTAT", pVal.Row);

                //메뉴추가
                SAPbouiCOM.MenuItem oMenuItem;
                SAPbouiCOM.Menus oMenus;
                SAPbouiCOM.MenuCreationParams oCreationPackage = (SAPbouiCOM.MenuCreationParams)B1Connections.theAppl.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams);

                if (strStatus == "R" && strCloseYymm == strSaleYyMm && !B1Connections.theAppl.Menus.Exists("SUB_RECALC"))
                {
                    oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING;
                    oCreationPackage.UniqueID = "SUB_RECALC"; // ID에 무조건 SUB 를 붙여야 이벤트 작동
                    oCreationPackage.String = "청구 재실행(&Q)";
                    oCreationPackage.Enabled = true;
                    oMenuItem = B1Connections.theAppl.Menus.Item("1280"); //'Data'
                    oMenus = oMenuItem.SubMenus;
                    oMenus.AddEx(oCreationPackage);
                }
                oCreationPackage = null;
            }

            return true;
        }
Beispiel #16
0
 public virtual void ET_AFRightClick(ContextMenuInfo pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     // ADD YOUR ACTION CODE HERE ...
     try
     {
         if (oForm.Mode == BoFormMode.fm_ADD_MODE || oForm.Mode == BoFormMode.fm_OK_MODE || oForm.Mode == BoFormMode.fm_UPDATE_MODE)
         {
             if (B1Connections.theAppl.Menus.Item("1283").Enabled == true)
             {
                 oForm.EnableMenu("1283", false);//제거
             }
         }
     }
     catch (Exception ex)
     {
         B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
     }
 }
Beispiel #17
0
        public virtual bool ET_BFRightClick(ContextMenuInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                if (oForm.Mode == BoFormMode.fm_ADD_MODE || oForm.Mode == BoFormMode.fm_OK_MODE || oForm.Mode == BoFormMode.fm_UPDATE_MODE)
                {
                    string edtJDTDOC = FN.GetItemValue(ref oForm, "edtJDTDOC");
                    string edtRJDTDOC = FN.GetItemValue(ref oForm, "edtRJDTDOC");

                    if (string.IsNullOrEmpty(edtJDTDOC) || (!string.IsNullOrEmpty(edtJDTDOC) && !string.IsNullOrEmpty(edtRJDTDOC)))
                    {
                        oForm.EnableMenu("1283", true);//제거
                    }
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            return true;
        }
Beispiel #18
0
        public virtual bool ET_BFRightClick(ContextMenuInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                SAPbouiCOM.DBDataSource oKIS_TR0041T_HRD = oForm.DataSources.DBDataSources.Item("@KIS_TR0041T_HRD");

                if (oKIS_TR0041T_HRD.GetValue("U_ISTRANS", 0).Trim() != "Y")
                {
                    oForm.EnableMenu("1283", true);
                }

                oKIS_TR0041T_HRD = null;
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            return true;
        }
Beispiel #19
0
        public virtual bool ET_mtx2_BFClick(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx2").Specific));
            // ADD YOUR ACTION CODE HERE ...

            if (oForm.Mode == BoFormMode.fm_ADD_MODE || oForm.Mode == BoFormMode.fm_UPDATE_MODE || oForm.Mode == BoFormMode.fm_OK_MODE)
            {
                oForm.EnableMenu("1292", true);//행추가
                oForm.EnableMenu("1293", true);//행삭제                
                gSelMtx = pVal.ItemUID;
            }
            return true;
        }
Beispiel #20
0
        public virtual bool ET_mtx_BFRightClick(ContextMenuInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx").Specific));
            // ADD YOUR ACTION CODE HERE ...

            if (oForm.Mode == BoFormMode.fm_ADD_MODE)
            {
                oForm.EnableMenu("1292", true);//행추가
                oForm.EnableMenu("1293", true);//행삭제                
            }
            else if (oForm.Mode == BoFormMode.fm_UPDATE_MODE || oForm.Mode == BoFormMode.fm_OK_MODE)
            {
                oForm.EnableMenu("1292", true);//행추가
                if (pVal.Row > 0)
                {
                    //string strNowDate = B1Connections.diCompany.GetCompanyDate().ToShortDateString();
                    //string strInDate = FN.GetMatirxCellValue(ref oMatrix, "U_DATE", pVal.Row);

                    //// 현재일자보다 이전 일자는 행삭제 하지 못한다.
                    //if (string.IsNullOrEmpty(strInDate) == false && strInDate.Replace(".", "").CompareTo(strNowDate.Replace("-", "")) < 0)
                    //    return false;
                    //else
                    //    oForm.EnableMenu("1293", true);//행삭제
                }
            }
            return true;
        }
Beispiel #21
0
 public virtual bool ET_BFRightClick(ContextMenuInfo pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     // ADD YOUR ACTION CODE HERE ...
     oForm.EnableMenu("1293", false); //행삭제
     return true;
 }
Beispiel #22
0
 public virtual void ET_mtx_AFRightClick(ContextMenuInfo pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx").Specific));
     // ADD YOUR ACTION CODE HERE ...
     oForm.EnableMenu(SO.MenuProperty.DeleteRow, 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
Beispiel #24
0
        public virtual bool ET_BFRightClick(ContextMenuInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            // ADD YOUR ACTION CODE HERE ...

            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0400T_HRD");
            if (SO.SO_COMMON_HRD.Authority == SO.SO_COMMON_HRD.AuthorityType.None && oDB_M.GetValue("U_STATUS", 0).Trim() == "R")
                oForm.EnableMenu("1283", false); //제거
            return true;
        }
Beispiel #25
0
        public virtual void ET_mtx1_AFRightClick(ContextMenuInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
            // ADD YOUR ACTION CODE HERE ...

            iRightRowIndex = -1;

            try
            {
                if (oForm.Mode == BoFormMode.fm_ADD_MODE || oForm.Mode == BoFormMode.fm_OK_MODE || oForm.Mode == BoFormMode.fm_UPDATE_MODE)
                {
                    if (B1Connections.theAppl.Menus.Item("1293").Enabled == true)
                    {
                        oForm.EnableMenu("1293", false);//행삭제
                    }
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
Beispiel #26
0
 public virtual bool ET_mtx_BFRightClick(ContextMenuInfo pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx").Specific));
     // ADD YOUR ACTION CODE HERE ...
     if (pVal.Row > 0)
     {
         //oForm.EnableMenu("1293", true); //행삭제
     }
     else
     {
         oForm.EnableMenu("1293", false); //행삭제
     }
     return true;
 }
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            //SAPbouiCOM.ComboBox oComboBox;
            SAPbouiCOM.Column oColumn;

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

            try
            {
                oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));

                //Lista    := New list<string>;

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

                oForm.EnableMenu("1281", false); //Actualizar
                oForm.EnableMenu("1282", false); //Crear

                oDataTable      = oForm.DataSources.DataTables.Add("dt");
                ogrid           = (SAPbouiCOM.Grid)(oForm.Items.Item("grid").Specific);
                ogrid.DataTable = oDataTable;
                if (TipoLibro == "V")
                {
                    oForm.Title = "Libro de Ventas";
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = "select isnull(U_ProcVenta,'') Libro from [@VID_FEPARAM]";
                    }
                    else
                    {
                        s = @"select IFNULL(""U_ProcVenta"",'') ""Libro"" from ""@VID_FEPARAM"" ";
                    }
                }
                else if (TipoLibro == "C")
                {
                    oForm.Title = "Libro de Compras";
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = "select isnull(U_ProcCompra,'') Libro from [@VID_FEPARAM]";
                    }
                    else
                    {
                        s = @"select IFNULL(""U_ProcCompra"",'') ""Libro"" from ""@VID_FEPARAM"" ";
                    }
                }
                else if (TipoLibro == "G")
                {
                    oForm.Title = "Libro de Guias";
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = "select isnull(U_ProcGuia,'') Libro from [@VID_FEPARAM]";
                    }
                    else
                    {
                        s = @"select IFNULL(""U_ProcGuia"",'') ""Libro"" from ""@VID_FEPARAM"" ";
                    }
                }
                else if (TipoLibro == "B")
                {
                    oForm.Title = "Libro de Boletas";
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = "select isnull(U_ProcBol,'') Libro from [@VID_FEPARAM]";
                    }
                    else
                    {
                        s = @"select IFNULL(""U_ProcBol"",'') ""Libro"" from ""@VID_FEPARAM"" ";
                    }
                }

                oRecordSet.DoQuery(s);
                if (oRecordSet.RecordCount > 0)
                {
                    if ((System.String)(oRecordSet.Fields.Item("Libro").Value) != "")
                    {
                        Query((System.String)(oRecordSet.Fields.Item("Libro").Value));
                    }
                }
            }
            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
        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));

                //Lista    := New list<string>;

                FSBOf.LoadForm(xmlPath, "VID_Monitor.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);

                oDBDSHeader = oForm.DataSources.DBDataSources.Add("@VID_FELOG");
                oDBDSD      = oForm.DataSources.DBDataSources.Add("@VID_FELOGD");

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

                oForm.DataSources.UserDataSources.Add("chk_Todo", BoDataType.dt_SHORT_TEXT, 1);
                oCheckBox = (CheckBox)(oForm.Items.Item("chk_Todo").Specific);
                oCheckBox.DataBind.SetBound(true, "", "chk_Todo");
                oCheckBox.ValOn   = "Y";
                oCheckBox.ValOff  = "N";
                oCheckBox.Checked = false;

                oForm.DataSources.UserDataSources.Add("Rechazados", BoDataType.dt_SHORT_TEXT, 1);
                oCheckBox = (CheckBox)(oForm.Items.Item("Rechazados").Specific);
                oCheckBox.DataBind.SetBound(true, "", "Rechazados");
                oCheckBox.ValOn   = "Y";
                oCheckBox.ValOff  = "N";
                oCheckBox.Checked = true;

                oForm.DataSources.UserDataSources.Add("Pendientes", BoDataType.dt_SHORT_TEXT, 1);
                oCheckBox = (CheckBox)(oForm.Items.Item("Pendientes").Specific);
                oCheckBox.DataBind.SetBound(true, "", "Pendientes");
                oCheckBox.ValOn   = "Y";
                oCheckBox.ValOff  = "N";
                oCheckBox.Checked = true;

                oForm.DataSources.UserDataSources.Add("Aceptados", BoDataType.dt_SHORT_TEXT, 1);
                oCheckBox = (CheckBox)(oForm.Items.Item("Aceptados").Specific);
                oCheckBox.DataBind.SetBound(true, "", "Aceptados");
                oCheckBox.ValOn   = "Y";
                oCheckBox.ValOff  = "N";
                oCheckBox.Checked = false;

                oForm.DataSources.UserDataSources.Add("DadoBaja", BoDataType.dt_SHORT_TEXT, 1);
                oCheckBox = (CheckBox)(oForm.Items.Item("DadoBaja").Specific);
                oCheckBox.DataBind.SetBound(true, "", "DadoBaja");
                oCheckBox.ValOn   = "Y";
                oCheckBox.ValOff  = "N";
                oCheckBox.Checked = false;

                oForm.DataSources.UserDataSources.Add("Errores", BoDataType.dt_SHORT_TEXT, 1);
                oCheckBox = (CheckBox)(oForm.Items.Item("Errores").Specific);
                oCheckBox.DataBind.SetBound(true, "", "Errores");
                oCheckBox.ValOn   = "Y";
                oCheckBox.ValOff  = "N";
                oCheckBox.Checked = true;

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

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

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

                CargarDatosPE();
            }
            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
Beispiel #30
0
        public virtual bool ET_mtx1_BFRightClick(ContextMenuInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
            // ADD YOUR ACTION CODE HERE ...

            iRightRowIndex = pVal.Row;

            try
            {
                if (oForm.Mode == BoFormMode.fm_ADD_MODE || oForm.Mode == BoFormMode.fm_OK_MODE || oForm.Mode == BoFormMode.fm_UPDATE_MODE)
                {
                    if (pVal.Row > 0 && pVal.Row <= oMatrix.VisualRowCount)
                    {
                        //문서상태가 미결이고 행상태가 미결 때만 행삭제
                        if (oForm.DataSources.UserDataSources.Item("cboSTATUS").Value == "SO")
                        {
                            SAPbouiCOM.DBDataSource oKIS_SD00301_HRD = oForm.DataSources.DBDataSources.Item("@KIS_SD00301_HRD");
                            if (oKIS_SD00301_HRD.Size>=pVal.Row)
                            {
                                if (oKIS_SD00301_HRD.GetValue("U_STATUS",pVal.Row-1).Trim() != "C")
                                {
                                    oForm.EnableMenu("1293", true);//행삭제
                                }   
                            }
                            oKIS_SD00301_HRD = null;
                        }
                    }
                }

                int oMatrixRow = oMatrix.GetNextSelectedRow();
                if (oMatrixRow > 0)
                {

                    string U_BTYPE = ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("U_BTYPE", oMatrixRow)).Value.Trim();//기준문서 유형
                    string U_TTYPE = ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("U_TTYPE", oMatrixRow)).Value.Trim();//대상문서 유형

                    //메뉴추가
                    SAPbouiCOM.MenuItem oMenuItem;
                    SAPbouiCOM.Menus oMenus;
                    SAPbouiCOM.MenuCreationParams oCreationPackage = (SAPbouiCOM.MenuCreationParams)B1Connections.theAppl.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams);


                    if (string.IsNullOrEmpty(U_BTYPE) == false)
                    {
                        oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING;
                        oCreationPackage.UniqueID = "SUB_BASEDOC";
                        oCreationPackage.String = "(&B)기준전표";
                        oCreationPackage.Enabled = true;
                        oMenuItem = B1Connections.theAppl.Menus.Item("1280"); //'Data'
                        oMenus = oMenuItem.SubMenus;
                        oMenus.AddEx(oCreationPackage);
                    }
                    if (string.IsNullOrEmpty(U_TTYPE) == false)
                    {
                        oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING;
                        oCreationPackage.UniqueID = "SUB_TARGETDOC";
                        oCreationPackage.String = "(&T)대상전표";
                        oCreationPackage.Enabled = true;

                        oMenuItem = B1Connections.theAppl.Menus.Item("1280"); //'Data'
                        oMenus = oMenuItem.SubMenus;
                        oMenus.AddEx(oCreationPackage);
                    }

                    oCreationPackage = null;

                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            return true;
        }
        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_FEDIST.srf", uid);
                //EnableCrystal := true;
                oForm = FSBOApp.Forms.Item(uid);
                oForm.Freeze(true);
                oForm.AutoManaged    = true;
                oForm.SupportedModes = -1;             // afm_All

                VID_DelRow   = false;
                VID_DelRowOK = false;

                oForm.DataBrowser.BrowseBy = "DocEntry";
                oDBDSH = oForm.DataSources.DBDataSources.Item("@VID_FEDIST");
                oDBDSD = oForm.DataSources.DBDataSources.Item("@VID_FEDISTD");

                oForm.EnableMenu("1282", false); // boton Crear

                // Ok Ad  Fnd Vw Rq Sec
                Lista.Add("DocEntry  , f,  f,  f,  f, r, 1");
                Lista.Add("Desde     , f,  t,  f,  f, r, 1");
                Lista.Add("Hasta     , f,  t,  f,  f, r, 1");
                Lista.Add("Hasta     , f,  t,  f,  f, r, 1");
                Lista.Add("Sucursal  , f,  t,  f,  f, r, 1");
                Lista.Add("RangoF    , f,  t,  t,  f, r, 1");
                Lista.Add("TipoDoc   , f,  t,  t,  f, r, 1");
                Lista.Add("btnDist   , f,  t,  f,  f, n, 1");
                FSBOf.SetAutoManaged(oForm, Lista);

                //carga tipo documentos
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select distinct U_TipoDoc 'Code', U_TipoDoc 'Name' from [@VID_FECAF]";
                }
                else
                {
                    s = @"select distinct ""U_TipoDoc"" ""Code"", ""U_TipoDoc"" ""Name"" from ""@VID_FECAF"" ";
                }
                oRecordSet.DoQuery(s);
                FSBOf.FillCombo((ComboBox)(oForm.Items.Item("TipoDoc").Specific), ref oRecordSet, true);

                //carga sucursales
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = "select Code, Name from [@VID_FESUC]";
                }
                else
                {
                    s = @"select ""Code"", ""Name"" from ""@VID_FESUC"" ";
                }
                oRecordSet.DoQuery(s);
                FSBOf.FillCombo((ComboBox)(oForm.Items.Item("Sucursal").Specific), ref oRecordSet, true);

                //        AddChooseFromList();
                oMtx = (Matrix)(oForm.Items.Item("mtx").Specific);
                //        oColumn                    := SAPbouiCOM.Column(oMtx.Columns.Item('V_0'));
                //        oColumn.ChooseFromListUID  := 'CFL0';
                //        oColumn.ChooseFromListAlias:= 'Code';

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select C1.FldValue 'Code', C1.Descr 'Name'
                           from CUFD C0
                           join UFD1 C1 on C1.TableID = C0.TableID
                                       and C1.FieldID = C0.FieldID
                          where C0.TableID = '@VID_FEDISTD'
                            and C0.AliasID = 'Estado'";
                }
                else
                {
                    s = @"select C1.""FldValue"" ""Code"", C1.""Descr"" ""Name""
                           from ""CUFD"" C0
                           join ""UFD1"" C1 on C1.""TableID"" = C0.""TableID""
                                       and C1.""FieldID"" = C0.""FieldID""
                          where C0.""TableID"" = '@VID_FEDISTD'
                            and C0.""AliasID"" = 'Estado' ";
                }
                oRecordSet.DoQuery(s);
                oColumn = (SAPbouiCOM.Column)(oMtx.Columns.Item("Estado"));
                FSBOf.FillComboMtx(oColumn, ref oRecordSet, false);

                oDBDSD.InsertRecord(0);
                oMtx.LoadFromDataSource();
                oMtx.AutoResizeColumns();

                //EditText(oForm.Items.Item('CardCode').Specific).Active := True;
                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
Beispiel #32
0
        public virtual bool ET_mtx1_DUMY_BFRightClick(ContextMenuInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1_DUMY").Specific));
            // ADD YOUR ACTION CODE HERE ...

            if (oForm.Mode == BoFormMode.fm_ADD_MODE || oForm.Mode == BoFormMode.fm_UPDATE_MODE || oForm.Mode == BoFormMode.fm_OK_MODE)
            {
                if ((oMatrix.VisualRowCount > 0) && (pVal.Row > 0))
                    oForm.EnableMenu("1293", true);//행삭제
                else
                    oForm.EnableMenu("1293", false);//행삭제

                oForm.EnableMenu("1292", true);//행추가

                gRowIdx = pVal.Row;
                gSelMtx = pVal.ItemUID;
            }
            return true;
        }
Beispiel #33
0
 public virtual bool ET_BFRightClick(ContextMenuInfo pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     // ADD YOUR ACTION CODE HERE ...  
     oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0320T_HRD");
     if (oDB_M.GetValue("U_JDTDOC", 0).Trim() != "" && oDB_M.GetValue("U_RJDTDOC", 0).Trim() != "")
         oForm.EnableMenu("1283", true); //제거
     else if (oDB_M.GetValue("U_JDTDOC", 0).Trim() != "")
         oForm.EnableMenu("1283", false); //제거
     else
         oForm.EnableMenu("1283", true); //제거
     return true;
 }
Beispiel #34
0
        public virtual void ET_mtx2_DUMY_AFRightClick(ContextMenuInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);

            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx2_DUMY").Specific));
            // ADD YOUR ACTION CODE HERE ...
            oForm.EnableMenu("1292", false);//행추가
            oForm.EnableMenu("1293", false); //행삭제

            gRowIdx = -1;
            gSelMtx = null;
        }
Beispiel #35
0
        public virtual bool ET_grd1_BFRightClick(ContextMenuInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oGrid = ((SAPbouiCOM.Grid)(oForm.Items.Item("grd1").Specific));
            // ADD YOUR ACTION CODE HERE ...

            //int oRowIndex = oGrid.GetDataTableRowIndex(pVal.Row);
            oForm.Freeze(true);
            try
            {
                if (oForm.Mode == BoFormMode.fm_ADD_MODE || oForm.Mode == BoFormMode.fm_OK_MODE || oForm.Mode == BoFormMode.fm_UPDATE_MODE)
                {
                    string edtJDTDOC = FN.GetItemValue(ref oForm, "edtJDTDOC");

                    if (pVal.Row > -1 && pVal.Row <= oGrid.Rows.Count && string.IsNullOrEmpty(edtJDTDOC))
                    {
                        oForm.EnableMenu("1293", true);//행삭제
                    }

                    if (string.IsNullOrEmpty(edtJDTDOC))
                    {
                        oForm.EnableMenu("1292", true);//행추가
                    }
                }

                oGrid.Rows.SelectedRows.Clear();
                if (pVal.Row != -1)
                {
                    oGrid.Rows.SelectedRows.Add(pVal.Row);
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                oForm.Freeze(false);
            }
            finally
            {
                
            }
            return true;

        }