Esempio n. 1
0
        /// <summary>
        /// Initialize components. Called by framework after form created.
        /// </summary>
        public override void OnInitializeComponent()
        {
            this.fileSelector              = ((SAPbouiCOM.Button)(this.GetItem("btArq").Specific));
            this.fileSelector.ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.FileButton_ClickBefore);
            this.modulePath                       = ((SAPbouiCOM.EditText)(this.GetItem("edArquivo").Specific));
            this.installUpdateModule              = ((SAPbouiCOM.Button)(this.GetItem("btInst").Specific));
            this.installUpdateModule.ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.InstallUpdateModule_ClickBefore);
            this.moduleGrid                       = ((SAPbouiCOM.Grid)(this.GetItem("gridArq").Specific));
            this.removeButton                     = ((SAPbouiCOM.Button)(this.GetItem("btModu").Specific));
            this.removeButton.ClickAfter         += new SAPbouiCOM._IButtonEvents_ClickAfterEventHandler(this.RemoveButtom_ClickAfter);
            this.startButton                      = ((SAPbouiCOM.Button)(this.GetItem("btStart").Specific));
            this.startButton.ClickAfter          += new _IButtonEvents_ClickAfterEventHandler(startButton_ClickAfter);
            this.shutdownButton                   = ((SAPbouiCOM.Button)(this.GetItem("btStop").Specific));
            this.shutdownButton.ClickAfter       += new _IButtonEvents_ClickAfterEventHandler(shutdownButton_ClickAfter);
            this.installButton                    = ((SAPbouiCOM.Button)(this.GetItem("btInstall").Specific));
            this.installButton.ClickAfter        += new _IButtonEvents_ClickAfterEventHandler(installButton_ClickAfter);
            this.configTemp                       = this.UIAPIRawForm.DataSources.DataTables.Item("configTemp");
            this.moduleGrid.ClickAfter           += new _IGridEvents_ClickAfterEventHandler(moduleGrid_ClickAfter);

            ((ComboBoxColumn)moduleGrid.Columns.Item("Installed")).ValidValues.Add("Y", Messages.Yes);
            ((ComboBoxColumn)moduleGrid.Columns.Item("Installed")).ValidValues.Add("N", Messages.No);
            ((ComboBoxColumn)moduleGrid.Columns.Item("Installed")).DisplayType = BoComboDisplayType.cdt_Description;

            ((ComboBoxColumn)moduleGrid.Columns.Item("Status")).ValidValues.Add("R", Messages.AdminRunning);
            ((ComboBoxColumn)moduleGrid.Columns.Item("Status")).ValidValues.Add("S", Messages.AdminStopped);
            ((ComboBoxColumn)moduleGrid.Columns.Item("Status")).DisplayType = BoComboDisplayType.cdt_Description;

            moduleDT = moduleGrid.DataTable;

            // click on first tab.
            this.UIAPIRawForm.DataSources.UserDataSources.Item("Folders").Value = "1";
        }
Esempio 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;
        }
Esempio n. 3
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);


            oItemRef = oForm.Items.Item("2");


            try
            {
                SAPbouiCOM.Item oItemRef1 = oForm.Items.Item("2");


                oItem         = oForm.Items.Add("B1_IMP", SAPbouiCOM.BoFormItemTypes.it_BUTTON);
                oItem.Top     = oItemRef.Top;
                oItem.Height  = oItemRef.Height;
                oItem.Left    = oItemRef.Left + oItemRef.Width + 5;
                oItem.Width   = oItemRef.Width + 80;
                oItem.Visible = true;
                B1_IMP        = (SAPbouiCOM.Button)oItem.Specific;

                B1_IMP.Caption = "Import BOM from FPRO";
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }

            oForm.Freeze(false);
            dsWEB = new DataServices(Program.strExtCon);
        }
Esempio n. 4
0
        private void ClearUnManagedObject() {
			if ( oButton != null ) { Marshal.ReleaseComObject(oButton); } oButton = null;
            if ((oForm != null)) {
                Marshal.ReleaseComObject(oForm);
            }
            oForm = null;
            // ADD YOUR ACTION CODE HERE ...
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
        }
Esempio n. 5
0
        private void CriarFormularioComMatrix()
        {
            SAPbouiCOM.Button     oButton     = null;
            SAPbouiCOM.StaticText oStaticText = null;
            SAPbouiCOM.EditText   oEditText   = null;

            SAPbouiCOM.FormCreationParams oCreationParams = null;
            oCreationParams = ((SAPbouiCOM.FormCreationParams)(oApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)));
            //oCreationParams.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed;
            oCreationParams.UniqueID = "frmMtx";
            oCreationParams.FormType = "frmMtx";

            oForm = oApplication.Forms.AddEx(oCreationParams);

            oForm.Title        = "Matrix, DataSources and Linked Buttons";
            oForm.Left         = 336;
            oForm.ClientWidth  = 520;
            oForm.Top          = 44;
            oForm.ClientHeight = 200;


            oItem           = oForm.Items.Add("1 ", BoFormItemTypes.it_BUTTON);
            oItem.Left      = 5;
            oItem.Width     = 65;
            oItem.Top       = 170;
            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       = 170;
            oItem.Height    = 19;
            oButton         = ((SAPbouiCOM.Button)(oItem.Specific));
            oButton.Caption = "Cancel";

            oItem        = oForm.Items.Add("txtPhone", SAPbouiCOM.BoFormItemTypes.it_EDIT);
            oItem.Left   = 265;
            oItem.Width  = 163;
            oItem.Top    = 172;
            oItem.Height = 14;

            oItem           = oForm.Items.Add("btnPhone ", BoFormItemTypes.it_BUTTON);
            oItem.Left      = 160;
            oItem.Width     = 100;
            oItem.Top       = 170;
            oItem.Height    = 19;
            oButton         = ((SAPbouiCOM.Button)(oItem.Specific));
            oButton.Caption = "Add Phone Prefix";

            this.oForm.Visible = true;

            AddMatrixNoForm();
        }
Esempio n. 6
0
        private void InitiallizeForm()
        {
            Program.objHrmsUI.loadSettings();
            Program.isDemo = Program.objHrmsUI.settings["IsDemo"].ToString() == "Y" ? true : false;


            oForm.Freeze(true);

            initiallizing = true;



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


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

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

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

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

            ini_controls();

            oForm.Freeze(false);

            initiallizing = false;
        }
        public static SAPbouiCOM.Button AddBotaoImagemAoFormulario(
            SAPbouiCOM.Form pForm
            , string pUID
            , int pLeft
            , int pWidth
            , int pTop
            , int pHeight
            , string pImagem
            , bool AffectsFormMode = false
            , int pFromPane        = 0
            , int pToPane          = 0
            )
        {
            SAPbouiCOM.Button oButton = null;
            SAPbouiCOM.Item   oItem   = null;
            oItem = pForm.Items.Add(pUID, SAPbouiCOM.BoFormItemTypes.it_BUTTON);

            if (pLeft > 0)
            {
                oItem.Left = pLeft;
            }
            if (pWidth > 0)
            {
                oItem.Width = pWidth;
            }
            if (pTop > 0)
            {
                oItem.Top = pTop;
            }
            if (pHeight > 0)
            {
                oItem.Height = pHeight;
            }

            oItem.AffectsFormMode = AffectsFormMode;
            if (pFromPane > 0)
            {
                oItem.FromPane = pFromPane;
            }
            if (pToPane > 0)
            {
                oItem.ToPane = pToPane;
            }


            oButton       = ((SAPbouiCOM.Button)(oItem.Specific));
            oButton.Type  = BoButtonTypes.bt_Image;
            oButton.Image = pImagem;
            //oButton.Caption = pCaption;

            return(oButton);
        }
Esempio n. 8
0
        /// <summary>
        /// Inicializa los componentes de la forma activa
        /// </summary>
        public void inicializarComponentes()
        {
            try
            {
                _oForma      = _Application.Forms.Item(formID);
                _oForma.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE;
                _oForma.Freeze(true);

                //Código del asociado
                _oForma.DataSources.UserDataSources.Add(TXT_CODIGO_ASOCIADO, BoDataType.dt_SHORT_TEXT, 10);
                _oTxtCodigoAsociado = (SAPbouiCOM.EditText)_oForma.Items.Item(TXT_CODIGO_ASOCIADO).Specific;
                _oTxtCodigoAsociado.DataBind.SetBound(true, "", TXT_CODIGO_ASOCIADO);

                //Nombre del asociado
                _oForma.DataSources.UserDataSources.Add(TXT_NOMBRE_ASOCIADO, BoDataType.dt_SHORT_TEXT, 150);
                _oTxtNombreAsociado = (SAPbouiCOM.EditText)_oForma.Items.Item(TXT_NOMBRE_ASOCIADO).Specific;
                _oTxtNombreAsociado.DataBind.SetBound(true, "", TXT_NOMBRE_ASOCIADO);

                //Código de oficina
                _oForma.DataSources.UserDataSources.Add(TXT_CODIGO_OFICINA, BoDataType.dt_SHORT_TEXT, 10);
                _oTxtCodigoOficina = (SAPbouiCOM.EditText)_oForma.Items.Item(TXT_CODIGO_OFICINA).Specific;
                _oTxtCodigoOficina.DataBind.SetBound(true, "", TXT_CODIGO_OFICINA);

                //Nombre de oficina
                _oForma.DataSources.UserDataSources.Add(TXT_NOMBRE_OFICINA, BoDataType.dt_SHORT_TEXT, 150);
                _oTxtNombreOficina = (SAPbouiCOM.EditText)_oForma.Items.Item(TXT_NOMBRE_OFICINA).Specific;
                _oTxtNombreOficina.DataBind.SetBound(true, "", TXT_NOMBRE_OFICINA);

                //Código de solicitud
                _oForma.DataSources.UserDataSources.Add(TXT_CODIGO_SOLICITUD, BoDataType.dt_SHORT_TEXT, 20);
                _oTxtCodigoSolicitud = (SAPbouiCOM.EditText)_oForma.Items.Item(TXT_CODIGO_SOLICITUD).Specific;
                _oTxtCodigoSolicitud.DataBind.SetBound(true, "", TXT_CODIGO_SOLICITUD);

                _oBtnImprimirArqueo = _oForma.Items.Item(BTN_IMPRIMIR_ARQUEO).Specific;
                _oBtnImprimirArqueo.Item.Visible = false;

                _oTxtCodigoAsociado.Active = true;

                //Declarar DataTable
                _oForma.DataSources.DataTables.Add(DT_ARQUEOS);
            }
            catch (Exception ex)
            {
                _Application.MessageBox("Error al inicializar : " + ex.Message);
            }
            finally
            {
                _oForma.Freeze(false);
            }
        }
Esempio n. 9
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);

            initiallizing = true;

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

            dtA  = oForm.DataSources.DataTables.Item("dtA");
            dtS  = oForm.DataSources.DataTables.Item("dtS");
            dtAW = oForm.DataSources.DataTables.Item("dtAW");
            dtSW = oForm.DataSources.DataTables.Item("dtSW");



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


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

            dtHead.Rows.Add(1);


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

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

            cbPWHS = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbPWHS").Specific;


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



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

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

            initiallizing = true;

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

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

            dtHead.Rows.Add(1);


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

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


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


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



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


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

            initiallizing = false;
            getCodes();
        }
