Exemplo n.º 1
0
        private void fillCmb()
        {
            string subGrpCode = Convert.ToString(dbOITM.GetValue("U_SubGrp", 0));

            while (cbSubGroup.ValidValues.Count > 1)
            {
                try
                {
                    cbSubGroup.ValidValues.Remove(1, BoSearchKey.psk_Index);
                }
                catch { }
            }
            if (cbSubGroup.ValidValues.Count == 0)
            {
                cbSubGroup.ValidValues.Add("-1", "[No Sub Group]");
            }
            cbSubGroup.Select(0, BoSearchKey.psk_Index);


            fillChilds(dbOITM.GetValue("ItmsGrpCod", 0), "");

            try
            {
                if (subGrpCode != "-1" && subGrpCode != "")
                {
                    cbSubGroup.Select(subGrpCode.Trim(), BoSearchKey.psk_ByValue);
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 2
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;
        }
        private void AddItems(SAPbouiCOM.Form oFormPurchaseRequest)
        {
            SAPbouiCOM.Item       oCamposPurchaseRequest = null;
            SAPbouiCOM.Form       _oFormPurchaseRequest;
            SAPbouiCOM.StaticText oStaticText = null;
            SAPbouiCOM.Item       oItem;
            SAPbouiCOM.ComboBox   oComboBox = null;

            _oFormPurchaseRequest = oFormPurchaseRequest;

            //*******************************************
            // Se adiciona Label "Integrar Documento"
            //*******************************************

            oItem = _oFormPurchaseRequest.Items.Item("62");

            oCamposPurchaseRequest        = _oFormPurchaseRequest.Items.Add("blbID", SAPbouiCOM.BoFormItemTypes.it_STATIC);
            oCamposPurchaseRequest.Left   = oItem.Left + 10;
            oCamposPurchaseRequest.Width  = oItem.Width;
            oCamposPurchaseRequest.Top    = oItem.Top;
            oCamposPurchaseRequest.Height = oItem.Height;

            oCamposPurchaseRequest.LinkTo = "ComboBox1";

            oStaticText = ((SAPbouiCOM.StaticText)(oCamposPurchaseRequest.Specific));

            oStaticText.Caption = "Integrar Documento ?";

            oCamposPurchaseRequest.FromPane = 5;
            oCamposPurchaseRequest.ToPane   = 5;

            //*******************************************
            // Se adiciona Combo box "Integrar Documento"
            //*******************************************

            oCamposPurchaseRequest        = _oFormPurchaseRequest.Items.Add("ComboBox1", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX);
            oCamposPurchaseRequest.Left   = oItem.Left + 120;
            oCamposPurchaseRequest.Width  = oItem.Width;
            oCamposPurchaseRequest.Top    = oItem.Top;
            oCamposPurchaseRequest.Height = oItem.Height;

            oCamposPurchaseRequest.DisplayDesc = true;

            _oFormPurchaseRequest.DataSources.UserDataSources.Add("CombSource", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 20);

            oComboBox = ((SAPbouiCOM.ComboBox)(oCamposPurchaseRequest.Specific));


            oComboBox.DataBind.SetBound(true, "", "CombSource");

            oComboBox.ValidValues.Add("Y", "Si");
            oComboBox.ValidValues.Add("N", "No");

            oComboBox.Select("Y", BoSearchKey.psk_ByValue);

            oCamposPurchaseRequest.FromPane = 5;
            oCamposPurchaseRequest.ToPane   = 5;
        }
Exemplo n.º 4
0
        private void FillSalesOrder()
        {
            mSalesOrderForm.Freeze(true);

            for (int i = 1; i <= mLstSalesOrderLines.Count; i++)
            {
                mObjCboPyloadType = (SAPbouiCOM.ComboBox)mObjSOMtx.Columns.Item("U_TR_LoadType").Cells.Item(i).Specific;
                mObjCboPyloadType.Select(mLstSalesOrderLines[i - 1].PayloadType, SAPbouiCOM.BoSearchKey.psk_ByValue);

                mObjCboVehicleType = (SAPbouiCOM.ComboBox)mObjSOMtx.Columns.Item("U_TR_VehicleType").Cells.Item(i).Specific;
                mObjCboVehicleType.Select(mLstSalesOrderLines[i - 1].VehicleType, SAPbouiCOM.BoSearchKey.psk_ByValue);

                mObjCboRoute = (SAPbouiCOM.ComboBox)mObjSOMtx.Columns.Item("U_TR_Paths").Cells.Item(i).Specific;
                mObjCboRoute.Select(mLstSalesOrderLines[i - 1].Route, SAPbouiCOM.BoSearchKey.psk_ByValue);

                mObjTxtTotKm       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TotKm").Cells.Item(i).Specific;
                mObjTxtTotKm.Value = mLstSalesOrderLines[i - 1].TotKm;

                mObjTxtKmA       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TypeA").Cells.Item(i).Specific;
                mObjTxtKmA.Value = mLstSalesOrderLines[i - 1].KmA;

                mObjTxtKmB       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TypeB").Cells.Item(i).Specific;
                mObjTxtKmB.Value = mLstSalesOrderLines[i - 1].KmB;

                mObjTxtKmC       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TypeC").Cells.Item(i).Specific;
                mObjTxtKmC.Value = mLstSalesOrderLines[i - 1].KmC;

                mObjTxtKmD       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TypeD").Cells.Item(i).Specific;
                mObjTxtKmD.Value = mLstSalesOrderLines[i - 1].KmD;

                mObjTxtKmE       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TypeE").Cells.Item(i).Specific;
                mObjTxtKmE.Value = mLstSalesOrderLines[i - 1].KmE;

                mObjTxtKmF       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TypeF").Cells.Item(i).Specific;
                mObjTxtKmF.Value = mLstSalesOrderLines[i - 1].KmF;

                mObjTxtTotKG       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_TotKilos").Cells.Item(i).Specific;
                mObjTxtTotKG.Value = mLstSalesOrderLines[i - 1].TotKg;

                mObjTxtExtra       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_AdditionalExpen").Cells.Item(i).Specific;
                mObjTxtExtra.Value = mLstSalesOrderLines[i - 1].Extra;

                mObjTxtAnthPyld       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_OtherLoad").Cells.Item(i).Specific;
                mObjTxtAnthPyld.Value = mLstSalesOrderLines[i - 1].AnotherPyld;

                mObjTxtDestination       = (SAPbouiCOM.EditText)mObjSOMtx.Columns.Item("U_TR_Destination").Cells.Item(i).Specific;
                mObjTxtDestination.Value = mLstSalesOrderLines[i - 1].Destination;
            }


            mSalesOrderForm.Freeze(false);
        }
Exemplo n.º 5
0
        private void fillUserCb()
        {
            string strSelect = " Select UserId,UserName from [dbo].[JE_getJEOriginators]('" + oCompany.UserName + "') ";

            System.Data.DataTable dtUsr = Program.objHrmsUI.getDataTable(strSelect, "Filling Originator");
            if (dtUsr != null && dtUsr.Rows.Count > 0)
            {
                foreach (DataRow dr in dtUsr.Rows)
                {
                    cbOr.ValidValues.Add(dr["UserId"].ToString(), dr["UserName"].ToString());
                }
            }
            cbOr.Select("All", BoSearchKey.psk_ByValue);
        }
Exemplo n.º 6
0
        private void fillUserCb()
        {
            Hashtable hp = new Hashtable();

            hp.Add("~p1", oCompany.UserName);
            string strSelect = Program.objHrmsUI.getQryString("JE_getJEOriginators", hp);

            System.Data.DataTable dtUsr = Program.objHrmsUI.getDataTable(strSelect, "Filling Originator " + oCompany.DbServerType + strSelect);
            if (dtUsr != null && dtUsr.Rows.Count > 0)
            {
                foreach (DataRow dr in dtUsr.Rows)
                {
                    cbOr.ValidValues.Add(dr["UserId"].ToString(), dr["UserName"].ToString());
                }
            }
            cbOr.Select("All", BoSearchKey.psk_ByValue);
        }
Exemplo n.º 7
0
        public virtual void ET_cboYEAR_AFComboSelect(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oComboBox = ((SAPbouiCOM.ComboBox)(oForm.Items.Item("cboYEAR").Specific));
            // ADD YOUR ACTION CODE HERE ...
            oForm.Items.Item("btnSAVE").Enabled = false;

            oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboSTATUS").Specific;
            string sql = string.Format(" SELECT U_RMK2 FROM [@KIS_AD00201] WHERE CODE = 'HR01' AND U_USEYN = 'Y' AND U_SMLCD = '{0}'",oForm.Items.Item("cboYEAR").Specific.Value);
            oRS.DoQuery(sql);
            oComboBox.Select(oRS.Fields.Item("U_RMK2").Value.ToString(), BoSearchKey.psk_ByValue);

        }
Exemplo n.º 8
0
        private void CriarFormularioComplexo()
        {
            SAPbouiCOM.Button    oButton    = null;
            SAPbouiCOM.Folder    oFolder    = null;
            SAPbouiCOM.OptionBtn oOptionBtn = null;
            SAPbouiCOM.CheckBox  oCheckBox  = null;
            SAPbouiCOM.ComboBox  oComboBox  = null;

            SAPbouiCOM.FormCreationParams oCreationParams = null;
            oCreationParams = ((SAPbouiCOM.FormCreationParams)(oApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)));

            oCreationParams.UniqueID    = "frmComplex";
            oCreationParams.FormType    = "frmComplex";
            oCreationParams.BorderStyle = BoFormBorderStyle.fbs_Sizable;

            oForm = oApplication.Forms.AddEx(oCreationParams);


            AddDataSourceNoForm();

            oForm.Title        = "Formulário Complexo";
            oForm.Left         = 300;
            oForm.ClientWidth  = 200;
            oForm.Top          = 100;
            oForm.ClientHeight = 140;

            oItem           = oForm.Items.Add("1", BoFormItemTypes.it_BUTTON);
            oItem.Left      = 5;
            oItem.Width     = 65;
            oItem.Top       = 110;
            oItem.Height    = 19;
            oButton         = ((SAPbouiCOM.Button)(oItem.Specific));
            oButton.Caption = "OK";

            oItem           = oForm.Items.Add("2", BoFormItemTypes.it_BUTTON);
            oItem.Left      = 75;
            oItem.Width     = 65;
            oItem.Top       = 110;
            oItem.Height    = 19;
            oButton         = ((SAPbouiCOM.Button)(oItem.Specific));
            oButton.Caption = "Cancel";

            oItem        = oForm.Items.Add("Rect1", BoFormItemTypes.it_RECTANGLE);
            oItem.Left   = 0;
            oItem.Width  = 194;
            oItem.Top    = 25;
            oItem.Height = 80;


            for (int i = 1; i <= 3; i++)
            {
                oItem        = oForm.Items.Add("Folder" + i.ToString(), BoFormItemTypes.it_FOLDER);
                oItem.Left   = (i - 1) * 100;
                oItem.Width  = 100;
                oItem.Top    = 6;
                oItem.Height = 19;

                oFolder = ((SAPbouiCOM.Folder)(oItem.Specific));

                oFolder.Caption = "Folder" + i.ToString();
                oFolder.DataBind.SetBound(true, "", "FolderDS");

                if (i == 1)
                {
                    oFolder.Select();
                }
                else
                {
                    oFolder.GroupWith("Folder" + Convert.ToString(i - 1));
                }
            }
            for (int i = 1; i <= 3; i++)
            {
                oItem          = oForm.Items.Add("OptBtn" + i.ToString(), BoFormItemTypes.it_OPTION_BUTTON);
                oItem.Left     = 20;
                oItem.Width    = 120;
                oItem.Top      = 30 + (i - 1) * 19;
                oItem.Height   = 19;
                oItem.FromPane = 1;
                oItem.ToPane   = 1;

                oOptionBtn         = ((SAPbouiCOM.OptionBtn)(oItem.Specific));
                oOptionBtn.Caption = string.Format("Botão de Opção {0}", i);

                if (i > 1)
                {
                    oOptionBtn.GroupWith("OptBtn" + Convert.ToString(i - 1));
                }
                oOptionBtn.DataBind.SetBound(true, "", "OptBtnDS");
            }

            for (int i = 1; i <= 3; i++)
            {
                oItem          = oForm.Items.Add("CheckBox" + i.ToString(), BoFormItemTypes.it_CHECK_BOX);
                oItem.Left     = 20;
                oItem.Width    = 100;
                oItem.Top      = 30 + (i - 1) * 19;
                oItem.Height   = 19;
                oItem.FromPane = 2;
                oItem.ToPane   = 2;

                oCheckBox         = ((SAPbouiCOM.CheckBox)(oItem.Specific));
                oCheckBox.Caption = string.Format("Check Box {0}", i);
                oCheckBox.DataBind.SetBound(true, "", string.Format("CheckDS{0}", i));
            }
            for (int i = 1; i <= 3; i++)
            {
                oItem          = oForm.Items.Add("ComboBox" + i.ToString(), BoFormItemTypes.it_COMBO_BOX);
                oItem.Left     = 20;
                oItem.Width    = 100;
                oItem.Top      = 33 + (i - 1) * 19;
                oItem.Height   = 19;
                oItem.FromPane = 3;
                oItem.ToPane   = 3;

                oComboBox = ((SAPbouiCOM.ComboBox)(oItem.Specific));
                oComboBox.ValidValues.Add("0", "Selecione");
                for (int x = 1; x < 10; x++)
                {
                    oComboBox.ValidValues.Add(x.ToString(), string.Format("Item {0}", x));
                }
                oComboBox.Select("0", BoSearchKey.psk_ByValue);
                oItem.DisplayDesc = true;
            }


            oForm.PaneLevel = 1;
        }
Exemplo n.º 9
0
        private void fillPrs()
        {
            string strVals = "Select Code,Name from [@B1_PARAM1]";

            System.Data.DataTable dtVal = Program.objHrmsUI.getDataTable(strVals, "FillVal");
            int i = 0;

            foreach (DataRow dr in dtVal.Rows)
            {
                cbPM1.ValidValues.Add(dr["Code"].ToString(), dr["Name"].ToString());
                i++;
            }
            if (i > 0)
            {
                cbPM1.Select(0, BoSearchKey.psk_Index);
            }



            strVals = "Select Code,Name from [@B1_PARAM2]";
            dtVal   = Program.objHrmsUI.getDataTable(strVals, "FillVal");
            i       = 0;
            foreach (DataRow dr in dtVal.Rows)
            {
                cbPM2.ValidValues.Add(dr["Code"].ToString(), dr["Name"].ToString());
                i++;
            }
            if (i > 0)
            {
                cbPM2.Select(0, BoSearchKey.psk_Index);
            }

            //strVals = "Select Code,Name from [@B1_PARAM3]";
            //dtVal = Program.objHrmsUI.getDataTable(strVals, "FillVal");
            //i = 0;
            //foreach (DataRow dr in dtVal.Rows)
            //{
            //    cbPM3.ValidValues.Add(dr["Code"].ToString(), dr["Name"].ToString());
            //    i++;
            //}
            //if (i > 0) cbPM3.Select(0, BoSearchKey.psk_Index);
            //strVals = "Select Code,Name from [@B1_PARAM4]";
            //dtVal = Program.objHrmsUI.getDataTable(strVals, "FillVal");
            //i = 0;
            //foreach (DataRow dr in dtVal.Rows)
            //{
            //    cbPM4.ValidValues.Add(dr["Code"].ToString(), dr["Name"].ToString());
            //    i++;
            //}
            //if (i > 0) cbPM4.Select(0, BoSearchKey.psk_Index);

            //strVals = "Select Code,Name from [@B1_PARAM5]";
            //dtVal = Program.objHrmsUI.getDataTable(strVals, "FillVal");
            //i = 0;
            //foreach (DataRow dr in dtVal.Rows)
            //{
            //    cbPM5.ValidValues.Add(dr["Code"].ToString(), dr["Name"].ToString());
            //    i++;
            //}
            //if (i > 0) cbPM5.Select(0, BoSearchKey.psk_Index);


            //strVals = "Select Code,Name from [@B1_PARAM6]";
            //dtVal = Program.objHrmsUI.getDataTable(strVals, "FillVal");
            //i = 0;
            //foreach (DataRow dr in dtVal.Rows)
            //{
            //    cbPM6.ValidValues.Add(dr["Code"].ToString(), dr["Name"].ToString());
            //    i++;
            //}
            //if (i > 0) cbPM6.Select(0, BoSearchKey.psk_Index);
            strVals = "Select Code,Name from [@B1_PARAM7]";
            dtVal   = Program.objHrmsUI.getDataTable(strVals, "FillVal");
            i       = 0;
            foreach (DataRow dr in dtVal.Rows)
            {
                cbPM7.ValidValues.Add(dr["Code"].ToString(), dr["Name"].ToString());
                i++;
            }
            if (i > 0)
            {
                cbPM7.Select(0, BoSearchKey.psk_Index);
            }
            //strVals = "Select Code,Name from [@B1_PARAM8]";
            //dtVal = Program.objHrmsUI.getDataTable(strVals, "FillVal");
            //i = 0;
            //foreach (DataRow dr in dtVal.Rows)
            //{
            //    cbPM8.ValidValues.Add(dr["Code"].ToString(), dr["Name"].ToString());
            //    i++;
            //}
            //if (i > 0) cbPM8.Select(0, BoSearchKey.psk_Index);

            strVals = "Select ItmsGrpCod,ItmsGrpNam from [OITB]";
            dtVal   = Program.objHrmsUI.getDataTable(strVals, "FillVal");
            i       = 0;
            foreach (DataRow dr in dtVal.Rows)
            {
                cbIG.ValidValues.Add(dr["ItmsGrpCod"].ToString(), dr["ItmsGrpNam"].ToString());
                i++;
            }
            if (i > 0)
            {
                cbIG.Select(0, BoSearchKey.psk_Index);
            }
        }
        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_FELibrosElect.srf", uid);
                //EnableCrystal := true;
                oForm = FSBOApp.Forms.Item(uid);
                oForm.Freeze(true);
                oForm.AutoManaged    = false;
                oForm.SupportedModes = -1;

                oForm.DataSources.UserDataSources.Add("Periodo", BoDataType.dt_SHORT_TEXT, 10);
                ((ComboBox)oForm.Items.Item("Periodo").Specific).DataBind.SetBound(true, "", "Periodo");

                oForm.DataSources.UserDataSources.Add("PeriodoD", BoDataType.dt_SHORT_TEXT, 10);
                ((ComboBox)oForm.Items.Item("PeriodoD").Specific).DataBind.SetBound(true, "", "PeriodoD");

                oForm.DataSources.UserDataSources.Add("PeriodoH", BoDataType.dt_SHORT_TEXT, 10);
                ((ComboBox)oForm.Items.Item("PeriodoH").Specific).DataBind.SetBound(true, "", "PeriodoH");

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


                if ((TipoLibro == "D") || (TipoLibro == "M")) //Libro Mayor y Diario
                {
                    s = "Periodo";
                    oForm.Items.Item(s).Click(BoCellClickType.ct_Regular);
                    if (TipoLibro == "D")
                    {
                        oForm.Title = "Libro Diario y Mayor";
                    }

                    oForm.PaneLevel = 1;
                    oForm.Items.Item("5").Visible        = false;
                    oForm.Items.Item("PeriodoD").Visible = false;
                    oForm.Items.Item("7").Visible        = false;
                    oForm.Items.Item("PeriodoH").Visible = false;

                    oForm.Items.Item("grid").Height   = 210;
                    oForm.Items.Item("grid2").Visible = true;

                    odt2            = oForm.DataSources.DataTables.Add("grid2");
                    grid2           = ((Grid)oForm.Items.Item("grid2").Specific);
                    grid2.DataTable = odt2;

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code', Code 'Name'
                              FROM OFPR
                             WHERE Category BETWEEN YEAR(GETDATE()) -1 AND YEAR(GETDATE())";
                    }
                    else
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"", ""Code"" ""Name""
                              FROM ""OFPR""
                             WHERE ""Category"" BETWEEN EXTRACT(YEAR FROM CURRENT_DATE) -1 AND EXTRACT(YEAR FROM CURRENT_DATE)";
                    }
                    oRecordSet.DoQuery(s);

                    oComboBox = ((ComboBox)oForm.Items.Item("Periodo").Specific);
                    FSBOf.FillCombo(oComboBox, ref oRecordSet, false);

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code' FROM OFPR WHERE CONVERT(CHAR(6), F_RefDate, 112) = CONVERT(CHAR(6), GETDATE(), 112)";
                    }
                    else
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"" FROM ""OFPR"" WHERE TO_VARCHAR(""F_RefDate"", 'yyyyMM') = TO_VARCHAR(CURRENT_DATE, 'yyyyMM')";
                    }
                    oRecordSet.DoQuery(s);
                    oComboBox.Select(((System.String)oRecordSet.Fields.Item("Code").Value), BoSearchKey.psk_ByValue);
                }
                else if (TipoLibro == "B")//Balance
                {
                    s = "PeriodoD";
                    oForm.Items.Item(s).Click(BoCellClickType.ct_Regular);
                    oForm.Title     = "Balance";
                    oForm.PaneLevel = 1;
                    oForm.Items.Item("4").Visible       = false;
                    oForm.Items.Item("Periodo").Visible = false;

                    oForm.Items.Item("grid").Height   = 210;
                    oForm.Items.Item("grid2").Visible = true;

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code', Code 'Name'
                              FROM OFPR
                             WHERE Category BETWEEN YEAR(GETDATE()) -1 AND YEAR(GETDATE())";
                    }
                    else
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"", ""Code"" ""Name""
                              FROM ""OFPR""
                             WHERE ""Category"" BETWEEN EXTRACT(YEAR FROM CURRENT_DATE) -1 AND EXTRACT(YEAR FROM CURRENT_DATE)";
                    }
                    oRecordSet.DoQuery(s);
                    oForm.Items.Item("PeriodoD").DisplayDesc = true;
                    oComboBox = ((ComboBox)oForm.Items.Item("PeriodoD").Specific);
                    FSBOf.FillCombo(oComboBox, ref oRecordSet, false);

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code' FROM OFPR WHERE CONVERT(CHAR(6), F_RefDate, 112) = CONVERT(CHAR(6), GETDATE(), 112)";
                    }
                    else
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"" FROM ""OFPR"" WHERE TO_VARCHAR(""F_RefDate"", 'yyyyMM') = TO_VARCHAR(CURRENT_DATE, 'yyyyMM')";
                    }
                    oRecordSet.DoQuery(s);
                    oComboBox.Select(((System.String)oRecordSet.Fields.Item("Code").Value), BoSearchKey.psk_ByValue);

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code', Code 'Name'
                              FROM OFPR
                             WHERE Category BETWEEN YEAR(GETDATE()) -1 AND YEAR(GETDATE())";
                    }
                    else
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"", ""Code"" ""Name""
                              FROM ""OFPR""
                             WHERE ""Category"" BETWEEN EXTRACT(YEAR FROM CURRENT_DATE) -1 AND EXTRACT(YEAR FROM CURRENT_DATE)";
                    }
                    oRecordSet.DoQuery(s);
                    oForm.Items.Item("PeriodoH").DisplayDesc = true;
                    oComboBox = ((ComboBox)oForm.Items.Item("PeriodoH").Specific);
                    FSBOf.FillCombo(oComboBox, ref oRecordSet, false);

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code' FROM OFPR WHERE CONVERT(CHAR(6), F_RefDate, 112) = CONVERT(CHAR(6), GETDATE(), 112)";
                    }
                    else
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"" FROM ""OFPR"" WHERE TO_VARCHAR(""F_RefDate"", 'yyyyMM') = TO_VARCHAR(CURRENT_DATE, 'yyyyMM')";
                    }
                    oRecordSet.DoQuery(s);
                    oComboBox.Select(((System.String)oRecordSet.Fields.Item("Code").Value), BoSearchKey.psk_ByValue);

                    odt2            = oForm.DataSources.DataTables.Add("grid2");
                    grid2           = ((Grid)oForm.Items.Item("grid2").Specific);
                    grid2.DataTable = odt2;
                }
                else if (TipoLibro == "C") //para Diccionario de cuentas
                {
                    oForm.Title = "Diccionario";
                    //oForm.PaneLevel = 2;
                    oForm.Items.Item("btnExp").Enabled = true;
                    oForm.PaneLevel = 1;
                    oForm.Items.Item("5").Visible        = false;
                    oForm.Items.Item("PeriodoD").Visible = false;
                    oForm.Items.Item("7").Visible        = false;
                    oForm.Items.Item("PeriodoH").Visible = false;

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code', Code 'Name'
                              FROM OFPR
                             WHERE Category BETWEEN YEAR(GETDATE()) -1 AND YEAR(GETDATE())";
                    }
                    else
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"", ""Code"" ""Name""
                              FROM ""OFPR""
                             WHERE ""Category"" BETWEEN EXTRACT(YEAR FROM CURRENT_DATE) -1 AND EXTRACT(YEAR FROM CURRENT_DATE)";
                    }
                    oRecordSet.DoQuery(s);

                    oComboBox = ((ComboBox)oForm.Items.Item("Periodo").Specific);
                    FSBOf.FillCombo(oComboBox, ref oRecordSet, false);

                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = @"SELECT CAST(AbsEntry AS VARCHAR(20)) 'Code' FROM OFPR WHERE CONVERT(CHAR(6), F_RefDate, 112) = CONVERT(CHAR(6), GETDATE(), 112)";
                    }
                    else
                    {
                        s = @"SELECT TO_VARCHAR(""AbsEntry"") ""Code"" FROM ""OFPR"" WHERE TO_VARCHAR(""F_RefDate"", 'yyyyMM') = TO_VARCHAR(CURRENT_DATE, 'yyyyMM')";
                    }
                    oRecordSet.DoQuery(s);
                    oComboBox.Select(((System.String)oRecordSet.Fields.Item("Code").Value), BoSearchKey.psk_ByValue);
                }
            }
            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