Esempio n. 11
0
 public override void OnInitializeComponent()
 {
     this.StaticText0           = ((SAPbouiCOM.StaticText)(this.GetItem("lb_pcode").Specific));
     this.EditText0             = ((SAPbouiCOM.EditText)(this.GetItem("txt_pcode").Specific));
     this.Button0               = ((SAPbouiCOM.Button)(this.GetItem("bt_info").Specific));
     this.Button0.PressedAfter += new SAPbouiCOM._IButtonEvents_PressedAfterEventHandler(this.Button0_PressedAfter);
     this.StaticText1           = ((SAPbouiCOM.StaticText)(this.GetItem("lb_ptype").Specific));
     this.EditText1             = ((SAPbouiCOM.EditText)(this.GetItem("txt_ptype").Specific));
     this.StaticText2           = ((SAPbouiCOM.StaticText)(this.GetItem("lb_pname").Specific));
     this.EditText2             = ((SAPbouiCOM.EditText)(this.GetItem("txt_pname").Specific));
     this.Button1               = ((SAPbouiCOM.Button)(this.GetItem("bt_clone").Specific));
     this.Button1.PressedAfter += new SAPbouiCOM._IButtonEvents_PressedAfterEventHandler(this.Button1_PressedAfter);
     this.StaticText3           = ((SAPbouiCOM.StaticText)(this.GetItem("lb_bpname").Specific));
     this.EditText3             = ((SAPbouiCOM.EditText)(this.GetItem("txt_bpname").Specific));
     this.StaticText4           = ((SAPbouiCOM.StaticText)(this.GetItem("lb_pgrp").Specific));
     this.EditText4             = ((SAPbouiCOM.EditText)(this.GetItem("txt_pgroup").Specific));
     this.EditText5             = ((SAPbouiCOM.EditText)(this.GetItem("t_absentry").Specific));
     this.OnCustomInitialize();
 }
Esempio n. 12
0
 public virtual bool ET_1_BFItemPressed(ItemEvent pVal) {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("1").Specific));
     // ADD YOUR ACTION CODE HERE ...
     try
     {
         switch (oForm.Mode)
         {
             case BoFormMode.fm_ADD_MODE:
                 if (CheckValues() == false)
                 {
                     return false;
                 }
                 break;
             case BoFormMode.fm_EDIT_MODE:
                 break;
             case BoFormMode.fm_FIND_MODE:
                 break;
             case BoFormMode.fm_OK_MODE:
                 
                 break;
             case BoFormMode.fm_PRINT_MODE:
                 break;
             case BoFormMode.fm_UPDATE_MODE:
                 if (CheckValues() == false)
                 {
                     return false;
                 }
                 break;
             case BoFormMode.fm_VIEW_MODE:
                 break;
             default:
                 break;
         }
     }
     catch (Exception ex)
     {
         B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
     }
     return true;
 }
Esempio n. 13
0
 /// <summary>
 /// Inicializa los componentes de la forma activa
 /// </summary>
 public void inicializarComponentes()
 {
     try
     {
         _oForma      = _Application.Forms.Item(formID);
         _oForma.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE;
         _oForma.Freeze(true);
         //Declarar DataTable
         _oForma.DataSources.DataTables.Add(DT_COMISIONES_COBRADORES);
         _oTxtCodeCobrador        = _oForma.Items.Item(TXTCODCOB).Specific;
         _oTxtNomCobrador         = _oForma.Items.Item(TXTNOMCOB).Specific;
         _oBotonUpdate            = _oForma.Items.Item(BTN_UPDATE).Specific;
         _oTxtCodeCobrador.Active = true;
     }
     catch (Exception ex)
     {
         _Application.MessageBox("Error al inicializar: " + ex.Message);
     }
     finally
     {
         _oForma.Freeze(false);
     }
 }
Esempio n. 14
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);
            dbOITB = oForm.DataSources.DBDataSources.Item("OITB");



            oItemRef = oForm.Items.Item("2");
            SAPbouiCOM.StaticText lblCode, lblName, lblInt;
            SAPbouiCOM.CheckBox   chkAll, chkMon, chkTue, chkWed, chkThs, chkFri, chkSat, chkSun;
            SAPbouiCOM.ComboBox   cbInt;
            SAPbouiCOM.EditText   txtCode, txtName;


            try
            {
                SAPbouiCOM.Item oItemRef1 = oForm.Items.Item("9");


                oItem         = oForm.Items.Add("B1_ITB", SAPbouiCOM.BoFormItemTypes.it_BUTTON);
                oItem.Top     = oItemRef.Top;
                oItem.Height  = oItemRef.Height;
                oItem.Left    = oItemRef.Left + oItemRef.Width + 5;
                oItem.Width   = oItemRef.Width + 40;
                oItem.Visible = true;
                B1_ITB        = (SAPbouiCOM.Button)oItem.Specific;

                B1_ITB.Caption = "Item Sub Groups";
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }

            oForm.Freeze(false);
            dsSAP = new DataServices(Program.strConSAP);
        }
        public static SAPbouiCOM.Button AddBotaoAoFormulario(
            SAPbouiCOM.Form pForm
            , string pUID
            , int pLeft
            , int pWidth
            , int pTop
            , int pHeight
            , string pCaption
            )
        {
            SAPbouiCOM.Button oButton = null;
            SAPbouiCOM.Item   oItem   = null;
            oItem                 = pForm.Items.Add(pUID, SAPbouiCOM.BoFormItemTypes.it_BUTTON);
            oItem.Left            = pLeft;
            oItem.Width           = pWidth;
            oItem.Top             = pTop;
            oItem.Height          = pHeight;
            oItem.AffectsFormMode = false;

            oButton         = ((SAPbouiCOM.Button)(oItem.Specific));
            oButton.Caption = pCaption;

            return(oButton);
        }
Esempio n. 16
0
        public virtual void ET_btnUPDATE_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnUPDATE").Specific));
            
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                if (CFL.COMMON_MESSAGE("?", "독자마스터에 배송처를 반영하시겠습니까?") != 1)
                {
                    return;
                }

                StringBuilder sb = new StringBuilder();

                string query = string.Empty;

                string DocEntry = string.Empty;
                string U_STATUS = string.Empty;

                DocEntry = FN.GetItemValue(ref oForm, "edtDOCNO");

                try
                {
                    B1Connections.diCompany.StartTransaction();

                    string U_RELDT = B1Connections.diCompany.GetCompanyDate().ToString("yyyy-MM-dd");//임포트 실행일
                    string U_RELTIME = B1Connections.diCompany.GetCompanyTime().Replace(":","");//임포트 실행시간
                    string U_RELUSER = B1Connections.diCompany.UserName;//임포트 실행 사용자

                    query = string.Format(" EXEC KIS_SP_SO0060A_HRD @DocEntry='{0}', @U_RELDT='{1}', @U_RELTIME='{2}', @U_RELUSER='******' ", DocEntry, U_RELDT, U_RELTIME, U_RELUSER);

                    string[] rError = FN.GetRecordsetArrayValue(query);

                    if (B1Connections.diCompany.InTransaction)
                    {
                        B1Connections.diCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit);
                    }

                    // 재조회
                    SetFormLoadFromDBDatasource(DocEntry);

                }
                catch (Exception ex)
                {
                    B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);

                    if (B1Connections.diCompany.InTransaction == true)
                    {
                        B1Connections.diCompany.EndTransaction(BoWfTransOpt.wf_RollBack);
                    }
                }
                finally
                {
                    
                }
            }
            catch (Exception ex)
            {

                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
Esempio n. 17
0
        public virtual bool ET_1_BFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("1").Specific));

            // ADD YOUR ACTION CODE HERE ...
            FN.SetUserDateSource_Clear(ref oForm);
            return true;

        }
Esempio n. 18
0
        public virtual void ET_btnBACK_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnBACK").Specific));
            // ADD YOUR ACTION CODE HERE ...

            try
            {
                string strPFormUID = oForm.DataSources.UserDataSources.Item("pFORMUID").ValueEx;
                if (strPFormUID != "")
                {
                    oForm.Visible = false;
                    SAPbouiCOM.Form pForm = B1Connections.theAppl.Forms.Item(strPFormUID);
                    pForm.Select();
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
Esempio n. 19
0
        /// <summary>
        /// Eventos de la forma activa
        /// </summary>
        /// <param name="FormUID">Id de la forma</param>
        /// <param name="pVal">Propiedades de la forma</param>
        /// <param name="BubbleEvent">Evento true/false</param>
        public override void eventos(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool bubbleEvent)
        {
            bubbleEvent = true;
            try
            {
                if (pVal.BeforeAction == false && pVal.FormType == FRM_TRANSFERENCIA_DE_STOCK)
                {
                    if (pVal.EventType == BoEventTypes.et_FORM_RESIZE)
                    {
                        _oForm = _Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                        OcultarControlesVentana(_oForm);
                        CrearCamposDeUsuario(_oForm);
                    }

                    if (pVal.EventType == BoEventTypes.et_FORM_CLOSE)
                    {
                        if (_oContadorFormas == 1)
                        {
                            _Application.ItemEvent      -= new _IApplicationEvents_ItemEventEventHandler(SBO_Application_ItemEvent);
                            _Application.StatusBarEvent -= new SAPbouiCOM._IApplicationEvents_StatusBarEventEventHandler(SBO_Application_StatusBarEvent);
                            Dispose();
                            application            = null;
                            company                = null;
                            _oTransferenciaDeStock = false;
                            Addon.typeList.RemoveAll(p => p._forma == formID);
                            return;
                        }
                        else
                        {
                            _oContadorFormas -= 1;
                        }
                    }

                    if (pVal.EventType == BoEventTypes.et_FORM_ACTIVATE)
                    {
                        _oForm = _Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                        CrearCamposDeUsuario(_oForm);
                    }
                }

                if (pVal.BeforeAction == true && pVal.FormType == FRM_TRANSFERENCIA_DE_STOCK)
                {
                    if (pVal.ItemUID == TXT_SERIE && pVal.CharPressed == CHAR_PRESS_ENTER && pVal.EventType == BoEventTypes.et_KEY_DOWN)
                    {
                        _oForm          = _Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                        _oTxtSerie      = _oForm.Items.Item(TXT_SERIE).Specific;
                        _oAlmacenOrigen = _oForm.Items.Item(TXT_ALMACEN_ORIGEN).Specific;
                        _oForm.Select();
                        if (!string.IsNullOrEmpty(_oTxtSerie.Value.ToString()))
                        {
                            _oForm.Select();
                            AgregarArticulo(_oForm, _oTxtSerie.Value.ToString(), _oAlmacenOrigen.Value.ToString());
                            _oForm.Select();
                        }
                        else
                        {
                            _Application.MessageBox("Capture el número de serie");
                        }
                        bubbleEvent = false;
                        return;
                    }

                    if (pVal.EventType == BoEventTypes.et_KEY_DOWN && pVal.ItemUID == GRID_ARTICULOS && pVal.ColUID == COLUMNA_SERIE_INICIO && pVal.CharPressed == CHAR_PRESS_ENTER)
                    {
                        bubbleEvent = false;
                        return;
                    }
                    if (pVal.EventType == BoEventTypes.et_KEY_DOWN && pVal.ItemUID == GRID_ARTICULOS && pVal.ColUID == COLUMNA_SERIE_FIN && pVal.CharPressed == CHAR_PRESS_ENTER)
                    {
                        bubbleEvent = false;
                        return;
                    }

                    if (pVal.EventType == BoEventTypes.et_KEY_DOWN && pVal.ItemUID == GRID_ARTICULOS && pVal.ColUID == COLUMNA_SERIE && pVal.CharPressed == CHAR_PRESS_ENTER)
                    {
                        bubbleEvent = false;
                        return;
                    }

                    if (pVal.EventType == BoEventTypes.et_ITEM_PRESSED && pVal.ItemUID == BTN_CREAR && pVal.InnerEvent == true)
                    {
                        bubbleEvent = false;
                        return;
                    }

                    if (pVal.EventType == BoEventTypes.et_ITEM_PRESSED && pVal.ItemUID == BTN_CREAR && pVal.InnerEvent == false)
                    {
                        _oForm       = _Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                        oBtnCrearSAP = _oForm.Items.Item(BTN_CREAR).Specific;

                        if (oBtnCrearSAP.Caption == "Crear")
                        {
                            string msgError = ValidarStatusSolicitudGrid(_oForm);

                            if (!string.IsNullOrEmpty(msgError))
                            {
                                _Application.MessageBox(msgError);
                                bubbleEvent = false;
                                bubbleEvent = false;
                                return;
                            }
                        }
                    }
                }

                if (pVal.BeforeAction == true && pVal.FormType == -FRM_TRANSFERENCIA_DE_STOCK)
                {
                    if (pVal.EventType == BoEventTypes.et_COMBO_SELECT && pVal.ItemUID == TIPO_MOVIMIENTO)
                    {
                        _oForm = _Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                        _oCmbTipoMovimiento = _oForm.Items.Item(TIPO_MOVIMIENTO).Specific;

                        if (!string.IsNullOrEmpty(_oCmbTipoMovimiento.Value.ToString()))
                        {
                            if (_oForm.Mode == BoFormMode.fm_ADD_MODE)
                            {
                                if (_Application.MessageBox("Estas seguro de cambiar el tipo de movimiento sin crear." + Environment.NewLine + "¿Desea continuar?", 2, "Si", "No") == 1)
                                {
                                    try
                                    {
                                        _oTxtPromotor.Value = "";
                                    }
                                    catch (Exception)
                                    {
                                    }
                                }
                                else
                                {
                                    bubbleEvent = false;
                                }
                            }
                        }
                    }
                }



                if (pVal.BeforeAction == false && pVal.FormType == -FRM_TRANSFERENCIA_DE_STOCK)
                {
                    if (pVal.EventType == BoEventTypes.et_COMBO_SELECT && pVal.ItemUID == TIPO_MOVIMIENTO)
                    {
                        _oForm = _Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                        _oForm.Freeze(true);
                        SAPbouiCOM.Form F1 = _Application.Forms.GetFormByTypeAndCount(Convert.ToInt32(_oForm.TypeEx.TrimStart('-')), _oForm.TypeCount);
                        F1.Freeze(true);
                        _oTxtPromotor       = F1.Items.Item(TXT_PROMOTOR).Specific;
                        _oTxtNombrePromotor = F1.Items.Item(TXT_NOMBRE_PROMOTOR).Specific;
                        _oTxtSerie          = F1.Items.Item(TXT_SERIE).Specific;
                        _oCmbTipoMovimiento = _oForm.Items.Item(TIPO_MOVIMIENTO).Specific;


                        if (!string.IsNullOrEmpty(_oCmbTipoMovimiento.Value.ToString()))
                        {
                            F1.Items.Item(TXT_SERIE).Enabled = true;
                            TipoMovimiento            = _oCmbTipoMovimiento.Value.ToString().TrimEnd(' ');
                            _oTxtFechaContabilizacion = F1.Items.Item(TXT_FECHA_CONTABILIZACION).Specific;
                            _oTxtFechaDocumento       = F1.Items.Item(TXT_FECHA_DOCUMENTO).Specific;

                            if (TipoMovimiento != "PROMOTORES - OFICINAS" && TipoMovimiento != "OFICINAS - PROMOTORES")
                            {
                                if (_oForm.Mode == BoFormMode.fm_ADD_MODE)
                                {
                                    _oTxtPromotor.Value       = Extensor.ObtenerSecretaria(_Company, "U_codigo_secretaria");
                                    _oTxtNombrePromotor.Value = Extensor.ObtenerSecretaria(_Company, "T0.U_nombre_secretaria");
                                }
                            }
                            else
                            {
                                if (_oForm.Mode == BoFormMode.fm_ADD_MODE)
                                {
                                    _oTxtPromotor.Value       = "";
                                    _oTxtNombrePromotor.Value = "";
                                }
                            }

                            if (TipoMovimiento == "PROMOTORES - OFICINAS" || TipoMovimiento == "OFICINAS - PROMOTORES")
                            {
                                if (_oForm.Mode == BoFormMode.fm_ADD_MODE)
                                {
                                    //if (Extensor.ValidarImpresionCorteSolicitudes(_Company))
                                    //{
                                    if (F1.Items.Item(TXT_FECHA_DOCUMENTO).Enabled == true)
                                    {
                                        _oTxtFechaContabilizacion.Value = DateTime.Now.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);
                                        _oTxtFechaDocumento.Value       = DateTime.Now.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);
                                        F1.Items.Item(TXT_FECHA_CONTABILIZACION).Enabled = false;
                                        F1.Items.Item(TXT_PROMOTOR).Click();
                                        F1.Items.Item(TXT_FECHA_DOCUMENTO).Enabled = false;
                                    }
                                    //}
                                    //else
                                    //{
                                    //    if (F1.Items.Item(TXT_FECHA_DOCUMENTO).Enabled == true)
                                    //    {
                                    //        DateTime hoy = DateTime.Now;
                                    //        DateTime mañana = hoy.AddDays(1);
                                    //        _oTxtFechaContabilizacion.Value = hoy.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture).ToString();
                                    //        _oTxtFechaDocumento.Value = mañana.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture).ToString();
                                    //        F1.Items.Item(TXT_FECHA_CONTABILIZACION).Enabled = false;
                                    //        F1.Items.Item(TXT_PROMOTOR).Click();
                                    //        F1.Items.Item(TXT_FECHA_DOCUMENTO).Enabled = false;
                                    //    }
                                    //}
                                }
                            }
                            else
                            {
                                if (_oForm.Mode == BoFormMode.fm_ADD_MODE)
                                {
                                    F1.Items.Item(TXT_PROMOTOR).Click();
                                    F1.Items.Item(TXT_FECHA_CONTABILIZACION).Enabled = true;
                                    _oTxtFechaContabilizacion.Value = DateTime.Now.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);
                                    F1.Items.Item(TXT_PROMOTOR).Click();
                                    F1.Items.Item(TXT_FECHA_DOCUMENTO).Enabled = true;
                                    _oTxtFechaDocumento.Value = DateTime.Now.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);
                                }
                            }
                        }

                        _oForm.Freeze(false);
                        F1.Freeze(false);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en método 'eventos' *clsTransferenciaDeStock* : " + ex.Message);
            }
        }
Esempio n. 20
0
        public virtual void ET_btn1_AFItemPressed(ItemEvent pVal) {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btn1").Specific));
            // ADD YOUR ACTION CODE HERE ...
            try
            {

                string FileName = TR_COMMON_HRD.ShowInput("저장", "파일이름을 입력하세요");

                if (string.IsNullOrEmpty(FileName) == false)
                {
                    UDO_Add_Data(FileName);
                }

            }
            catch (Exception ex)
            {

                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }

        }