Exemplo n.º 11
0
        private void fillCBs()
        {
            for (int i = 1; i <= 12; i++)
            {
                cbHH.ValidValues.Add(i.ToString().PadLeft(2, '0'), i.ToString().PadLeft(2, '0'));
                cbOTHH.ValidValues.Add(i.ToString().PadLeft(2, '0'), i.ToString().PadLeft(2, '0'));
            }

            for (int i = 0; i <= 59; i += 5)
            {
                cbMM.ValidValues.Add(i.ToString().PadLeft(2, '0'), i.ToString().PadLeft(2, '0'));
                cbOTMM.ValidValues.Add(i.ToString().PadLeft(2, '0'), i.ToString().PadLeft(2, '0'));
            }
            cbAP.ValidValues.Add("AM", "AM");
            cbAP.ValidValues.Add("PM", "PM");
            cbOTAP.ValidValues.Add("AM", "AM");
            cbOTAP.ValidValues.Add("PM", "PM");


            cbEWN.ValidValues.Add("1", "1");
            cbEWN.ValidValues.Add("2", "2");
            cbEWN.ValidValues.Add("3", "3");
            cbEWN.ValidValues.Add("4", "4");

            cbHH.Select("12", BoSearchKey.psk_ByValue);
            cbMM.Select(0, BoSearchKey.psk_Index);
            cbAP.Select(0, BoSearchKey.psk_Index);

            cbOTHH.Select("12", BoSearchKey.psk_ByValue);
            cbOTMM.Select(0, BoSearchKey.psk_Index);
            cbOTAP.Select(0, BoSearchKey.psk_Index);


            cbEWN.Select(0, BoSearchKey.psk_Index);


            System.Data.DataTable dtSP = Program.objHrmsUI.getDataTable("Select slpcode,slpname from oslp", "FillSP");

            foreach (System.Data.DataRow dr in dtSP.Rows)
            {
                cbSP.ValidValues.Add(dr["slpcode"].ToString(), dr["slpname"].ToString());
            }

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


            cbDays.ValidValues.Add("Mon", "Monday");
            cbDays.ValidValues.Add("Tue", "Tuesday");
            cbDays.ValidValues.Add("Wed", "Wednesday");
            cbDays.ValidValues.Add("Thu", "Thursday");
            cbDays.ValidValues.Add("Fri", "Friday");
            cbDays.ValidValues.Add("Sat", "Saturday");
            cbDays.ValidValues.Add("Sun", "Sunday");



            cbWeeks.ValidValues.Add("1", "Week 1");
            cbWeeks.ValidValues.Add("2", "Week 2");
            cbWeeks.ValidValues.Add("3", "Week 3");
            cbWeeks.ValidValues.Add("4", "Week 4");
            cbWeeks.ValidValues.Add("5", "Week 5");



            SAPbouiCOM.Column mtColDay = mtDay.Columns.Item("colDay");
            mtColDay.ValidValues.Add("Mon", "Monday");
            mtColDay.ValidValues.Add("Tue", "Tuesday");
            mtColDay.ValidValues.Add("Wed", "Wednesday");
            mtColDay.ValidValues.Add("Thu", "Thursday");
            mtColDay.ValidValues.Add("Fri", "Friday");
            mtColDay.ValidValues.Add("Sat", "Saturday");
            mtColDay.ValidValues.Add("Sun", "Sunday");

            SAPbouiCOM.Column mtColWeek = mtDay.Columns.Item("colWeek");
            mtColWeek.ValidValues.Add("1", "Week 1");
            mtColWeek.ValidValues.Add("2", "Week 2");
            mtColWeek.ValidValues.Add("3", "Week 3");
            mtColWeek.ValidValues.Add("4", "Week 4");
            mtColWeek.ValidValues.Add("5", "Week 5");
        }