Esempio n. 21
0
        private void SBO_Application_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;
            try
            {
                if (pVal.FormTypeEx == "0" && pVal.FormTypeCount == 2 &&
                    pVal.EventType == BoEventTypes.et_FORM_LOAD && pVal.BeforeAction == false && pVal.ActionSuccess == true)
                {
                    SAPbouiCOM.Form formaEmergente = null;
                    formaEmergente = SBO_Application.Forms.GetForm(pVal.FormTypeEx, pVal.FormTypeCount);
                    if (formaEmergente.Title == "Mensaje sistema")
                    {
                        SAPbouiCOM.StaticText itemMensaje = null;

                        itemMensaje = formaEmergente.Items.Item(7).Specific;
                        var msgDescripcion = itemMensaje.Caption;

                        if (msgDescripcion.Contains(" ya se ha definido en el sistema en un campo único."))
                        {
                            SAPbouiCOM.Button btnCancel = null;
                            btnCancel = formaEmergente.Items.Item(1).Specific;
                            btnCancel.Item.Click();
                        }
                    }
                }

                if (pVal.BeforeAction == true)
                {
                    if (pVal.FormTypeEx == FRM_DATOS_MAESTROS_SOCIO.ToString() && pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD)
                    {
                        Instance.Ejecutaclase("2561");
                    }

                    if (pVal.FormTypeEx == FRM_SOLICITUD_DE_PLANES.ToString() && pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD)
                    {
                        Instance.Ejecutaclase("39698");
                    }

                    if (pVal.FormTypeEx == FRM_ORDEN_DE_COMPRA.ToString() && pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD)
                    {
                        Instance.Ejecutaclase("2305");
                    }

                    if (pVal.FormTypeEx == FRM_ENTRADA_DE_MERCANCIA.ToString() && pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD)
                    {
                        Instance.Ejecutaclase("2306");
                    }

                    if (pVal.FormTypeEx == FRM_FACTURA_DE_PROVEEDOR.ToString() && pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD)
                    {
                        Instance.Ejecutaclase("2308");
                    }

                    if (pVal.FormTypeEx == FRM_SOLICITUD_DE_TRASLADO.ToString() && pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD)
                    {
                        Instance.Ejecutaclase("3088");
                    }

                    if (pVal.FormTypeEx == FRM_TRANSFERENCIA_DE_STOCK.ToString() && pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD)
                    {
                        Instance.Ejecutaclase("3080");
                    }

                    if (pVal.FormTypeEx == FRM_FACTURA_CLIENTES.ToString() && pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD)
                    {
                        Instance.Ejecutaclase("2053");
                    }

                    if (pVal.FormTypeEx == FRM_DATOS_MAESTROS_EMPLEADO.ToString() && pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD)
                    {
                        Instance.Ejecutaclase("3590");
                    }

                    if (pVal.FormTypeEx == FRM_TRASPASOS)
                    {
                        if (pVal.EventType == BoEventTypes.et_KEY_DOWN && pVal.ItemUID == CAMPO_SERIE && pVal.CharPressed == CHAR_PRESS_ENTER)
                        {
                            BubbleEvent = false;
                            return;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Esempio n. 22
0
        public virtual void ET_btnSTOP_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnSTOP").Specific));
            // ADD YOUR ACTION CODE HERE ...

            int idx = 0;
            string strRowStat = string.Empty;
            try
            {
                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_DUMY").Specific;
                oDB1_Z = oForm.DataSources.DBDataSources.Item("@KIS_SO00301Z_HRD");

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

                string strStopDate = oForm.DataSources.UserDataSources.Item("edtSTOPDT").ValueEx;
                
                //if (String.IsNullOrEmpty(strNowDate))
                //{
                //    B1Connections.theAppl.StatusBar.SetText("중지 일자가 입력되지 않았습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                //    //oForm.Items.Item("btnSTOP").Click(0);
                //    return ;
                //}

                for (int i = 1; i <= oMatrix.VisualRowCount; i++)
                {
                    idx = GetDataTableIndexByMatrix(oMatrix, i);
                    strRowStat = gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["ROWSTATE"].ToString(); //Row상태값

                    if (strNowDate.CompareTo(strStopDate) >= 0)
                    {
                        // 상태값
                        oMatrix.SetCellWithoutValidation(i, "U_STATUS", "US");
                        gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["STATUS"] = "US";

                    }
                    else
                    {
                        // 상태값
                        oMatrix.SetCellWithoutValidation(i, "U_STATUS", "UO");
                        gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["STATUS"] = "UO";

                    }


                    // 중지일자
                    //oMatrix.SetCellWithoutValidation(i, "U_CLOSEDT", strStopDate);
                    //gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["CLOSEDT"] = FN.SetDateFormatToDB(strStopDate, FN.eDateType.n_YYYYMMDD);
                    oMatrix.SetCellWithoutValidation(i, "U_CLOSEDT", strNowDate);
                    gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["CLOSEDT"] = FN.SetDateFormatToDB(strNowDate, FN.eDateType.n_YYYYMMDD);

                    // 배달종료일자 
                    oMatrix.SetCellWithoutValidation(i, "U_DELVTO", strStopDate);
                    gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["DELVTO"] = FN.SetDateFormatToDB(strStopDate, FN.eDateType.n_YYYYMMDD);

                    if (string.IsNullOrEmpty(strRowStat))
                    {
                        gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["ROWSTATE"] = "M";
                        SetSumNumberOfCofies(oForm);
                    }
                }

                if (oMatrix.VisualRowCount > 0)
                {
                    oMatrix.FlushToDataSource();

                    if (oForm.Mode == BoFormMode.fm_OK_MODE)
                        oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 23
0
        public virtual void ET_1_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("1").Specific));
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                if (oForm.Mode == BoFormMode.fm_ADD_MODE)
                {
                    SetAddedDefualtFormat();
                }
                else if (oForm.Mode == BoFormMode.fm_OK_MODE)
                {
                    //FormData After 이벤트 발생후 btnTARGET 활성화처리때 비활성이 되버림.
                    //버튼이벤트후 다시 btnTARGET 아이템을 활성화 처리하기 위해 호출.
                    SetET_AFFormDataLoad();
                }
                else if (oForm.Mode == BoFormMode.fm_UPDATE_MODE)
                {
                    FN.SetItemEnable(oForm, "btnTARGET", false);
                }
            }
            catch (Exception ex)
            {

                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
Esempio n. 24
0
 public virtual void ET_btnCANCEL_AFItemPressed(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnCANCEL").Specific));
     
     // ADD YOUR ACTION CODE HERE ...
     if (CancelData(oForm))
         FindData(oForm);
 }
Esempio n. 25
0
        public virtual void ET_btnPAYMETH_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnPAYMETH").Specific));
            // ADD YOUR ACTION CODE HERE ...


            try
            {
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");

                string strChildFormID = oForm.DataSources.UserDataSources.Item("cFORMUID").Value;
                if (!FN.GetFormExistsChk(strChildFormID))
                {
                    Dictionary<string, string> dicParam = new Dictionary<string, string>();

                    dicParam.Add("U_BANKNM", oDB_M.GetValue("U_BANKNM", 0).ToString());
                    dicParam.Add("U_BNKACCT", oDB_M.GetValue("U_BNKACCT", 0).ToString());
                    dicParam.Add("U_CREDTBP", oDB_M.GetValue("U_CREDTBP", 0).ToString());
                    dicParam.Add("U_DEPNAME", oDB_M.GetValue("U_DEPNAME", 0).ToString());
                    dicParam.Add("U_CREDTNO", oDB_M.GetValue("U_CREDTNO", 0).ToString());
                    dicParam.Add("U_VALIDMY", oDB_M.GetValue("U_VALIDMY", 0).ToString());
                    dicParam.Add("U_CREDTNM", oDB_M.GetValue("U_CREDTNM", 0).ToString());
                    dicParam.Add("U_JMNO", oDB_M.GetValue("U_JMNO", 0).ToString());

                    dicParam.Add("U_JMNOYN", oDB_M.GetValue("U_JMNOYN", 0).ToString());

                    KIS_SO0031A_HRD SO0031A_HRD = new KIS_SO0031A_HRD();
                    SO0031A_HRD.A00_SubFormInit(oForm.UniqueID, dicParam);
                    SO0031A_HRD = null;
                }

            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 26
0
 public virtual void ET_btnFIND_AFClick(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnFIND").Specific));
     
     // ADD YOUR ACTION CODE HERE ...
     FindData(oForm);
 }
Esempio n. 27
0
        /// <summary>
        /// Asigna los numero de serie correspondientes a cada artículo
        /// </summary>
        /// <param name="_oForm">Forma activa</param>
        private void AsignarNumerosDeSeries(Form _oForm)
        {
            try
            {
                _oForm.Freeze(true);
                _oMatrixSerieArticulos = _oForm.Items.Item(GRID_ARTICULOS_SERIE).Specific;

                for (int noLinea = 1; noLinea <= _oMatrixSerieArticulos.RowCount; noLinea++)
                {
                    _oMatrixSerieDefinir = _oForm.Items.Item(GRID_SERIE_DEFINIR).Specific;
                    if (_oMatrixSerieDefinir.RowCount == 1)
                    {
                        _oClaveArticulo   = (SAPbouiCOM.EditText)_oMatrixSerieArticulos.Columns.Item(COLUMNA_CLAVE_ARTICULO).Cells.Item(noLinea).Specific;
                        _oTotalNecesarios = (SAPbouiCOM.EditText)_oMatrixSerieArticulos.Columns.Item(COLUMNA_TOTAL_NECESITADOS).Cells.Item(noLinea).Specific;

                        var serieI = lDatosEntradaMercancia.ElementAt(noLinea - 1).serieInial;
                        var serieF = lDatosEntradaMercancia.ElementAt(noLinea - 1).serieFinal;

                        int x = 1;

                        string PrefijoSerie  = serieI.ToString().Substring(0, 6);
                        int    serieInicial  = Convert.ToInt32(serieI.ToString().Substring(6));
                        int    longitudSerie = serieI.ToString().Substring(6).Length;
                        int    serieFinal    = Convert.ToInt32(serieF.ToString().Substring(6));
                        int    totalSeries   = (serieFinal - serieInicial) + 1;
                        double necesarios    = Convert.ToDouble(_oTotalNecesarios.Value);

                        if (totalSeries <= necesarios)
                        {
                            while (serieInicial <= serieFinal)
                            {
                                _Application.StatusBar.SetText("Seleccionando serie " + _oClaveArticulo.Value.ToString() + " : " + x + " de " + totalSeries,
                                                               BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Warning);

                                if (serieInicial.ToString().Length < longitudSerie)
                                {
                                    _oMatrixSerieDefinir.Columns.Item(COLUMNA_SERIE_FABRICANTE).Cells.Item(x).Specific.Value = PrefijoSerie + serieInicial.ToString().PadLeft(longitudSerie, '0');
                                    _oMatrixSerieDefinir.Columns.Item(COLUMNA_NUMERO_SERIE).Cells.Item(x).Specific.Value     = PrefijoSerie + serieInicial.ToString().PadLeft(longitudSerie, '0');
                                }
                                else
                                {
                                    _oMatrixSerieDefinir.Columns.Item(COLUMNA_SERIE_FABRICANTE).Cells.Item(x).Specific.Value = PrefijoSerie + serieInicial.ToString();
                                    _oMatrixSerieDefinir.Columns.Item(COLUMNA_NUMERO_SERIE).Cells.Item(x).Specific.Value     = PrefijoSerie + serieInicial.ToString();
                                }

                                x            += 1;
                                serieInicial += 1;
                            }
                        }
                        else
                        {
                            _Application.MessageBox("El total de series es mayor al total necesitado: " + _oClaveArticulo.Value.ToString());
                        }
                    }

                    _oMatrixSerieArticulos = _oForm.Items.Item(GRID_ARTICULOS_SERIE).Specific;
                    if (_oMatrixSerieArticulos.RowCount >= 1)
                    {
                        SAPbouiCOM.Button item = _oForm.Items.Item(BTN_ACTUALIZAR).Specific;
                        if (item.Caption == "Actualizar")
                        {
                            _oForm.Items.Item(BTN_ACTUALIZAR).Click();
                        }
                    }
                    _oMatrixSerieArticulos = _oForm.Items.Item(GRID_ARTICULOS_SERIE).Specific;
                    if (noLinea < _oMatrixSerieArticulos.RowCount)
                    {
                        _oMatrixSerieArticulos.Columns.Item(COLUMNA_NIVEL_LINEA).Cells.Item(noLinea + 1).Click();
                    }
                }
                lDatosEntradaMercancia.Clear();
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("Form - Bad Value"))
                {
                    _Application.MessageBox("El número de Solicitud ya existe");
                }
                else
                {
                    throw new Exception("Error al asignar números de serie *AsignarNumerosDeSeries* : " + ex.Message);
                }
            }
            finally
            {
                _oForm.Freeze(false);
            }
        }
Esempio n. 28
0
        public override void etAfterActClick(ref ItemEvent pVal, ref bool BubbleEvent)
        {
            base.etAfterActClick(ref pVal, ref BubbleEvent);
            if (pVal.ItemUID == "btFinal")
            {
                int confirm = oApplication.MessageBox("Are you sure you want to post stock?", 2, "Yes", "No");
                if (confirm == 1)
                {
                    int postingStatus  = -1;
                    int trsnsferResult = -1;
                    int selRow         = mtSelRow(mtDocs);
                    if (selRow > 0)
                    {
                        string strCode = Convert.ToString(dtDoc.GetValue("OT", selRow - 1));
                        string dn      = Convert.ToString(dtDoc.GetValue("DE", selRow - 1));
                        string docType = Convert.ToString(dtDoc.GetValue("DT", selRow - 1));
                        if (docType == "Offer for Inspection")
                        {
                            string strProdNum = "SELECT \"U_B1_QA_INSP_PN\" FROM \"OIGN\" WHERE \"DocEntry\" ='" + dn + "'";
                            System.Data.DataTable dtProdNum = Program.objHrmsUI.getDataTable(strProdNum, "ProdNum");
                            if (dtProdNum != null && dtProdNum.Rows.Count > 0)
                            {
                                if (dtProdNum.Rows[0]["U_B1_QA_INSP_PN"] != DBNull.Value && Convert.ToInt32(dtProdNum.Rows[0]["U_B1_QA_INSP_PN"]) > 0)
                                {
                                    postingStatus = ReleaseInspaction(dn);
                                }
                            }
                        }
                        else
                        {
                            postingStatus = PostTransfer(strCode, dn);
                        }
                        string strDocCode = strCode + "-" + dn;
                        if (strCode.Trim() != "" && postingStatus != -1)
                        {
                            string strInsert = "UPDATE   \"@B1_QA_DOC\"  SET \"U_Date\" = '" + DateTime.Now.ToString("yyyyMMdd") + "' ,  \"U_Final\"='Y' ,  \"U_WTRentry\" = '" + postingStatus + "'   WHERE \"Code\" = '" + strDocCode + "'";
                            Program.objHrmsUI.ExecQuery(strInsert, "Finalllizing Inspaction");
                        }
                    }


                    //
                    _iniForm();

                    getDocs();
                }
            }
            if (pVal.ItemUID == "btPrint")
            {
                SAPbouiCOM.Menus mnus = oApplication.Menus;

                if (mnus.Exists(printMenuId) && printMenuId != "")
                {
                    int selRow = mtSelRow(mtDocs);

                    string strCode = Convert.ToString(dtDoc.GetValue("OT", selRow - 1));
                    string dn      = Convert.ToString(dtDoc.GetValue("DE", selRow - 1));


                    mnus.Item(printMenuId).Activate();

                    SAPbouiCOM.Form   prmForm = oApplication.Forms.ActiveForm;
                    EditText          objType = (SAPbouiCOM.EditText)prmForm.Items.Item("1000003").Specific;
                    EditText          DocKey  = (SAPbouiCOM.EditText)prmForm.Items.Item("1000009").Specific;
                    SAPbouiCOM.Button ok      = (SAPbouiCOM.Button)prmForm.Items.Item("1").Specific;
                    //   SAPbouiCOM.Button cancel = (SAPbouiCOM.Button)prmForm.Items.Item("2").Specific;

                    objType.Value      = strCode;
                    DocKey.Value       = dn;
                    prmForm.ActiveItem = ok.Item.UniqueID;

                    objType.Item.Enabled = false;
                    //  DocKey.Item.Enabled = false;

                    ok.Item.Click();
                    //  prmForm.Select();
                    //   cancel.Item.Click();
                }
                else
                {
                    oApplication.MessageBox("Please upload \"Inspection Report\" in production report menu");
                }
            }

            if (pVal.ItemUID == "txAtt")
            {
                try
                {
                    //  txAtt.ClickPicker();
                    System.Diagnostics.Process.Start(dtHead.GetValue("Att", 0).ToString());
                }
                catch (Exception ex)
                {
                    string errmsg = ex.Message;
                }
            }
            if (pVal.ItemUID == btAtt.Item.UniqueID)
            {
                string strFileName = Program.objHrmsUI.addAttacment("");
                if (strFileName != "")
                {
                    dtHead.SetValue("Att", 0, strFileName);

                    int    selRow     = mtSelRow(mtDocs);
                    string strCode    = Convert.ToString(dtDoc.GetValue("OT", selRow - 1));
                    string dn         = Convert.ToString(dtDoc.GetValue("DE", selRow - 1));
                    string strDocCode = strCode + "-" + dn;


                    string strInsert = "UPDATE   \"@B1_QA_DOC\"  SET \"U_Att\" = '" + strFileName + "' WHERE \"Code\" = '" + strDocCode + "'";
                    Program.objHrmsUI.ExecQuery(strInsert, "Finalllizing Inspaction");
                }
            }
            if (pVal.ItemUID == "1000001")
            {
                string RC  = Convert.ToString(dtHead.GetValue("RC", 0));
                string SBC = Convert.ToString(dtHead.GetValue("SBC", 0));

                string strCode = RC + "-" + SBC;

                saveReport(strCode);
            }
            if (pVal.ItemUID == mtDocs.Item.UniqueID && pVal.Row > 0 && pVal.Row <= mtDocs.RowCount)
            {
                mtDocs.SelectRow(pVal.Row, true, false);
                int selRow = pVal.Row;
                if (selRow > 0)
                {
                    string strCode = Convert.ToString(dtDoc.GetValue("OT", selRow - 1));
                    string dn      = Convert.ToString(dtDoc.GetValue("DE", selRow - 1));
                    string tbl     = Convert.ToString(dtDoc.GetValue("Tbl", selRow - 1));

                    if (strCode.Trim() != "")
                    {
                        string strDocCode = strCode + "-" + dn;

                        string strExist = "SELECT * from  \"@B1_QA_DOC\" where \"Code\" = '" + strDocCode + "'";
                        System.Data.DataTable dtExist = Program.objHrmsUI.getDataTable(strExist, "DocDetExist");
                        if (dtExist.Rows.Count == 0)
                        {
                            string strInsert = "INSERT INTO  \"@B1_QA_DOC\"  (\"Code\",\"Name\",\"U_ObjType\",\"U_DocEntry\",\"U_Date\")";
                            strInsert += " VALUES ('" + strDocCode + "','" + strDocCode + "','" + strCode + "','" + dn + "','" + DateTime.Now.ToString("yyyyMMdd") + "')";
                            Program.objHrmsUI.ExecQuery(strInsert, "Rpt Doc Entry into UDT");
                        }
                        else
                        {
                            dtHead.SetValue("Att", 0, dtExist.Rows[0]["U_Att"].ToString());
                        }
                        getRows(tbl, dn);
                    }
                }
                else
                {
                    oApplication.MessageBox("Please select a document before inspaction");
                }
            }

            if (pVal.ItemUID == mtDocRows.Item.UniqueID && pVal.Row > 0 && pVal.Row <= mtDocRows.RowCount)
            {
                mtDocRows.SelectRow(pVal.Row, true, false);
                int selRow = pVal.Row;// mtSelRow(mtDocRows);
                if (selRow > 0)
                {
                    string strCode   = Convert.ToString(dtRow.GetValue("ItemCode", selRow - 1));
                    string MM        = Convert.ToString(dtRow.GetValue("MM", selRow - 1));
                    string OBT       = Convert.ToString(dtRow.GetValue("OBT", selRow - 1));
                    string LN        = Convert.ToString(dtRow.GetValue("LN", selRow - 1));
                    string ItemCode  = Convert.ToString(dtRow.GetValue("ItemCode", selRow - 1));
                    string Qty       = Convert.ToString(dtRow.GetValue("Quantity", selRow - 1));
                    int    DocselRow = mtSelRow(mtDocs);



                    string DE = Convert.ToString(dtDoc.GetValue("DE", DocselRow - 1));
                    dtHead.SetValue("RC", 0, OBT + "-" + DE + "-" + LN);
                    dtHead.SetValue("MM", 0, MM);
                    dtHead.SetValue("OBT", 0, OBT);
                    dtHead.SetValue("LN", 0, LN);
                    dtHead.SetValue("DE", 0, DE);
                    dtHead.SetValue("Qty", 0, Qty);

                    dtHead.SetValue("ItemCode", 0, ItemCode);


                    if (strCode.Trim() != "")
                    {
                        getAttributes(strCode);
                        fillSerilaOrBatch(Qty, DE, LN, OBT, MM);
                    }
                }
                else
                {
                    oApplication.MessageBox("Please select an item before inspaction");
                }
            }

            if (pVal.ItemUID == mtSB.Item.UniqueID && pVal.Row > 0 && pVal.Row <= mtSB.RowCount)
            {
                mtSB.SelectRow(pVal.Row, true, false);
                int selRow = pVal.Row;// mtSelRow(mtSB);
                if (selRow > 0)
                {
                    string RC       = Convert.ToString(dtHead.GetValue("RC", 0));
                    string MM       = Convert.ToString(dtHead.GetValue("MM", 0));
                    string OBT      = Convert.ToString(dtHead.GetValue("OBT", 0));
                    string LN       = Convert.ToString(dtHead.GetValue("LN", 0));
                    string DE       = Convert.ToString(dtHead.GetValue("DE", 0));
                    string ItemCode = Convert.ToString(dtHead.GetValue("ItemCode", 0));
                    string Qty      = Convert.ToString(dtHead.GetValue("Qty", 0));



                    string strCode = Convert.ToString(dtSB.GetValue("Code", selRow - 1));
                    string strQty  = Convert.ToString(dtSB.GetValue("Qty", selRow - 1));

                    dtHead.SetValue("SBC", 0, strCode);
                    getReport(RC + "-" + strCode, OBT, DE, LN, MM, strQty, ItemCode, strCode);
                }
            }
        }
Esempio n. 29
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);
            }
        }
Esempio n. 30
0
        public virtual void ET_CallBack_AFClick(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("CallBack").Specific));

            // ADD YOUR ACTION CODE HERE ...
            string popupID = string.Empty;
            popupID = oButton.Caption.ToString();

            if (string.IsNullOrEmpty(popupID)) return;

            // 리턴 DataTable
            SAPbouiCOM.DataTable rDT = KIS_SO0000F_HRD.GetReturnDT(popupID, oForm.UniqueID);

            int rowIdx = KIS_SO0000F_HRD.GetSelectRowIdx(popupID, oForm.UniqueID);
            oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_DUMY").Specific;
            int idx = GetDataTableIndexByMatrix(oMatrix, rowIdx);

            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");

            switch (popupID)
            {
                case "DTL_지번주소":

                    oMatrix.SetCellWithoutValidation(rowIdx, "U_ADDR1", rDT.GetValue("RADDR_KOR", 0));
                    SetDeliveryDataApply(oForm, "U_ADDR1", rowIdx);
                    if (oForm.Mode == BoFormMode.fm_OK_MODE) oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                    break;

                case "DTL_거리주소":
                    oMatrix.SetCellWithoutValidation(rowIdx, "U_ADDR2", rDT.GetValue("RADDR_KOR", 0));
                    SetDeliveryDataApply(oForm, "U_ADDR2", rowIdx);
                    if (oForm.Mode == BoFormMode.fm_OK_MODE) oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                    break;

                case "MST_지번주소":

                    oDB_M.SetValue("U_ZIPCD1", 0, rDT.GetValue("ZIP_CD", 0));
                    oDB_M.SetValue("U_ADDR1", 0, rDT.GetValue("RADDR_KOR", 0));

                    if (oForm.Mode == BoFormMode.fm_OK_MODE) oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                    break;

                case "MST_거리주소":
                    oDB_M.SetValue("U_ZIPCD2", 0, rDT.GetValue("ZIP_CD", 0));
                    oDB_M.SetValue("U_ADDR2", 0, rDT.GetValue("RADDR_KOR", 0));

                    if (oForm.Mode == BoFormMode.fm_OK_MODE) oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                    break;

                case "접수내용":
                    rowIdx = int.Parse(oForm.DataSources.UserDataSources.Item("cRow").Value);

                    SetCallDataApply(oForm, "U_MEMO", rowIdx);
                    if (oForm.Mode == BoFormMode.fm_OK_MODE) oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                    break;

                case "선수금내역":
                    break;

                default:
                    break;
            }
        }
Esempio n. 31
0
        public virtual void ET_btnTARGET_AFItemPressed(ItemEvent pVal) {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnTARGET").Specific));
            // ADD YOUR ACTION CODE HERE ...
            oForm.Freeze(true);
            try
            {
                string DocEntry = FN.GetItemVal(ref oForm, "edtDOCNUM");


                using (KIS_SD0050A_HRD oKIS_SD0050A_HRD = new KIS_SD0050A_HRD())
                {
                    oKIS_SD0050A_HRD.SubFormCopy(oForm.UniqueID);
                   
                }



                //using (KIS_SD0041F_HRD oKIS_SD0041F = new KIS_SD0041F_HRD())
                //{
                //    oKIS_SD0041F.UDO_Add_Data_COPY_KIS_SD0050_HRD(DocEntry);
                //}

                //B1Connections.theAppl.StatusBar.SetText("작업이 완료되었습니다.", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success);

                //SetFormLoadFromDBDatasource(DocEntry);




            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oForm.Freeze(false);
            }
            
        }
Esempio n. 32
0
        public virtual void ET_btnEMAIL_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnEMAIL").Specific));

            // ADD YOUR ACTION CODE HERE ...
            //string U_CREDREQ = FN.GetItemValue(ref oForm, "cboCREDREQ");

            try
            {
                string U_READCD = FN.GetItemValue(ref oForm, "edtCode");
                string U_READNM = FN.GetItemValue(ref oForm, "edtREQNAME");

                string[] mailInfo = FN.GetRecordsetArrayValue("SELECT TOP(1) U_RMK1, U_RMK2, U_RMK3 FROM [@KIS_AD00201] WHERE Code = 'SO57' AND U_CD = '01'");
                string[] readInfo = FN.GetRecordsetArrayValue(string.Format("SELECT F.U_CREDREQ, F.U_EMAIL FROM [@KIS_SO0030M_HRD] F WHERE F.CODE = '{0}'", U_READCD));

                if (readInfo == null) return;

                string PROFILE = mailInfo[0];
                string URL = mailInfo[1];
                string SUBJECT = mailInfo[2];
                string U_CREDREQ = readInfo[0];
                string MAIL = readInfo[1];

                // S10:요청, S20:재발급, S30:완료
                if (U_CREDREQ == "S10" || U_CREDREQ == "S20")
                {
                    if (string.IsNullOrEmpty(MAIL))
                    {
                        FN.Trace("메일주소를 확인해 주세요!", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                        return;
                    }

                    StringBuilder sb = new System.Text.StringBuilder();
                    sb.AppendFormat("exec [KIS_SP_SO00302_HRD] @PROFILE = '{0}'", PROFILE);
                    sb.AppendFormat("                        , @URL = '{0}'", URL);
                    sb.AppendFormat("                        , @MAIL = '{0}'", MAIL);
                    sb.AppendFormat("                        , @SUBJECT = '{0}'", SUBJECT);
                    sb.AppendFormat("                        , @U_READCD = '{0}'", U_READCD);
                    sb.AppendFormat("                        , @U_READNM = '{0}'", U_READNM);

                    FN.GetRecordsetValue(sb.ToString());

                    CFL.COMMON_MESSAGE("!", "메일이 전송 되었습니다.");

                }
                else
                {
                    FN.Trace("인증키발급구분을 요청이나 재발급으로 변경후 저장해 주세요!", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                }
            }
            catch (Exception)
            {

                throw;
            }
        }
Esempio n. 33
0
        public virtual bool ET_btn1_BFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btn1").Specific));
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                
                return GetBefore_Save_Validation();

            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            return true;
        }