Exemplo n.º 12
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting() {
            // '// ADD YOUR ACTION CODE HERE ...
            try
            {
                #region Form Setting

                oForm.SupportedModes = 1;
                oForm.Settings.EnableRowFormat = false;
                oForm.Settings.Enabled = false;
                oForm.AutoManaged = true;

                #endregion

                #region ComboBox

                string sql = string.Empty;

                // 사업장
                oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboBPLID").Specific;
                FN.SetComboBoxValidValues(oForm, " SELECT BPLId,BPLName FROM OBPL ORDER BY BPLId ", "cboBPLID", FN.Enum_WholeTp.m_TotalTxt);
                oComboBox.Select(1, BoSearchKey.psk_Index);

                // 문서상태
                oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboSTATUS").Specific;
                oComboBox.ValidValues.Add("", "전체");
                oComboBox.ValidValues.Add("O", "미결");
                oComboBox.ValidValues.Add("C", "마감");
                oComboBox.Select(0, BoSearchKey.psk_Index);

                #endregion

                #region ChooseFromList

                SAPbouiCOM.Conditions oCons = new Conditions();

                // USER
                #region User Conditions
                oCons = new Conditions();
                SAPbouiCOM.Condition oCon = oCons.Add();

                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_User).ToString(), "edtBTFCRE", "USER_CODE", BoFormItemTypes.it_EDIT);
                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_User).ToString(), "edtAPPR", "USER_CODE", BoFormItemTypes.it_EDIT);
                #endregion 
                
                // 계정코드
                #region GLAccounts Conditions
                oCons = new Conditions();
                oCon = oCons.Add();
              
                oCon.Alias = "Postable";
                oCon.Operation = BoConditionOperation.co_EQUAL;
                oCon.CondVal = "Y";

                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_GLAccounts).ToString(), "edtACCTCDF", "AcctCode", BoFormItemTypes.it_EDIT, oCons);
                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_GLAccounts).ToString(), "edtACCTCDT", "AcctCode", BoFormItemTypes.it_EDIT, oCons);
                #endregion

                // 코스트센터
                #region ProfitCenter Conditions
                oCons = new Conditions();
                oCon = oCons.Add();

                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtHPRCF", "PrcCode", BoFormItemTypes.it_EDIT);
                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtHPRCT", "PrcCode", BoFormItemTypes.it_EDIT);
                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtLPRCF", "PrcCode", BoFormItemTypes.it_EDIT);
                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtLPRCT", "PrcCode", BoFormItemTypes.it_EDIT);
                #endregion

                #endregion

                #region grd
                oForm.DataSources.DataTables.Add("grd");
                oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific;
                oGrid.SelectionMode = BoMatrixSelect.ms_Single;
                SetGridTitle(oForm);
                #endregion

                #region default
                DateTime dateDoc = DateTime.Today;

                string strDate = " SELECT  DATEADD(DD,-1,DATEADD(MM, 1,  '" + Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01") + "')) ";
                dateDoc = Convert.ToDateTime(FN.GetRecordsetValue(strDate));

                oForm.DataSources.UserDataSources.Item("edtFDATE").ValueEx = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01");
                oForm.DataSources.UserDataSources.Item("edtTDATE").ValueEx = Convert.ToDateTime(dateDoc).ToString("yyyyMMdd");
                #endregion

                foreach (SAPbouiCOM.Item item in oForm.Items)
                {
                    item.AffectsFormMode = false;
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting() {
            // '// ADD YOUR ACTION CODE HERE ...

            #region Form Setting

            oForm.DataBrowser.BrowseBy = "DocEntry";

            oForm.SupportedModes = -1;
            oForm.Settings.EnableRowFormat = false;
            oForm.Settings.Enabled = false;
            oForm.AutoManaged = true;
            oForm.PaneLevel = 1;

            #endregion

            oForm.Mode = BoFormMode.fm_ADD_MODE;

            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_FI0010M_HRD");
            oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_FI00101_HRD");

            string strNowDate = B1Connections.diCompany.GetCompanyDate().ToShortDateString();         
            strNowDate = FN.SetDateFormatToDB(strNowDate, FN.eDateType.p_YYYYMMDD);
            oDB_M.SetValue("U_DOCDATE", 0, strNowDate.Replace(".", ""));
            oDB_M.SetValue("U_USERID", 0, B1Connections.theAppl.Company.UserName);
           
            oComboBox = oForm.Items.Item("cboYYYY").Specific;
            FN.SetComboBoxValidValues(oForm, " SELECT YEAR AS CODE, YEAR AS NAME FROM OACP ", "cboYYYY", FN.Enum_WholeTp.m_Nothing);
            oComboBox.Select(FN.Left(strNowDate,4) , BoSearchKey.psk_ByValue);

            oComboBox = oForm.Items.Item("cboTYPE").Specific;
            FN.SetComboBoxValidValues(oForm, " SELECT U_SMLCD,U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'FI01' AND U_USEYN = 'Y' ", "cboTYPE", FN.Enum_WholeTp.m_Nothing);
            oComboBox.Select(0, BoSearchKey.psk_Index);

            #region EditText

            // 코스트센터그룹
            SAPbouiCOM.Conditions oCons = new Conditions();
            FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "edtCOSTFR", "Code", BoFormItemTypes.it_EDIT, oCons);
            FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "edtCOSTTO", "Code", BoFormItemTypes.it_EDIT, oCons);

            // 공통비 코스트센터 그룹
            FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "edtCOMGPCD", "Code", BoFormItemTypes.it_EDIT, oCons);

            // 원가그룹
            FN.SetChooseFromListAdd(oForm, "KIS_CO0100", "edtDISACCD", "Code", BoFormItemTypes.it_EDIT, oCons);
            FN.SetChooseFromListAdd(oForm, "KIS_CO0100", "edtCOPECD", "Code", BoFormItemTypes.it_EDIT, oCons);
            FN.SetChooseFromListAdd(oForm, "KIS_CO0100", "edtCOAMCD", "Code", BoFormItemTypes.it_EDIT, oCons);

            // 계정코드
            #region GLAccounts Conditions
            oCons = new Conditions();
            SAPbouiCOM.Condition oCon = oCons.Add();

            oCon.Alias = "U_CATEGORY";
            oCon.Operation = BoConditionOperation.co_EQUAL;
            oCon.CondVal = "S09";

            #endregion

            FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_GLAccounts).ToString(), "edtCOMPECD", "AcctCode", BoFormItemTypes.it_EDIT, oCons);
            FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_GLAccounts).ToString(), "edtCOMAMCD", "AcctCode", BoFormItemTypes.it_EDIT, oCons);

            #endregion

            #region Matrix
            oMatrix = oForm.Items.Item("mtx").Specific;
            oMatrix.SelectionMode = BoMatrixSelect.ms_None;

            // 메트릭스 
            FN.SetChooseFromListAdd(oForm, "KIS_CO0110", "mtx", "Code", BoFormItemTypes.it_MATRIX, null, "U_PRCCD");

            FN.SetSumField(ref oMatrix, "U_1MON,U_2MON,U_3MON,U_4MON,U_5MON,U_6MON,U_7MON,U_8MON,U_9MON,U_10MON,U_11MON,U_12MON");

            //FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oDB_1, FN.RowSelectMode.SelectedLine, "U_PRCCD");

            #endregion

            #region SetAutoManagedAttribute

            string AllString = "cboYYYY,cboTYPE,edtCOMGPCD,edtDISACCD,edtCOPECD,edtCOAMCD,edtCOMPECD,edtCOMAMCD,mtx,btnFIND";
            string AddString = "cboYYYY,cboTYPE,edtCOMGPCD,edtDISACCD,edtCOPECD,edtCOAMCD,mtx,btnFIND";
            string OKString = "edtCOMGPCD,edtDISACCD,edtCOPECD,edtCOAMCD,mtx,btnFIND";
            string FindString = "cboYYYY,cboTYPE";

            FN.SetAutoManagedAttribute(ref oForm, AllString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False);
            FN.SetAutoManagedAttribute(ref oForm, AddString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True);
            FN.SetAutoManagedAttribute(ref oForm, OKString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True);
            FN.SetAutoManagedAttribute(ref oForm, FindString, BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_True);

            #endregion    

        }