Esempio n. 34
0
        public virtual void ET_btnLIST_AFItemPressed(ItemEvent pVal) 
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnLIST").Specific));
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                string edtCode = oForm.Items.Item("edtCode").Specific.Value;

                if (String.IsNullOrEmpty(edtCode))
                {
                    B1Connections.theAppl.StatusBar.SetText("독자를 선택해주세요.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    return;
                }

                FindData_List(oForm, edtCode);
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
Esempio n. 35
0
        public virtual void ET_1_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("1").Specific));
            // ADD YOUR ACTION CODE HERE ...

            try
            {
                string pformuid = oForm.DataSources.UserDataSources.Item("pformuid").ValueEx;

                switch (oForm.Mode)
                {
                    case BoFormMode.fm_ADD_MODE:
                        break;
                    case BoFormMode.fm_EDIT_MODE:
                        break;
                    case BoFormMode.fm_FIND_MODE:
                        break;
                    case BoFormMode.fm_OK_MODE:
                        break;
                    case BoFormMode.fm_PRINT_MODE:
                        break;
                    case BoFormMode.fm_UPDATE_MODE:
                        break;
                    case BoFormMode.fm_VIEW_MODE:
                        break;
                    default:
                        break;
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            finally
            {

            }

        }
Esempio n. 36
0
        protected virtual void e_FormLoad(ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent)
        {
            try
            {
                if (pVal.BeforeAction == false && bLoadInputEvents)
                {
                    oform              = oApplication.Forms.Item(pVal.FormUID);
                    oform.ClientWidth  = 450;
                    oform.ClientHeight = 400;
                    dtSearch           = oform.DataSources.DataTables.Add("dtSearch");
                    // oform.Width = 600;
                    oform.Title = sTitle;


                    oform.State = BoFormStateEnum.fs_Maximized;
                    SAPbouiCOM.Item oItem;
                    IbtChoos     = oform.Items.Item("1");
                    IbtChoos.Top = 350;

                    btChoos          = (SAPbouiCOM.Button)IbtChoos.Specific;
                    btChoos.Caption  = "Choose";
                    ISearchField     = oform.Items.Item("2");
                    ISearchField.Top = 350;

                    SAPbouiCOM.Columns     oColumns;
                    SAPbouiCOM.DataColumns dtCols;
                    dtCols = dtSearch.Columns;
                    SAPbouiCOM.Column     oColumn;
                    SAPbouiCOM.DataColumn dtCol;
                    oItem         = oform.Items.Add("mtSearch", BoFormItemTypes.it_MATRIX);
                    oItem.Width   = 440;
                    oItem.Height  = 290;
                    oItem.Top     = 60;
                    oItem.Enabled = true;


                    mtSearch = (SAPbouiCOM.Matrix)oItem.Specific;

                    // mtSearch.
                    oItem      = oform.Items.Add("lbCritaria", BoFormItemTypes.it_STATIC);
                    oItem.Top  = 40;
                    oItem.Left = 10;

                    SAPbouiCOM.StaticText lblCri = (SAPbouiCOM.StaticText)oItem.Specific;

                    lblCri.Caption = "Find";

                    oItem       = oform.Items.Add("txCritaria", BoFormItemTypes.it_EDIT);
                    oItem.Top   = 40;
                    oItem.Width = 300;
                    oItem.Left  = 130;

                    //SAPbouiCOM.StaticText lblCri = oItem.Specific;



                    if (flgMultiple)
                    {
                    }
                    else
                    {
                        mtSearch.SelectionMode = BoMatrixSelect.ms_Single;
                    }
                    // mtSearch

                    oColumns = mtSearch.Columns;
                    //mtSearch.Layout = BoMatrixLayoutType.mlt_Vertical;
                    oColumn = oColumns.Add("vFix", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                    // oColumn.Editable = false;
                    oColumn.Width = 40;
                    //oColumn.Visible = false;
                    int i = 0;
                    int j = 0;
                    foreach (System.Data.DataColumn cl in dtTable.Columns)
                    {
                        dtOut.Columns.Add(cl.ColumnName);
                        oColumn = oColumns.Add("v_" + i.ToString(), SAPbouiCOM.BoFormItemTypes.it_EDIT);
                        oColumn.TitleObject.Caption = cl.Caption;
                        oColumn.Width = 100;

                        oColumn.Editable = false;
                        dtCol            = dtCols.Add("cd" + i.ToString(), BoFieldsType.ft_AlphaNumeric);
                        oColumn.DataBind.Bind("dtSearch", "cd" + i.ToString());
                        // oColumn.
                        i++;
                        // col.DataBind.TableName = "dtSearch";
                        //col.DataBind
                    }
                    dtSearch.Rows.Clear();
                    i = 0;
                    j = 0;
                    foreach (DataRow dr in dtTable.Rows)
                    {
                        dtSearch.Rows.Add(1);
                        j = 0;
                        foreach (System.Data.DataColumn col in dtTable.Columns)
                        {
                            dtSearch.SetValue("cd" + j.ToString(), i, dr[j].ToString());
                            j++;
                        }
                        i++;
                    }
                    mtSearch.LoadFromDataSource();

                    oform = null;
                }
            }
            catch (Exception ex)
            {
                bLoadInputEvents = false;
            }
        }
Esempio n. 37
0
        private void ClearUnManagedObject() 
        {
            if (oUDS != null) { Marshal.ReleaseComObject(oUDS); } oUDS = null;
            if (oComboBox != null) { Marshal.ReleaseComObject(oComboBox); } oComboBox = null;
            if (oEditText != null) { Marshal.ReleaseComObject(oEditText); } oEditText = null;
            if (oGrid != null) { Marshal.ReleaseComObject(oGrid); } oGrid = null;
            if (oButton != null) { Marshal.ReleaseComObject(oButton); } oButton = null;
            if ((oForm != null)) { Marshal.ReleaseComObject(oForm); } oForm = null;

            // ADD YOUR ACTION CODE HERE ...
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
        }
        private void CriarFormulario()
        {
            SAPbouiCOM.Item oItem = null;
            //SAPbouiCOM.Button oButton = null;
            SAPbouiCOM.StaticText oStaticText = null;
            SAPbouiCOM.ComboBox   oComboBox   = null;
            SAPbouiCOM.EditText   oEditText   = null;

            try
            {
                this.oForm = this.oApplication.Forms.Add("frmStatusBar", BoFormTypes.ft_Fixed, -1);
            }
            catch (COMException ex)
            {
                //if (ex.ErrorCode == -7010)
                //{
                //    this.oForm = this.oApplication.Forms.Add("frmStatusBar");


                //}
                //else
                //{
                System.Windows.Forms.MessageBox.Show(
                    ex.Message
                    , "Erro"
                    , System.Windows.Forms.MessageBoxButtons.OK
                    , System.Windows.Forms.MessageBoxIcon.Error
                    );
                System.Environment.Exit(0);

                //}
            }

            ConfiguraForm(
                "Exemplo Status Bar"
                , 400
                , 350
                , 100
                , 80
                );
            //add botao ok
            this.oButtonOK            = UIHelper.AddBotaoAoFormulario(this.oForm, "1", 6, 65, 53, 19, "OK");
            this.oButtonMenssagem     = UIHelper.AddBotaoAoFormulario(this.oForm, "BTN_STATUS", 90, 150, 53, 19, "Mostrar Mensagem");
            this.oItemRect            = UIHelper.AddRectAoFormulario(this.oForm, "Rect1", 0, 344, 1, 45);
            this.oComboBoxTypeMessage = UIHelper.AddComboBoxAoFormulario(this.oForm, "ComboBox1", 157, 163, 24, 14);
            this.oEditTextMessage     = UIHelper.AddEditTextAoFormulario(this.oForm, "edtMessage", 157, 163, 8, 14);



            this.oStaticTextMensagem     = UIHelper.AddStaticTextAoFormulario(this.oForm, "st01", 7, 148, 8, 14, "Mensagem de texto:", "edtMessage");
            this.oStaticTextTipoMensagem = UIHelper.AddStaticTextAoFormulario(this.oForm, "st02", 7, 148, 8, 14, "Mensagem de texto:", "ComboBox1");

            this.AddDataSources();


            this.oComboBoxTypeMessage.ValidValues.Add(Convert.ToString(BoStatusBarMessageType.smt_Warning), "Warning");
            this.oComboBoxTypeMessage.ValidValues.Add(Convert.ToString(BoStatusBarMessageType.smt_Error), "Error");
            this.oComboBoxTypeMessage.ValidValues.Add(Convert.ToString(BoStatusBarMessageType.smt_None), "None");
            this.oComboBoxTypeMessage.ValidValues.Add(Convert.ToString(BoStatusBarMessageType.smt_Success), "Sucess");

            this.oComboBoxTypeMessage.Select(0, BoSearchKey.psk_Index);
        }
Esempio n. 39
0
 public virtual bool ET_btnCANCEL_BFClick(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnCANCEL").Specific));
     
     // ADD YOUR ACTION CODE HERE ...
     return BeforeCancel_ValidationCheck(oForm);
 }
Esempio n. 40
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;
        }
Esempio n. 41
0
        public virtual void ET_1_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("1").Specific));
            // ADD YOUR ACTION CODE HERE ...

            if (oForm.Mode == BoFormMode.fm_ADD_MODE)
            {
                SetDefultMasterData(oForm);
            }
            else if (oForm.Mode == BoFormMode.fm_OK_MODE)
            {
                oForm.Freeze(true);

                // 1. 저장후 선택된 행 초기화 되기때문에 다시 선택
                LastSelectedMatrixRow_Select(oForm);

                // 2. 배송리스트 선택하고 상담이력 다시 조회              
                //FindSubData(oForm, gDeliverySelect);(데이터 로드에서 처리)  

                oForm.Freeze(false);
            }
        }