Exemplo n.º 14
0
        /// <summary>
        /// 폼(Form)의 아이템들(Items)에 연결이 필요한 데이타소스(DataSource) 형식을 정의합니다.
        /// </summary>
        private void Act2_DataSourcesBinding()
        {
            // '// ADD YOUR ACTION CODE HERE ...

            #region ComboBox

            // 표코드
            oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboTYPE").Specific;
            if (FN.GetRecordsetValue("SELECT Code FROM [@KIS_AD0020M_HRD]") != "") 
            {
                FN.SetComboBoxValidValues(oForm, " SELECT Code,Name FROM [@KIS_AD0020M_HRD] ", "cboTYPE", FN.Enum_WholeTp.m_Nothing);
                oComboBox.Select(0, BoSearchKey.psk_Index);
            }
            else
            {
                B1Connections.theAppl.StatusBar.SetText("결제라인표셋팅 등록후 사용해주세요.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            // 사용여부
            oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboUSEYN").Specific;
            oComboBox.ValidValues.Add("Y", "Y");
            oComboBox.ValidValues.Add("N", "N");

            #endregion

            #region EditText

            // 사용자코드
            #region GLAccounts Conditions
            SAPbouiCOM.Conditions oCons = new Conditions();
            SAPbouiCOM.Condition oCon = oCons.Add();

            #endregion

            FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_User).ToString(), "edtUSERID", "USER_CODE", BoFormItemTypes.it_EDIT);
            FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_User).ToString(), "Name", "U_NAME", BoFormItemTypes.it_EDIT);

            #endregion

        }