Esempio n. 42
0
        private void InitiallizeForm()
        {
            //  dtHead = oForm.DataSources.DataTables.Item("dtHead");
            // dtHead.Rows.Add(1);

            dtPendingJEs.Columns.Add("V#");
            dtPendingJEs.Columns.Add("Date");
            dtPendingJEs.Columns.Add("Remarks");
            dtPendingJEs.Columns.Add("Month");
            dtPendingJEs.Columns.Add("Year");
            dtPendingJEs.Columns.Add("Posted");
            dtPendingJEs.Columns.Add("PostedJE");
            dtPendingJEs.Columns.Add("Canceled");
            dtPendingJEs.Columns.Add("CanceledJE");

            oForm.Freeze(true);
            mtJE   = oForm.Items.Item("mtJE").Specific;
            mtDet  = oForm.Items.Item("mtDet").Specific;
            dtDet  = oForm.DataSources.DataTables.Item("dtDet");
            dtHead = oForm.DataSources.DataTables.Item("dtHead");
            cbOr   = oForm.Items.Item("cbOr").Specific;
            IcbOr  = oForm.Items.Item("cbOr");
            cbOr.ValidValues.Add("All", "All");
            fillUserCb();

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


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


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



            oForm.DataSources.UserDataSources.Add("txDD", SAPbouiCOM.BoDataType.dt_DATE); // Days of Month
            txDD  = oForm.Items.Item("txDD").Specific;
            ItxDD = oForm.Items.Item("txDD");
            txDD.DataBind.SetBound(true, "", "txDD");

            oForm.DataSources.UserDataSources.Add("txRem", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 50); // Days of Month
            txRem  = oForm.Items.Item("txRem").Specific;
            ItxRem = oForm.Items.Item("txRem");
            txRem.DataBind.SetBound(true, "", "txRem");

            oForm.DataSources.UserDataSources.Add("txRef1", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 30); // Days of Month
            txRef1  = oForm.Items.Item("txRef1").Specific;
            ItxRef1 = oForm.Items.Item("txRef1");
            txRef1.DataBind.SetBound(true, "", "txRef1");

            oForm.DataSources.UserDataSources.Add("txRef2", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 30);    // Days of Month
            txRef2  = oForm.Items.Item("txRef2").Specific;
            ItxRef2 = oForm.Items.Item("txRef2");
            txRef2.DataBind.SetBound(true, "", "txRef2");

            oForm.DataSources.UserDataSources.Add("txDS", SAPbouiCOM.BoDataType.dt_SUM);      // Days of Month
            txDS  = oForm.Items.Item("txDS").Specific;
            ItxDS = oForm.Items.Item("txDS");
            txDS.DataBind.SetBound(true, "", "txDS");


            oForm.DataSources.UserDataSources.Add("txCS", SAPbouiCOM.BoDataType.dt_SUM);      // Days of Month
            txCS  = oForm.Items.Item("txCS").Specific;
            ItxCS = oForm.Items.Item("txCS");
            txCS.DataBind.SetBound(true, "", "txCS");


            oForm.DataSources.UserDataSources.Add("chkPost", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); // Days of Month
            chkPost  = oForm.Items.Item("chkPost").Specific;
            IchkPost = oForm.Items.Item("chkPost");
            chkPost.DataBind.SetBound(true, "", "chkPost");

            oForm.DataSources.UserDataSources.Add("optPP", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); // Days of Month
            optPP  = oForm.Items.Item("optPP").Specific;
            ioptPP = oForm.Items.Item("optPP");
            optPP.DataBind.SetBound(true, "", "optPP");

            oForm.DataSources.UserDataSources.Add("optC", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); // Days of Month
            optC  = oForm.Items.Item("optC").Specific;
            ioptC = oForm.Items.Item("optC");
            optC.DataBind.SetBound(true, "", "optC");

            oForm.DataSources.UserDataSources.Add("optPC", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); // Days of Month
            optPC  = oForm.Items.Item("optPC").Specific;
            ioptPC = oForm.Items.Item("optPC");
            optPC.DataBind.SetBound(true, "", "optPC");

            optC.GroupWith("optPP");
            optPC.GroupWith("optPP");
            optPP.Selected = true;

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

            lnkBG    = oForm.Items.Item("lnkBG").Specific;
            IchkPost = oForm.Items.Item("lnkBG");
        }
Esempio n. 43
0
        public virtual void ET_btnCREATE_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnCREATE").Specific));
            // ADD YOUR ACTION CODE HERE ...


            try
            {
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");

                string strChildFormID = oForm.DataSources.UserDataSources.Item("cFORMUID").Value;
                if (!FN.GetFormExistsChk(strChildFormID))
                {
                    KIS_SO0032F_HRD SO0032F_HRD = new KIS_SO0032F_HRD();
                    SO0032F_HRD.A00_SubFormInit(oForm.UniqueID);
                    SO0032F_HRD = null;
                }

            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 44
0
 public virtual void ET_btnSAVE_AFItemPressed(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnSAVE").Specific));
     // ADD YOUR ACTION CODE HERE ...
     UDO_Add_Data();
 }
Esempio n. 45
0
        public virtual bool ET_1_BFClick(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("1").Specific));
            // ADD YOUR ACTION CODE HERE ...

            if (oForm.Mode == BoFormMode.fm_ADD_MODE || oForm.Mode == BoFormMode.fm_UPDATE_MODE)
            {
                if (!BeforSaveData_MasterValidation(oForm))
                    return false;
                if (!BeforSaveData_LineValidation(oForm))
                    return false;

                if (oForm.Mode == BoFormMode.fm_ADD_MODE)
                {
                    // 저장전 독자코드가 존재하면 새로운 독자코드를 채번하고 라인데이터에 배송코드에도 적용하도록 한다.
                    if (GetCodeExists(oForm))
                        SeNewCodeApply(oForm);
                }
            }
            return true;
        }
Esempio n. 46
0
        private void ClearUnManagedObject() 
        {
            if (oMatrix != null) { Marshal.ReleaseComObject(oMatrix); } oMatrix = null;
            if (oButton != null) { Marshal.ReleaseComObject(oButton); } oButton = null;
            if (oDB_M != null) { Marshal.ReleaseComObject(oDB_M); } oDB_M = null;
            if (oDB_1 != null) { Marshal.ReleaseComObject(oDB_1); } oDB_1 = null;
            //if (uploadDataTable != null) { Marshal.ReleaseComObject(uploadDataTable); } uploadDataTable = null;

            if ((oForm != null)) { Marshal.ReleaseComObject(oForm); } oForm = null;

            // ADD YOUR ACTION CODE HERE ...
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
        }
Esempio n. 47
0
        public virtual void ET_btnADDR2_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnADDR2").Specific));
            // ADD YOUR ACTION CODE HERE ...

            OpenPopup_Address(oForm, "MST_거리주소", SO.SO_COMMON_HRD.ZipCodeTypes.Road);
        }