Exemplo n.º 15
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting() {
            // '// ADD YOUR ACTION CODE HERE ...

            #region Form Setting

            oForm.DataBrowser.BrowseBy = "Code";

            oForm.SupportedModes = -1;
            oForm.Settings.EnableRowFormat = false;
            oForm.Settings.Enabled = false;
            oForm.AutoManaged = true;
            oForm.PaneLevel = 1;

            #endregion

            oForm.Mode = BoFormMode.fm_FIND_MODE;

            string strNowDate = B1Connections.diCompany.GetCompanyDate().ToShortDateString();
            strNowDate = FN.SetDateFormatToDB(strNowDate, FN.eDateType.p_YYYYMMDD);


            oComboBox = oForm.Items.Item("Code").Specific;
            FN.SetComboBoxValidValues(oForm, " SELECT YEAR AS CODE, YEAR AS NAME FROM OACP ", "Code", FN.Enum_WholeTp.m_Nothing);
            oComboBox.Select(FN.Left(strNowDate,4), BoSearchKey.psk_ByValue);
            oForm.Items.Item("btnTR").Enabled = false;
            oForm.Items.Item("btnCAN").Enabled = false;

            #region Matrix
            oMatrix = oForm.Items.Item("mtx").Specific;
            oMatrix.SelectionMode = BoMatrixSelect.ms_Single;

            // 메트릭스 
            //FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oDB_1, FN.RowSelectMode.SelectedLine, "U_YYYYMM");

            #endregion

        }
Exemplo n.º 16
0
        private void btnPayments_ClickBefore(object sboObject, SBOItemEventArg pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            Form lObjPaymentForm    = null;
            Form lObjPaymentFormUDF = null;
            Form lObjAccountForm    = null;

            try
            {
                if (mIntRowSelected > 0)
                {
                    StatusEnum lEnmStatus      = (StatusEnum)int.Parse(DtMatrix.GetValue("C_Status", mIntRowSelected - 1).ToString());
                    string     lStrFolio       = DtMatrix.GetValue("C_Folio", mIntRowSelected - 1).ToString();
                    string     lStrEmpCode     = DtMatrix.GetValue("C_Employe", mIntRowSelected - 1).ToString();
                    string     lStrArea        = DtMatrix.GetValue("C_Area", mIntRowSelected - 1).ToString();
                    double     lDblImport      = double.Parse(DtMatrix.GetValue("C_Amount", mIntRowSelected - 1).ToString());
                    string     lStrEmpName     = mObjPurchasesServiceFactory.GetPurchaseService().GetEmpName(lStrEmpCode);
                    string     lStrLineAccount = mObjPurchasesServiceFactory.GetPurchaseReceiptsService().GetAccountRefund(lStrArea);
                    //string lStrChkAcct = mObjPurchasesServiceFactory.GetPurchaseReceiptsService().GetAccountInConfig("GLO_CTAREEMBCHEQ");
                    string lStrChkAcct = cbAccount.Value;
                    // Dictionary<string, string> lStrBankInfo = mObjPurchasesServiceFactory.GetPurchaseReceiptsService().GetBankInfo(lStrChkAcct);
                    Dictionary <string, string> lStrBankInfo = new Dictionary <string, string>();
                    lStrBankInfo.Add(cbAccount.Value, cbBank.Selected.Description);

                    if (lEnmStatus != StatusEnum.Authorized_Ope_Admon)
                    {
                        UIApplication.ShowError("El reembolso seleccionado no está autorizado");
                        return;
                    }

                    string lStrValidation = ValidatePaymentsFields(lStrFolio, lStrEmpCode, lStrArea, lDblImport, lStrChkAcct, lStrBankInfo, lStrLineAccount);
                    if (!string.IsNullOrEmpty(lStrValidation))
                    {
                        UIApplication.ShowMessageBox(lStrValidation);
                        return;
                    }
                    if (mObjPurchasesServiceFactory.GetPurchaseReceiptsService().ExistsPayment(lStrEmpCode, lStrFolio, lStrArea))

                    /*string lStrDocEntry = DtMatrix.GetValue("C_DocEntry", mIntRowSelected - 1).ToString();
                     * if (mObjPurchasesServiceFactory.GetPurchaseReceiptsService().ExistsPayment(lStrDocEntry))*/
                    {
                        UIApplication.ShowError("Ya existe un pago para el reembolso seleccionado");
                        return;
                    }
                    this.UIAPIRawForm.Freeze(true);
                    UIApplication.GetApplication().ActivateMenuItem("2818");
                    if (!UIApplication.GetApplication().Menus.Item("6913").Checked)
                    {
                        UIApplication.GetApplication().ActivateMenuItem("6913");//2050
                    }

                    lObjPaymentForm    = UIApplication.GetApplication().Forms.GetForm("426", -1);
                    lObjPaymentFormUDF = UIApplication.GetApplication().Forms.GetForm("-426", -1);

                    lObjPaymentForm.Freeze(true);
                    lObjPaymentFormUDF.Freeze(true);
                    SAPbouiCOM.EditText txtDocDate = ((SAPbouiCOM.EditText)lObjPaymentForm.Items.Item("10").Specific);
                    txtDocDate.Value = DateTime.Now.ToString("yyyyMMdd");

                    SAPbouiCOM.OptionBtn optionBtnAccount = ((SAPbouiCOM.OptionBtn)lObjPaymentForm.Items.Item("58").Specific);
                    optionBtnAccount.Selected = true;

                    SAPbouiCOM.ComboBox cboPymtType = ((SAPbouiCOM.ComboBox)lObjPaymentFormUDF.Items.Item("U_GLO_PaymentType").Specific);
                    cboPymtType.Select("GLREM", SAPbouiCOM.BoSearchKey.psk_ByValue);

                    SAPbouiCOM.EditText txtCodeMov = ((SAPbouiCOM.EditText)lObjPaymentFormUDF.Items.Item("U_GLO_CodeMov").Specific);
                    txtCodeMov.Value = lStrFolio;

                    SAPbouiCOM.ComboBox txtCostCenter = ((SAPbouiCOM.ComboBox)lObjPaymentFormUDF.Items.Item("U_GLO_CostCenter").Specific);
                    txtCostCenter.Select(lStrArea, SAPbouiCOM.BoSearchKey.psk_ByValue);

                    SAPbouiCOM.ComboBox cboAuxiliarType = ((SAPbouiCOM.ComboBox)lObjPaymentFormUDF.Items.Item("U_FZ_AuxiliarType").Specific);
                    cboAuxiliarType.Select("2", SAPbouiCOM.BoSearchKey.psk_ByValue);

                    SAPbouiCOM.EditText txtName = ((SAPbouiCOM.EditText)lObjPaymentForm.Items.Item("10000166").Specific);
                    txtName.Value = lStrEmpName;

                    SAPbouiCOM.EditText txtAuxiliar = ((SAPbouiCOM.EditText)lObjPaymentFormUDF.Items.Item("U_FZ_Auxiliar").Specific);
                    txtAuxiliar.Value = lStrEmpCode;


                    SAPbouiCOM.Button btnBank = ((SAPbouiCOM.Button)lObjPaymentForm.Items.Item("234000001").Specific);
                    btnBank.Item.Click();

                    lObjAccountForm = UIApplication.GetApplication().Forms.GetForm("196", -1);
                    lObjAccountForm.Freeze(true);
                    SAPbouiCOM.Folder folderCheck = ((SAPbouiCOM.Folder)lObjAccountForm.Items.Item("3").Specific);
                    folderCheck.Item.Click();

                    SAPbouiCOM.Matrix mtxCheck = ((SAPbouiCOM.Matrix)lObjAccountForm.Items.Item("28").Specific);
                    ((SAPbouiCOM.EditText)mtxCheck.Columns.Item("7").Cells.Item(1).Specific).Value = lDblImport.ToString();

                    ComboBox cb = ((SAPbouiCOM.ComboBox)mtxCheck.Columns.Item("2").Cells.Item(1).Specific);

                    string ss = lStrBankInfo[lStrBankInfo.Keys.ElementAt(0)]; //lStrBankInfo.ElementAt(0);


                    ((SAPbouiCOM.ComboBox)mtxCheck.Columns.Item("2").Cells.Item(1).Specific).Select(lStrBankInfo[lStrBankInfo.Keys.ElementAt(0)], SAPbouiCOM.BoSearchKey.psk_ByValue); //Banco
                    ((SAPbouiCOM.ComboBox)mtxCheck.Columns.Item("4").Cells.Item(1).Specific).Select(lStrBankInfo.Keys.ElementAt(0), SAPbouiCOM.BoSearchKey.psk_ByValue);               //Cuenta?

                    SAPbouiCOM.Button btnOk = ((SAPbouiCOM.Button)lObjAccountForm.Items.Item("1").Specific);
                    btnOk.Item.Click();

                    SAPbouiCOM.Matrix mtxPayment = ((SAPbouiCOM.Matrix)lObjPaymentForm.Items.Item("71").Specific);
                    mtxPayment.AddRow();
                    ((SAPbouiCOM.EditText)mtxPayment.Columns.Item("5").Cells.Item(1).Specific).Value = lDblImport.ToString();
                    ((SAPbouiCOM.EditText)mtxPayment.Columns.Item("8").Cells.Item(1).Specific).Value = lStrLineAccount; //cuenta de mayor
                }
                else
                {
                    UIApplication.ShowMessageBox("Favor de seleccionar un registro");
                }



                lObjPaymentFormUDF.Freeze(false);
                this.UIAPIRawForm.Freeze(false);



                if (lObjPaymentForm != null)
                {
                    lObjPaymentForm.Freeze(false);
                }
                if (lObjAccountForm != null)
                {
                    lObjPaymentFormUDF.Freeze(false);
                }
                if (this.UIAPIRawForm != null)
                {
                    this.UIAPIRawForm.Freeze(false);
                }
                // if (lObjAccountForm. ==) lObjAccountForm.Freeze(false);
                UIApplication.ShowSuccess("Carga de pago terminada");
            }
            catch (Exception ex)
            {
                LogService.WriteError("frmSearchRefunds (btnPayments_ClickBefore) " + ex.Message);
                LogService.WriteError(ex);
                UIApplication.ShowMessageBox(string.Format("Error al abrir pantalla de pagos: {0}", ex.Message));
            }
            finally
            {
                if (lObjPaymentFormUDF != null)
                {
                    lObjPaymentFormUDF.Freeze(false);
                }
                this.UIAPIRawForm.Freeze(false);
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// 폼(Form)의 아이템들(Items)에 연결이 필요한 데이타소스(DataSource) 형식을 정의합니다.
        /// </summary>
        private void Act2_DataSourcesBinding() {
            // '// ADD YOUR ACTION CODE HERE ...

            #region EditText
            string ItemUID = "";

            ItemUID = "edtEMPNO"; oForm.DataSources.UserDataSources.Add(ItemUID, BoDataType.dt_SHORT_TEXT, 30); FN.SetUserDataBind(oForm, ItemUID);//사원코드
            ItemUID = "edtEMPNM"; oForm.DataSources.UserDataSources.Add(ItemUID, BoDataType.dt_SHORT_TEXT, 30); FN.SetUserDataBind(oForm, ItemUID);//사원코드

            #endregion

            #region ComboBox

            string sql = string.Empty;
            //string sql = FN.GetSQL("KIS_SF0360A_001");

            oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);

            // 기수
            oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboYEAR").Specific;
            sql = string.Format(" SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201]  WHERE CODE = 'HR01' AND U_USEYN = 'Y'");
            FN.QComboBind(ref oComboBox, sql, FN.Enum_WholeTp.m_Nothing, null);

            sql = string.Format(" SELECT LEFT(U_SMLNM,4) AS YEAR FROM [@KIS_AD00201]  WHERE CODE = 'HR01' AND U_USEYN = 'Y' AND LEFT(U_SMLNM,4) = '" + DateTime.Now.Year.ToString() + "'");
            oRS.DoQuery(sql);
            oComboBox.Select(oRS.Fields.Item("YEAR").Value.ToString(), BoSearchKey.psk_ByValue);

            // 부서
            oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboDEPT").Specific;
            sql = string.Format(" SELECT U_DEPTCD,U_DEPTNM FROM [@KIS_HR00401] WHERE U_USEYN = 'Y'");
            oComboBox.ValidValues.Add("", "");
            FN.QComboBind(ref oComboBox, sql, FN.Enum_WholeTp.m_Nothing, null);

            #endregion

            #region ChooseFromList

            SAPbouiCOM.Conditions oCons = new SAPbouiCOM.Conditions();
            //oCons = FN.GetConditionsWithQuery("CARDTYPE == S");
            oCons = null;

            FN.SetChooseFromListAdd(oForm, "KIS_HR0120", "edtEMPNO", "U_EMPNO", BoFormItemTypes.it_EXTEDIT, oCons);

            #endregion      
        }
Exemplo n.º 18
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
Exemplo n.º 19
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting() {
            // '// ADD YOUR ACTION CODE HERE ...
            #region Form Setting

            oForm.SupportedModes = 1;
            oForm.Settings.EnableRowFormat = false;
            oForm.Settings.Enabled = false;
            oForm.AutoManaged = true;

            #endregion

            #region ComboBox

            string sql = string.Empty;

            // 사업장
            oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboBPLID").Specific;
            FN.SetComboBoxValidValues(oForm, " SELECT BPLId,BPLName FROM OBPL ORDER BY BPLId ", "cboBPLID", FN.Enum_WholeTp.m_TotalTxt);
            oComboBox.Select(1, BoSearchKey.psk_Index);

            // 입력경로
            oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboTRANSTY").Specific;
            FN.SetComboBoxValidValues(oForm, " SELECT U_SMLCD,U_SMLNM FROM [@KIS_AD00101] WHERE Code = 'AD00' AND U_USEYN = 'Y' AND U_RMK2 <> 'N' ", "cboTRANSTY", FN.Enum_WholeTp.m_TotalTxt);

            #endregion

            #region ChooseFromList

            SAPbouiCOM.Conditions oCons = new Conditions();
            SAPbouiCOM.Condition oCon = oCons.Add();

            // 코스트센터
            #region ProfitCenter Conditions
            oCons = new Conditions();
            oCon = oCons.Add();

            FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtFRPRCCD", "PrcCode", BoFormItemTypes.it_EDIT);
            FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_ProfitCenter).ToString(), "edtTOPRCCD", "PrcCode", BoFormItemTypes.it_EDIT);

            #endregion

            #endregion

            #region default
            DateTime dateDoc = DateTime.Today;

            string strDate = " SELECT  DATEADD(DD,-1,DATEADD(MM, 1,  '" + Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01") + "')) ";
            dateDoc = Convert.ToDateTime(FN.GetRecordsetValue(strDate));

            oForm.DataSources.UserDataSources.Item("edtFRDT").ValueEx = Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01");
            oForm.DataSources.UserDataSources.Item("edtTODT").ValueEx = Convert.ToDateTime(dateDoc).ToString("yyyyMMdd");
            #endregion

        }