Esempio n. 48
0
        public virtual void ET_btnDOWN_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnDOWN").Specific));
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                //string strFileName = CFL.FolderDialog();
                //ExcelSave(strFileName);
                //템플릿 폴더열기
                string strAppPath = System.IO.Directory.GetCurrentDirectory();
                strAppPath = strAppPath + @"\Templates\KIS_SO0060A_HRD";
                FN.FolrderOpen(strAppPath);
            }
            catch (Exception ex)
            {

                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
Esempio n. 49
0
        public virtual bool ET_btnSTOP_BFClick(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnSTOP").Specific));
            // ADD YOUR ACTION CODE HERE ...
            string strNowDate = oForm.Items.Item("edtSTOPDT").Specific.Value; //oForm.DataSources.UserDataSources.Item("edtSTOPDT").ValueEx;

            if (String.IsNullOrEmpty(strNowDate))
            {
                B1Connections.theAppl.StatusBar.SetText("중지 일자가 입력되지 않았습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                //oForm.Items.Item("btnSTOP").Click(0);
                return false;
            }
            return true;
        }
Esempio n. 50
0
        public virtual void ET_btnPATH_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnPATH").Specific));
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                string strFileName = CFL.FileDialog(AddOnBase.eFileDialog.en_OpenFile, "Excel 97 - 2003 통합 문서 (*.xls)|*.xls|Excel 통합 문서 (*.xlsx)|*.xlsx|텍스트 파일 (*.csv)|*.csv", true);

                if (strFileName != "")
                {
                    oForm.DataSources.UserDataSources.Item("edtPATH").ValueEx = strFileName;
                    this.ImportData(oForm);

                    // U_STATUS
                    //FN.SetDataSourceValue(oForm, "@KIS_SO0060T_HRD.U_STATUS", "F");
                }

            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
Esempio n. 51
0
        public virtual void ET_btnFIND_AFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnFIND").Specific));
            // ADD YOUR ACTION CODE HERE ...

            // 추가중인 행 삭제
            DataTableDeleteRows("I");

            // 조회
            FindData(oForm);

            // 상담이력 조회
            FindSubData(oForm, 0);
        }
Esempio n. 52
0
        public virtual bool ET_btnUPDATE_BFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("btnUPDATE").Specific));
            
            // ADD YOUR ACTION CODE HERE ...
            string cboSTATUS = FN.GetItemValue(ref oForm, "cboSTATUS");
            string edtDOCNO = FN.GetItemValue(ref oForm, "edtDOCNO");

            if (oForm.Mode == BoFormMode.fm_ADD_MODE)
            {
                return false;
            }

            if (edtDOCNO == "")
            {
                FN.Trace("문서번호를 먼저 생성해 주세요!..", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                return false;
            }

            if (cboSTATUS == "S")
            {
                FN.Trace("이미 처리된 자료입니다.", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                return false;
            }

            oMatrix = oForm.Items.Item("mtx").Specific;
            if (oMatrix.RowCount == 0)
            {
                FN.Trace("자료가 존재하지 않습니다.", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                return false;
            }


            return true;
        }
Esempio n. 53
0
        private void CreateForm()
        {
            SAPbouiCOM.FormCreationParams oCP = null;
            SAPbouiCOM.Item       oItem       = null;
            SAPbouiCOM.StaticText oStatic     = null;
            SAPbouiCOM.Button     oButton     = null;
            SAPbouiCOM.EditText   oEdit       = null;

            //  Setting the form creation params
            oCP             = ((SAPbouiCOM.FormCreationParams)(SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)));
            oCP.UniqueID    = "CFL3";
            oCP.FormType    = "CFL3";
            oCP.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Sizable;


            //  Adding the form
            oForm       = SBO_Application.Forms.AddEx(oCP);
            oForm.Title = "Configuración";

            oItem           = oForm.Items.Add("StaticTxt", SAPbouiCOM.BoFormItemTypes.it_STATIC);
            oItem.Left      = 10;
            oItem.Top       = 20;
            oItem.LinkTo    = "EditTxt";
            oItem.Width     = 200;
            oStatic         = ((SAPbouiCOM.StaticText)(oItem.Specific));
            oStatic.Caption = "Carpeta de archivos";


            oItem           = oForm.Items.Add("StaticTxt2", SAPbouiCOM.BoFormItemTypes.it_STATIC);
            oItem.Left      = 10;
            oItem.Top       = 50;
            oItem.LinkTo    = "EditTxt";
            oItem.Width     = 200;
            oStatic         = ((SAPbouiCOM.StaticText)(oItem.Specific));
            oStatic.Caption = "Kilometros recorridos";

            oItem        = oForm.Items.Add("txtKM", SAPbouiCOM.BoFormItemTypes.it_EDIT);
            oItem.Left   = 120;
            oItem.Top    = 50;
            oItem.LinkTo = "StaticTxt2";
            oEdit        = ((SAPbouiCOM.EditText)(oItem.Specific));


            oItem           = oForm.Items.Add("StaticTxt3", SAPbouiCOM.BoFormItemTypes.it_STATIC);
            oItem.Left      = 10;
            oItem.Top       = 80;
            oItem.LinkTo    = "EditTxt";
            oStatic         = ((SAPbouiCOM.StaticText)(oItem.Specific));
            oStatic.Caption = "Horas de motor";

            oItem        = oForm.Items.Add("txtHoras", SAPbouiCOM.BoFormItemTypes.it_EDIT);
            oItem.Left   = 120;
            oItem.Top    = 80;
            oItem.LinkTo = "StaticTxt3";
            oEdit        = ((SAPbouiCOM.EditText)(oItem.Specific));

            //  Adding a CFL button
            oItem           = oForm.Items.Add("btnGuardar", SAPbouiCOM.BoFormItemTypes.it_BUTTON);
            oItem.Left      = 120;
            oItem.Top       = 110;
            oButton         = ((SAPbouiCOM.Button)(oItem.Specific));
            oButton.Type    = SAPbouiCOM.BoButtonTypes.bt_Caption;
            oButton.Caption = "Guardar";
            oItem.Width     = 100;
            oItem.Height    = 20;


            oForm.Width  = 300;
            oForm.Height = 300;

            oForm.Visible = true;
        }
Esempio n. 54
0
        private void createUI()
        {
            int oldpanLevel = oForm.PaneLevel;

            if (oldpanLevel == 2)
            {
                oForm.PaneLevel = 1;
            }
            oForm.Freeze(true);



            SAPbouiCOM.Item   oItem;
            SAPbouiCOM.Item   oItem1;
            SAPbouiCOM.Folder oFolder;
            SAPbouiCOM.Item   oItemRef = oForm.Items.Item("126");


            try
            {
                cflcardcode(ocflCard, "ocflCard");


                // add Routing Matrix

                oItem           = oForm.Items.Add("lblCost", SAPbouiCOM.BoFormItemTypes.it_STATIC);
                oItem.Top       = oItemRef.Top + 30;
                oItem.Height    = oItemRef.Height;
                oItem.Left      = oItemRef.Left;
                oItem.Width     = oItemRef.Width;
                oItem.FromPane  = 2;
                oItem.ToPane    = 2;
                oItem.TextStyle = 4;

                Program.objHrmsUI.loadSettings();
                oItem.LinkTo    = oItemRef.UniqueID;
                lblCost         = (SAPbouiCOM.StaticText)oItem.Specific;
                lblCost.Caption = "Cost Posting";


                oItem           = oForm.Items.Add("lblCard", SAPbouiCOM.BoFormItemTypes.it_STATIC);
                oItem.Top       = oItemRef.Top + 50;
                oItem.Height    = oItemRef.Height;
                oItem.Left      = oItemRef.Left;
                oItem.Width     = oItemRef.Width;
                oItem.FromPane  = 2;
                oItem.ToPane    = 2;
                oItem.Visible   = false;
                oItem.LinkTo    = oItemRef.UniqueID;
                lblCard         = (SAPbouiCOM.StaticText)oItem.Specific;
                lblCard.Caption = "Supplier";


                oItem          = oForm.Items.Add("txSupplier", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                oItem.Top      = oItemRef.Top + 50;
                oItem.Height   = oItemRef.Height;
                oItem.Left     = oItemRef.Left + oItemRef.Width;
                oItem.Width    = 150;
                oItem.FromPane = 2;
                oItem.ToPane   = 2;
                oItem.LinkTo   = "lblCard";
                txSupplier     = (SAPbouiCOM.EditText)oItem.Specific;

                oForm.DataSources.UserDataSources.Add("txSupplier", SAPbouiCOM.BoDataType.dt_SHORT_TEXT);
                txSupplier.DataBind.SetBound(true, "", "txSupplier");


                txSupplier.ChooseFromListUID   = ocflCard.UniqueID;
                txSupplier.ChooseFromListAlias = "CardCode";
                oItem.Visible = false;

                txSupplier.ChooseFromListUID   = ocflCard.UniqueID;
                txSupplier.ChooseFromListAlias = "CardCode";



                oItem          = oForm.Items.Add("lnkCard", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON);
                oItem.Top      = oItemRef.Top + 50;
                oItem.Height   = oItemRef.Height;
                oItem.Left     = oItemRef.Left + oItemRef.Width - 20;
                oItem.FromPane = 2;
                oItem.ToPane   = 2;
                oItem.LinkTo   = "txSupplier";
                SAPbouiCOM.LinkedButton lnkCard = (SAPbouiCOM.LinkedButton)oItem.Specific;
                lnkCard.LinkedObject     = BoLinkedObject.lf_BusinessPartner;
                lnkCard.LinkedObjectType = "2";



                oItemRef = lblCard.Item;

                oItem          = oForm.Items.Add("lblRef", SAPbouiCOM.BoFormItemTypes.it_STATIC);
                oItem.Top      = oItemRef.Top + 18;
                oItem.Height   = oItemRef.Height;
                oItem.Left     = oItemRef.Left;
                oItem.Width    = oItemRef.Width;
                oItem.FromPane = 2;
                oItem.ToPane   = 2;
                oItem.Visible  = false;
                oItem.LinkTo   = oItemRef.UniqueID;
                lblRef         = (SAPbouiCOM.StaticText)oItem.Specific;
                lblRef.Caption = "Ref #";


                oItem          = oForm.Items.Add("txRef", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                oItem.Top      = oItemRef.Top + 18;
                oItem.Height   = oItemRef.Height;
                oItem.Left     = oItemRef.Left + oItemRef.Width;
                oItem.Width    = 150;
                oItem.FromPane = 2;
                oItem.ToPane   = 2;
                oItem.Visible  = false;
                oItem.LinkTo   = oItemRef.UniqueID;
                txRef          = (SAPbouiCOM.EditText)oItem.Specific;
                oForm.DataSources.UserDataSources.Add("txRef", SAPbouiCOM.BoDataType.dt_SHORT_TEXT);
                txRef.DataBind.SetBound(true, "", "txRef");


                oItemRef = lblRef.Item;

                oItem          = oForm.Items.Add("lblPD", SAPbouiCOM.BoFormItemTypes.it_STATIC);
                oItem.Top      = oItemRef.Top + 18;
                oItem.Height   = oItemRef.Height;
                oItem.Left     = oItemRef.Left;
                oItem.Width    = oItemRef.Width;
                oItem.FromPane = 2;
                oItem.ToPane   = 2;
                oItem.Visible  = false;
                oItem.LinkTo   = oItemRef.UniqueID;
                lblPD          = (SAPbouiCOM.StaticText)oItem.Specific;
                lblPD.Caption  = "Posting Date";


                oItem          = oForm.Items.Add("txPD", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                oItem.Top      = oItemRef.Top + 18;
                oItem.Height   = oItemRef.Height;
                oItem.Left     = oItemRef.Left + oItemRef.Width;
                oItem.Width    = 150;
                oItem.FromPane = 2;
                oItem.ToPane   = 2;
                oItem.Visible  = false;
                oItem.LinkTo   = oItemRef.UniqueID;
                txPostingDate  = (SAPbouiCOM.EditText)oItem.Specific;

                oForm.DataSources.UserDataSources.Add("txPD", SAPbouiCOM.BoDataType.dt_DATE);
                txPostingDate.DataBind.SetBound(true, "", "txPD");

                oItemRef = lblPD.Item;

                oItem          = oForm.Items.Add("lblEA", SAPbouiCOM.BoFormItemTypes.it_STATIC);
                oItem.Top      = oItemRef.Top + 18;
                oItem.Height   = oItemRef.Height;
                oItem.Left     = oItemRef.Left;
                oItem.Width    = oItemRef.Width;
                oItem.FromPane = 2;
                oItem.ToPane   = 2;
                oItem.Visible  = false;
                oItem.LinkTo   = oItemRef.UniqueID;
                lblEA          = (SAPbouiCOM.StaticText)oItem.Specific;
                lblEA.Caption  = "Expense Account";


                oItem          = oForm.Items.Add("txEA", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                oItem.Top      = oItemRef.Top + 18;
                oItem.Height   = oItemRef.Height;
                oItem.Left     = oItemRef.Left + oItemRef.Width;
                oItem.Width    = 150;
                oItem.FromPane = 2;
                oItem.ToPane   = 2;
                oItem.Visible  = false;
                oItem.LinkTo   = oItemRef.UniqueID;
                txEA           = (SAPbouiCOM.EditText)oItem.Specific;

                oForm.DataSources.UserDataSources.Add("txEA", SAPbouiCOM.BoDataType.dt_SHORT_TEXT);
                txEA.DataBind.SetBound(true, "", "txEA");
                txEA.Value = Program.objHrmsUI.getSetting("DfltExp");


                oItemRef = lblEA.Item;

                oItem              = oForm.Items.Add("lblPE", SAPbouiCOM.BoFormItemTypes.it_STATIC);
                oItem.Top          = oItemRef.Top + 18;
                oItem.Height       = oItemRef.Height;
                oItem.Left         = oItemRef.Left;
                oItem.Width        = oItemRef.Width;
                oItem.FromPane     = 2;
                oItem.ToPane       = 2;
                oItem.Visible      = false;
                oItem.LinkTo       = oItemRef.UniqueID;
                lblPE              = (SAPbouiCOM.StaticText)oItem.Specific;
                lblPE.Caption      = "Posted AP";
                lblPE.Item.Visible = false;

                oItem          = oForm.Items.Add("txPE", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                oItem.Top      = oItemRef.Top + 18;
                oItem.Height   = oItemRef.Height;
                oItem.Left     = oItemRef.Left + oItemRef.Width;
                oItem.Enabled  = false;
                oItem.Width    = 150;
                oItem.FromPane = 2;
                oItem.ToPane   = 2;
                oItem.Visible  = false;
                oItem.LinkTo   = oItemRef.UniqueID;
                txPE           = (SAPbouiCOM.EditText)oItem.Specific;
                oForm.DataSources.UserDataSources.Add("txPE", SAPbouiCOM.BoDataType.dt_SHORT_TEXT);
                txPE.DataBind.SetBound(true, "", "txPE");



                oItem          = oForm.Items.Add("lnkPE", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON);
                oItem.Top      = oItemRef.Top + 18;
                oItem.Height   = oItemRef.Height;
                oItem.Left     = oItemRef.Left + oItemRef.Width - 20;
                oItem.FromPane = 2;
                oItem.ToPane   = 2;
                oItem.LinkTo   = "txPE";
                SAPbouiCOM.LinkedButton lnkPE = (SAPbouiCOM.LinkedButton)oItem.Specific;
                lnkPE.LinkedObject     = BoLinkedObject.lf_PurchaseInvoice;
                lnkPE.LinkedObjectType = "18";



                oItemRef = txPE.Item;


                oItem               = oForm.Items.Add("btPost", SAPbouiCOM.BoFormItemTypes.it_BUTTON);
                oItem.Top           = oItemRef.Top + 18;
                oItem.Height        = oItemRef.Height + 5;
                oItem.Left          = oItemRef.Left;
                oItem.Enabled       = true;
                oItem.Width         = 150;
                oItem.FromPane      = 2;
                oItem.ToPane        = 2;
                oItem.LinkTo        = oItemRef.UniqueID;
                btPost              = (SAPbouiCOM.Button)oItem.Specific;
                btPost.Caption      = "Post AP";
                btPost.Item.Visible = false;

                txPE.Item.Enabled = false;
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }

            oForm.Freeze(false);
            txPE.Item.Enabled = false;
            oForm.PaneLevel   = oldpanLevel;
        }