Exemplo n.º 20
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
Exemplo n.º 21
0
        /// <summary>
        /// 폼(Form)의 아이템들(Items)에 연결이 필요한 데이타소스(DataSource) 형식을 정의합니다.
        /// </summary>
        private void Act2_DataSourcesBinding() {
            // '// ADD YOUR ACTION CODE HERE ...

            #region ComboBox

            string sql = string.Empty;
            //string sql = FN.GetSQL("KIS_SF0360A_001");

            oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
            oRS1 = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);


            // 기수
            oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboYEAR").Specific;
            sql = string.Format(" SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201]  WHERE CODE = 'HR01' AND U_USEYN = 'Y'");
            FN.QComboBind(ref oComboBox, sql, FN.Enum_WholeTp.m_Nothing, null);

            sql = string.Format(" SELECT LEFT(U_SMLNM,4) AS YEAR FROM [@KIS_AD00201]  WHERE CODE = 'HR01' AND U_USEYN = 'Y' AND LEFT(U_SMLNM,4) = '{0}'",DateTime.Now.Year.ToString());
            oRS.DoQuery(sql);
            oComboBox.Select(oRS.Fields.Item("YEAR").Value.ToString(), BoSearchKey.psk_ByValue);

            // 상태
            oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboSTATUS").Specific;
            sql = string.Format(" SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201]  WHERE CODE = 'HR10' AND U_USEYN = 'Y'");
            FN.QComboBind(ref oComboBox, sql, FN.Enum_WholeTp.m_Nothing, null);

            sql = string.Format(" SELECT U_RMK2 FROM [@KIS_AD00201] WHERE CODE = 'HR01' AND U_USEYN = 'Y' AND U_SMLCD = '{0}'",oForm.Items.Item("cboYEAR").Specific.Value);
            oRS.DoQuery(sql);
            oComboBox.Select(oRS.Fields.Item("U_RMK2").Value.ToString(), BoSearchKey.psk_ByValue);

            #endregion

            // 고과대상자
            sql = string.Format(" select COUNT(*) from [@KIS_HR0120M]");
            oRS.DoQuery(sql);
            oForm.Items.Item("edtPERSON").Specific.Value = oRS.Fields.Item(0).Value.ToString();
      
        }
Exemplo n.º 22
0
        public virtual void ET_AFDataMenu_Add(MenuEvent pVal) {
            oForm = B1Connections.theAppl.Forms.ActiveForm;
            // ADD YOUR ACTION CODE HERE ...

            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_FI0010M_HRD");
            oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_FI00101_HRD");

            string strNowDate = B1Connections.diCompany.GetCompanyDate().ToShortDateString();
            strNowDate = FN.SetDateFormatToDB(strNowDate, FN.eDateType.p_YYYYMMDD);
            oDB_M.SetValue("U_DOCDATE", 0, strNowDate.Replace(".", ""));
            oDB_M.SetValue("U_USERID", 0, B1Connections.theAppl.Company.UserName);

            oComboBox = oForm.Items.Item("cboYYYY").Specific;
            oComboBox.Select(FN.Left(strNowDate, 4), BoSearchKey.psk_ByValue);

            oComboBox = oForm.Items.Item("cboTYPE").Specific;
            oComboBox.Select(0, BoSearchKey.psk_Index);
        }
Exemplo n.º 23
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting() {
            // '// ADD YOUR ACTION CODE HERE ...

            try
            {
                #region Form Setting

                oForm.SupportedModes = 1;
                oForm.Settings.EnableRowFormat = false;
                oForm.Settings.Enabled = false;
                oForm.AutoManaged = true;

                #endregion

                #region ComboBox

                string sql = string.Empty;

                // 템플릿
                oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboTMPTYPE").Specific;
                FN.SetComboBoxValidValues(oForm, " SELECT AbsId,Name FROM OFRT WHERE DocType = 'F' AND U_TMPTYPE = '2' ", "cboTMPTYPE", FN.Enum_WholeTp.m_Nothing);
                oComboBox.Select(0, BoSearchKey.psk_Index);
                #endregion

                oForm.DataSources.UserDataSources.Item("optCOSTTY").ValueEx = "Y";
                oForm.DataSources.UserDataSources.Item("optTYPE").ValueEx = "Y";

                oForm.DataSources.UserDataSources.Item("edtFDATE").ValueEx = FN.Left(Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01"), 6);
                oForm.DataSources.UserDataSources.Item("edtTDATE").ValueEx = FN.Left(Convert.ToDateTime(B1Connections.theAppl.Company.ServerDate).ToString("yyyyMM01"), 6);

                foreach (SAPbouiCOM.Item item in oForm.Items)
                {
                    item.AffectsFormMode = false;
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }

        }
Exemplo n.º 24
0
        private void getCodesAttr(string Code)
        {
            string strUsrInfo = "SELECT * FROM \"@B1_QA_OUSR\" WHERE  \"Code\" = '" + Code + "' ";

            System.Data.DataTable dtUsrInfo = Program.objHrmsUI.getDataTable(strUsrInfo, "User Info");
            string prdWhs = "";

            if (dtUsrInfo != null && dtUsrInfo.Rows.Count > 0)
            {
                prdWhs = dtUsrInfo.Rows[0]["U_PWHS"].ToString().Trim();
            }

            string strAttrAll = "SELECT \"Code\" , \"Name\" FROM \"@B1_QA_OBJS\" WHERE  \"Code\" NOT IN (SELECT \"U_ObjType\" FROM \"@B1_QA_OUSR_OT\" WHERE \"U_UsrCode\" = '" + Code + "') ";

            System.Data.DataTable dtCodes = Program.objHrmsUI.getDataTable(strAttrAll, "gettingCodes");
            int i = 0;

            dtA.Rows.Clear();
            foreach (System.Data.DataRow dr in dtCodes.Rows)
            {
                i++;
                dtA.Rows.Add(1);
                dtA.SetValue("Id", i - 1, i.ToString());
                dtA.SetValue("Code", i - 1, dr["Code"].ToString());
                dtA.SetValue("Name", i - 1, dr["Name"].ToString());
            }
            mtA.LoadFromDataSource();



            strAttrAll = "SELECT \"Code\" , \"Name\" FROM \"@B1_QA_OBJS\" WHERE  \"Code\"  IN (SELECT \"U_ObjType\" FROM \"@B1_QA_OUSR_OT\" WHERE \"U_UsrCode\" = '" + Code + "') ";
            dtCodes    = Program.objHrmsUI.getDataTable(strAttrAll, "gettingCodes");
            i          = 0;
            dtS.Rows.Clear();
            foreach (System.Data.DataRow dr in dtCodes.Rows)
            {
                i++;
                dtS.Rows.Add(1);
                dtS.SetValue("Id", i - 1, i.ToString());
                dtS.SetValue("Code", i - 1, dr["Code"].ToString());
                dtS.SetValue("Name", i - 1, dr["Name"].ToString());
            }
            mtS.LoadFromDataSource();



            strAttrAll = "SELECT t0.\"WhsCode\" , t0.\"WhsName\" FROM \"OWHS\" t0 INNER JOIN  \"@B1_QA_ATTR_INSWHS\" t1 on t0.\"WhsCode\" = t1.\"U_OWHS\"  WHERE  t0.\"WhsCode\" NOT IN (SELECT \"U_WHS\" FROM \"@B1_QA_OUSR_WHS\" WHERE \"U_UsrCode\" = '" + Code + "') ";
            dtCodes    = Program.objHrmsUI.getDataTable(strAttrAll, "gettingCodes");
            i          = 0;
            dtAW.Rows.Clear();
            foreach (System.Data.DataRow dr in dtCodes.Rows)
            {
                i++;
                dtAW.Rows.Add(1);
                dtAW.SetValue("Id", i - 1, i.ToString());
                dtAW.SetValue("Code", i - 1, dr["WhsCode"].ToString());
                dtAW.SetValue("Name", i - 1, dr["WhsName"].ToString());
            }
            mtAW.LoadFromDataSource();
            int cnt = cbPWHS.ValidValues.Count;

            for (int k = 0; k < cnt; k++)
            {
                cbPWHS.ValidValues.Remove(0, BoSearchKey.psk_Index);
            }
            strAttrAll = "SELECT t0.\"WhsCode\" , t0.\"WhsName\" FROM \"OWHS\" t0 INNER JOIN  \"@B1_QA_ATTR_INSWHS\" t1 on t0.\"WhsCode\" = t1.\"U_OWHS\"  WHERE  t0.\"WhsCode\"  IN (SELECT \"U_WHS\" FROM \"@B1_QA_OUSR_WHS\" WHERE \"U_UsrCode\" = '" + Code + "') ";
            dtCodes    = Program.objHrmsUI.getDataTable(strAttrAll, "gettingCodes");
            i          = 0;
            dtSW.Rows.Clear();
            foreach (System.Data.DataRow dr in dtCodes.Rows)
            {
                i++;
                dtSW.Rows.Add(1);
                dtSW.SetValue("Id", i - 1, i.ToString());
                dtSW.SetValue("Code", i - 1, dr["WhsCode"].ToString());
                dtSW.SetValue("Name", i - 1, dr["WhsName"].ToString());
                cbPWHS.ValidValues.Add(dr["WhsCode"].ToString(), dr["WhsName"].ToString());
            }
            mtSW.LoadFromDataSource();

            if (prdWhs != "" && cbPWHS.ValidValues.Count > 0)
            {
                try
                {
                    cbPWHS.Select(prdWhs, BoSearchKey.psk_ByValue);
                }
                catch { }
            }
        }
Exemplo n.º 25
0
        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
Exemplo n.º 26
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting() {
            // '// ADD YOUR ACTION CODE HERE ...

            #region Form Setting

            oForm.DataBrowser.BrowseBy = "Code";

            oForm.SupportedModes = -1;
            oForm.Settings.EnableRowFormat = false;
            oForm.Settings.Enabled = false;
            oForm.AutoManaged = true;

            #endregion

            #region grd
            oForm.DataSources.DataTables.Add("grd");
            oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific;
            oGrid.SelectionMode = BoMatrixSelect.ms_Single;
            //SetGridTitle(oForm);
            #endregion

            #region default

            if (FN.GetRecordsetValue("SELECT Code FROM [@KIS_AD0020M_HRD]") != "")
            {
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_AD0030M_HRD");
                oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_AD00301_HRD");

                StringBuilder pQuery = new StringBuilder();

                LoginId = B1Connections.theAppl.Company.UserName;
                SuperUSYN = FN.GetRecordsetValue(string.Format("SELECT SUPERUSER FROM OUSR WHERE USER_CODE = '{0}'", LoginId));
                string strTYPE = oForm.Items.Item("cboTYPE").Specific.value.Trim();
                
                oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item("cboTYPE").Specific;

                pQuery.Append(" SELECT COUNT(A.Code) FROM [@KIS_AD0030M_HRD] A ");
                pQuery.Append(" WHERE A.Code = '{0}' AND A.U_TYPE = '{1}' ");

                if (FN.GetRecordsetValue(string.Format(pQuery.ToString(), LoginId, strTYPE)) == "0")
                {
                    oForm.Mode = BoFormMode.fm_ADD_MODE;

                    oDB_M.SetValue("U_USERID", 0, FN.GetRecordsetValue(string.Format("SELECT USER_CODE FROM OUSR WHERE USER_CODE = '{0}'", LoginId)));
                    oDB_M.SetValue("Name", 0, FN.GetRecordsetValue(string.Format("SELECT U_NAME FROM OUSR WHERE USER_CODE = '{0}'", LoginId)));

                    oComboBox.Select(0, BoSearchKey.psk_Index);

                    if (SuperUSYN == "Y")
                    {
                        oForm.Items.Item("edtUSERID").Enabled = true;
                    }
                    else
                    {
                        oForm.Items.Item("edtUSERID").Enabled = false;
                    }
                }
                else
                {
                    oDB_M.SetValue("U_USERID", 0, FN.GetRecordsetValue(string.Format("SELECT USER_CODE FROM OUSR WHERE USER_CODE = '{0}'", LoginId)));
                    oDB_M.SetValue("Name", 0, FN.GetRecordsetValue(string.Format("SELECT U_NAME FROM OUSR WHERE USER_CODE = '{0}'", LoginId)));
                    SetFormLoadFromDBDatasource();
                }
            }
            #endregion

        }