示例#1
0
        /// <summary>
        /// Agrega un item de venta de pesaje a la matriz
        /// </summary>
        public SAPbouiCOM.DBDataSource AddItemService(SAPbouiCOM.DBDataSource mDBDataSourceD)
        {
            mDBDataSourceD.Clear();
            mDBDataSourceD.InsertRecord(0);
            QueryManager lObjQueryManager = new QueryManager();
            string       lSTrItemCode     = lObjQueryManager.GetValue("U_Value", "Name", "PL_WEIGHING_SALE", "[@UG_CONFIG]");

            mDBDataSourceD.SetValue("ItemCode", 0, lSTrItemCode);  //Ponerlo en configuracion

            TicketDAO lObjTicketDAO = new TicketDAO();
            string    lStrPrice     = lObjTicketDAO.GetPrice(lSTrItemCode);

            mDBDataSourceD.SetValue("Dscription", 0, "SERVICIO DE BASCULA");
            mDBDataSourceD.SetValue("Price", 0, lStrPrice);

            if (lStrPrice == "0")
            {
                mDBDataSourceD.SetValue("Price", 0, "1");
            }
            mDBDataSourceD.SetValue("Quantity", 0, "1");
            mDBDataSourceD.SetValue("LineTotal", 0, "0");


            return(mDBDataSourceD);
        }
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            //SAPbouiCOM.ComboBox oCombo;
            SAPbouiCOM.Column oColumn;
            bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

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

                //Lista    := New list<string>;

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

                VID_DelRow   = true;
                VID_DelRowOK = true;

                oForm.DataBrowser.BrowseBy = "Code";
                oDBDSH = oForm.DataSources.DBDataSources.Item("@VID_FEDOCE");
                oDBDSD = oForm.DataSources.DBDataSources.Item("@VID_FEDOCED");

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

                //oCombo := ComboBox(oForm.Items.Item('TipDoc').Specific);
                //oCombo.ValidValues.Add('33', 'Factura');

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

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

                oMtx.AutoResizeColumns();

                //EditText(oForm.Items.Item('CardCode').Specific).Active := True;
                //oForm.Mode := BoFormMode.fm_OK_MODE;
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            oForm.Freeze(false);
            return(Result);
        }//fin InitForm
示例#3
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);
            dbOITM = oForm.DataSources.DBDataSources.Item("OITM");



            oItemRef = oForm.Items.Item("39");
            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("106");


                oItem         = oForm.Items.Add("B1_lbSub", SAPbouiCOM.BoFormItemTypes.it_STATIC);
                oItem.Top     = oItemRef.Top;
                oItem.Height  = oItemRef.Height;
                oItem.Left    = oItemRef1.Left;
                oItem.Width   = oItemRef.Width + 40;
                oItem.Visible = true;
                B1_lbSub      = (SAPbouiCOM.StaticText)oItem.Specific;

                B1_lbSub.Caption = "Sub Group";

                oItemRef1 = oForm.Items.Item("107");

                oItem             = oForm.Items.Add("cbSubGroup", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX);
                oItem.Top         = oItemRef.Top;
                oItem.Height      = oItemRef.Height;
                oItem.Left        = oItemRef1.Left;
                oItem.Width       = oItemRef.Width + 90;
                oItem.Visible     = true;
                oItem.DisplayDesc = true;
                oItem.LinkTo      = "B1_lbSub";
                cbSubGroup        = (SAPbouiCOM.ComboBox)oItem.Specific;

                cbSubGroup.DataBind.SetBound(true, "OITM", "U_SubGrp");


                //   <databind>
                //    <DataTable UniqueId="dtHead" ColumnUID="RNN"/>
                //  </databind>
                //</specific>
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }

            oForm.Freeze(false);
            dsSAP = new DataServices(Program.strConSAP);
        }
示例#4
0
        private void InitiallizeForm()
        {
            oForm.Freeze(true);
            oForm.Freeze(false);
            // hideAll();


            OWOR = oForm.DataSources.DBDataSources.Item("WOR1");

            dsSAP = new DataServices(Program.strConSAP);
            dsWEB = new DataServices(Program.strConWeb);
        }
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            Int32 CantRol;

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

            oRecordSet      = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
            Funciones.SBO_f = FSBOf;
            try
            {
                //Lista = new List<string>();
                FSBOf.LoadForm(xmlPath, "VID_FECTASAP.srf", uid);
                oForm = FSBOApp.Forms.Item(uid);
                oForm.Freeze(true);
                oForm.AutoManaged = true;

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

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

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

                AddChooseFromList();
                CargarGrilla();
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            finally
            {
                oForm.Freeze(false);
            }


            return(Result);
        }//fin InitForm
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            Int32 CantRol;

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

            oRecordSet      = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
            Funciones.SBO_f = FSBOf;
            try
            {
                //Lista = new List<string>();
                FSBOf.LoadForm(xmlPath, "VID_FEListaNegra.srf", uid);
                //EnableCrystal := true;
                oForm = FSBOApp.Forms.Item(uid);
                oForm.Freeze(true);
                oForm.AutoManaged    = false;
                oForm.SupportedModes = -1;       // afm_All
                oForm.EnableMenu("1282", false); //Crear
                oForm.EnableMenu("1281", false); //Actualizar

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

                AddChooseFromList();
                CargarGrid();
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            finally
            {
                if (oForm != null)
                {
                    oForm.Freeze(false);
                }
            }


            return(Result);
        }//fin InitForm
示例#7
0
        private void AddPrefix()
        {
            //int i = 0;
            EditText oEditText = null;
            string   newPhone  = String.Empty;

            oItem     = oForm.Items.Item("txtPhone");
            oEditText = (EditText)oItem.Specific;

            oMatrix.FlushToDataSource();

            oDBDataSource = oForm.DataSources.DBDataSources.Item("OCRD");

            for (int i = 0; i <= oDBDataSource.Size - 1; i++)
            {
                newPhone = oDBDataSource.GetValue("Phone1", i);
                newPhone = newPhone.Trim(Char.Parse(" "));
                oDBDataSource.SetValue("Phone1", 1, oEditText.String + newPhone);
            }
            oMatrix.LoadFromDataSource();
        }
示例#8
0
        /// <summary>
        /// Agrega un item de venta de pesaje a la matriz
        /// </summary>
        public SAPbouiCOM.DBDataSource AddItemWeigin(SAPbouiCOM.DBDataSource mDBDataSourceD)
        {
            mDBDataSourceD.Clear();
            mDBDataSourceD.InsertRecord(0);
            QueryManager lObjQueryManager = new QueryManager();
            string       lSTrItemCode     = lObjQueryManager.GetValue("U_Value", "Name", "PL_ITEM_WEIGH", "[@UG_CONFIG]");

            mDBDataSourceD.SetValue("ItemCode", 0, lSTrItemCode); //Ponerlo en configuracion

            TicketDAO lObjTicketDAO = new TicketDAO();
            string    lStrPrice     = lObjTicketDAO.GetPrice(lSTrItemCode);

            mDBDataSourceD.SetValue("Dscription", 0, "Articulo de pesaje simple");
            mDBDataSourceD.SetValue("Price", 0, lStrPrice);
            if (lStrPrice == "0")
            {
                mDBDataSourceD.SetValue("Price", 0, "0");
            }
            mDBDataSourceD.SetValue("Quantity", 0, "0");
            mDBDataSourceD.SetValue("LineTotal", 0, "0");
            return(mDBDataSourceD);
        }
示例#9
0
        //Carga los datos al data source de la matriz
        public SAPbouiCOM.DBDataSource LoadMatrixData(Ticket pObjTicket, SAPbouiCOM.DBDataSource pDBDataSourceD, IList <TicketDetail> pLstTicketDetail, string pStrSource)
        {
            int    i            = 0;
            double lFloQuantity = 0;

            foreach (TicketDetail lObjTicketDetail in pLstTicketDetail.OrderByDescending(x => x.Line))
            {
                ///LE Importe Pesaje simple
                if (pObjTicket.CapType == 4)
                {
                    lFloQuantity = 1;
                }
                else
                {
                    lFloQuantity = lObjTicketDetail.netWeight;
                }
                //mObjQueryManager.GetObjectsList<

                pDBDataSourceD.InsertRecord(i);
                pDBDataSourceD.SetValue("ItemCode", i, lObjTicketDetail.Item);
                pDBDataSourceD.SetValue("Dscription", i, mObjTicketServices.SearchItemName(lObjTicketDetail.Item));
                pDBDataSourceD.SetValue("Price", i, lObjTicketDetail.Price.ToString());
                pDBDataSourceD.SetValue("Weight1", i, lObjTicketDetail.FirstWT.ToString());
                pDBDataSourceD.SetValue("Weight2", i, lObjTicketDetail.SecondWT.ToString());
                pDBDataSourceD.SetValue("Quantity", i, lFloQuantity.ToString());
                pDBDataSourceD.SetValue("LineTotal", i, (lFloQuantity * lObjTicketDetail.Price).ToString());
                pDBDataSourceD.SetValue("U_GLO_BagsBales", i, lObjTicketDetail.BagsBales.ToString());
                pDBDataSourceD.SetValue("WhsCode", i, lObjTicketDetail.WhsCode.ToString());
                pDBDataSourceD.SetValue("FromWhsCod", i, lObjTicketDetail.WhsCode.ToString());

                pDBDataSourceD.SetValue("LineNum", i, lObjTicketDetail.BaseLine.ToString());
                string lStrLine  = GetTableLine(pObjTicket.DocType, pStrSource);
                string lStrTable = lStrLine.Remove(lStrLine.Length - 1);
                pDBDataSourceD.SetValue("OpenCreQty", i, mObjTicketServices.GetOpenLine("O" + lStrTable, lStrLine, "OpenCreQty", pObjTicket.Number.ToString(), lObjTicketDetail.BaseLine.ToString()));
                pDBDataSourceD.SetValue("DelivrdQty", i, mObjTicketServices.GetDeliveryLine("O" + lStrTable, lStrLine, "DelivrdQty", pObjTicket.Number.ToString(), lObjTicketDetail.BaseLine.ToString()));
            }
            return(pDBDataSourceD);
        }
示例#10
0
        public static void clsSalesOrder_MenuEvent(ref SAPbouiCOM.Application oApplication, ref SAPbobsCOM.Company oCompany, SAPbouiCOM.Form oForm, ref SAPbouiCOM.MenuEvent pVal, ref bool BubbleEvent)
        {
            try
            {
                oHDBDataSource   = oForm.DataSources.DBDataSources.Item("ORDR");
                oChildDataSource = oForm.DataSources.DBDataSources.Item("RDR1");
                oMatrix          = (SAPbouiCOM.Matrix)oForm.Items.Item("38").Specific;

                if (pVal.BeforeAction)
                {
                    if (pVal.MenuUID == "1299")
                    {
                    }
                    if (pVal.MenuUID == "DeleteRow" && oForm.Mode == SAPbouiCOM.BoFormMode.fm_ADD_MODE)
                    {
                    }
                }
            }
            catch (Exception ex)
            {
                oApplication.MessageBox(ex.Message.ToString() + "/" + oCompany.GetLastErrorDescription().ToString(), 1, "OK", "", "");
            }
        }
示例#11
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);
        }
示例#12
0
        private void ClearUnManagedObject()
        {
            if (oComboBox != null) { Marshal.ReleaseComObject(oComboBox); } oComboBox = null;
            if (oGrid != null) { Marshal.ReleaseComObject(oGrid); } oGrid = null;
            if (oUDS != null) { Marshal.ReleaseComObject(oUDS); } oUDS = null;
            //if (gDs.Tables[oForm.UniqueID + "_Deliver"] != null) gDs.Tables[oForm.UniqueID + "_Deliver"] = null;
            //if (gDs.Tables[oForm.UniqueID + "_Call"] != null) gDs.Tables[oForm.UniqueID + "_Call"] = null;
            if (gDs != null)
            {
                if(gDs.Tables.Contains(oForm.UniqueID + "_Deliver"))
                {
                    gDs.Tables.Remove(oForm.UniqueID + "_Deliver");
                }

                if (gDs.Tables.Contains(oForm.UniqueID + "_Call"))
                {
                    gDs.Tables.Remove(oForm.UniqueID + "_Call");
                }
            }
            if (oDB_M != null) { Marshal.ReleaseComObject(oDB_M); } oDB_M = null;
            if (oMatrix != null) { Marshal.ReleaseComObject(oMatrix); } oMatrix = null;
            if (oDB1_O != null) { Marshal.ReleaseComObject(oDB1_O); } oDB1_O = null;
            if (oDB1_Z != null) { Marshal.ReleaseComObject(oDB1_Z); } oDB1_Z = null;
            if (oDB2_O != null) { Marshal.ReleaseComObject(oDB2_O); } oDB2_O = null;
            if (oDB2_Z != null) { Marshal.ReleaseComObject(oDB2_Z); } oDB2_Z = null;
            if (oRS != null) { Marshal.ReleaseComObject(oRS); } oRS = null;
            if (oEditText != null) { Marshal.ReleaseComObject(oEditText); } oEditText = null;

            if ((oForm != null))
            {
                Marshal.ReleaseComObject(oForm);
            }
            oForm = null;
            // ADD YOUR ACTION CODE HERE ...
            System.GC.Collect();
            System.GC.WaitForPendingFinalizers();
        }
示例#13
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;
            }
        }
示例#14
0
        public virtual void ET_edtCALLPER_AFChooseFromList(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtCALLPER").Specific));
            // ADD YOUR ACTION CODE HERE ...

            //데이터를 가져오기 위해 데이터테이블 추가

            SAPbouiCOM.DataTable oDataTable = FN.GetCFLSelectedObjects(pVal);

            try
            {
                if (oForm.Mode != BoFormMode.fm_FIND_MODE)
                {
                    if (oDataTable != null)
                    {
                        oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                        oDB_M.SetValue("U_CALLPER", 0, oDataTable.GetValue("USER_CODE", 0).ToString());
                        oDB_M.SetValue("U_CALLNM", 0, oDataTable.GetValue("U_NAME", 0).ToString());
                        if (oForm.Mode == BoFormMode.fm_OK_MODE)
                            oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                    }
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText("ET_edtCALLPER_AFChooseFromList " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oDataTable = null;
            }
        }
示例#15
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;
            }
        }
示例#16
0
        private void FindData(SAPbouiCOM.Form oForm)
        {
            string strExpr = string.Empty;
            string strSort = string.Empty;

            /* 조회조건 */
            string strF_DEPT = string.Empty;    // 구독부서
            string strF_TEL = string.Empty;     // 전화번호
            string strF_ADDR = string.Empty;    // 주소
            string strF_CENTER = string.Empty;  // 지국(분국)
            string strF_STATUS = string.Empty;  // 상태


            System.Data.DataRow[] findRows = null;
            StringBuilder sb = new StringBuilder();
            int i = 0;

            try
            {
                /*조회조건 값 가져오기 */
                oUDS = oForm.DataSources.UserDataSources;

                strF_DEPT = oUDS.Item("edtF_RDEPT").Value;
                strF_TEL = oUDS.Item("edtF_TEL").Value;
                strF_ADDR = oUDS.Item("edtF_ADDR").Value;
                strF_CENTER = oUDS.Item("edtF_CENT").Value;
                strF_STATUS = oUDS.Item("cboF_STATU").Value;

                oDB1_Z = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO00301Z_HRD");
                oDB1_Z.Clear();

                sb.Append(" 1 = 1                               ");
                if (!string.IsNullOrEmpty(strF_DEPT)) //구독부서
                    sb.AppendFormat(" AND RDEPT LIKE '%{0}%'         ", strF_DEPT);
                if (!string.IsNullOrEmpty(strF_TEL)) //전화번호
                    sb.AppendFormat(" AND TEL LIKE '%{0}%'           ", strF_TEL);
                if (!string.IsNullOrEmpty(strF_ADDR)) //주소
                    sb.AppendFormat(" AND (ADDR1 LIKE '%{0}%' OR ADDR1_D LIKE '%{0}%' OR ADDR2 LIKE '%{0}%' OR ADDR2_D LIKE '%{0}%' )  ", strF_ADDR);
                if (!string.IsNullOrEmpty(strF_CENTER)) //지국
                    sb.AppendFormat(" AND CENTNM LIKE '%{0}%'        ", strF_CENTER);
                if (!string.IsNullOrEmpty(strF_STATUS)) //상태
                    sb.AppendFormat(" AND STATUS = '{0}'        ", strF_STATUS);

                // 정렬 기준
                findRows = gDs.Tables[oForm.UniqueID + "_Deliver"].Select(sb.ToString(), "LINEID ASC");

                foreach (System.Data.DataRow dr in findRows)
                {
                    oDB1_Z.InsertRecord(i);

                    oDB1_Z.SetValue("U_NO", i, (i + 1).ToString());
                    oDB1_Z.SetValue("U_IDX", i, dr["IDX"].ToString()); //"데이터테이블 고유번호 IDX";
                    oDB1_Z.SetValue("LineId", i, dr["LineId"].ToString());//"원본라인번호";
                    oDB1_Z.SetValue("U_DELVCD", i, dr["DELVCD"].ToString()); //"배달코드";
                    oDB1_Z.SetValue("U_RDEPT", i, dr["RDEPT"].ToString()); //"부서";
                    oDB1_Z.SetValue("U_PAPERTP", i, dr["PAPERTP"].ToString()); //"지종";
                    oDB1_Z.SetValue("U_READTP", i, dr["READTP"].ToString()); //"독자구분";
                    oDB1_Z.SetValue("U_PAYCD", i, dr["PAYCD"].ToString()); //"요금제코드";
                    oDB1_Z.SetValue("U_PAYNM", i, dr["PAYNM"].ToString()); //"요금제명";
                    oDB1_Z.SetValue("U_TEL", i, dr["TEL"].ToString()); //"연락처";
                    oDB1_Z.SetValue("U_MOBILE", i, dr["MOBILE"].ToString()); //"휴대폰";
                    oDB1_Z.SetValue("U_ADDR1", i, dr["ADDR1"].ToString()); //"주소1";
                    oDB1_Z.SetValue("U_ADDR2", i, dr["ADDR2"].ToString()); //"주소2";
                    oDB1_Z.SetValue("U_ADDR1_D", i, dr["ADDR1_D"].ToString()); //"주소1상세";
                    oDB1_Z.SetValue("U_ADDR2_D", i, dr["ADDR2_D"].ToString()); //"주소2상세";
                    oDB1_Z.SetValue("U_CENTCD", i, dr["CENTCD"].ToString()); //"지국";
                    oDB1_Z.SetValue("U_CENTNM", i, dr["CENTNM"].ToString()); //"지국명";
                    oDB1_Z.SetValue("U_DELVFR", i, FN.SetDateFormatToDB(dr["DELVFR"].ToString(), FN.eDateType.n_YYYYMMDD)); //"배달시작일";
                    oDB1_Z.SetValue("U_DELVTO", i, FN.SetDateFormatToDB(dr["DELVTO"].ToString(), FN.eDateType.n_YYYYMMDD)); //"배달종료일";
                    oDB1_Z.SetValue("U_DELVCNT", i, dr["DELVCNT"].ToString()); //"배달부수";
                    oDB1_Z.SetValue("U_METHOD", i, dr["METHOD"].ToString()); //"가입방법";
                    oDB1_Z.SetValue("U_SAILCD", i, dr["SAILCD"].ToString()); //"유치자";
                    oDB1_Z.SetValue("U_SAILNM", i, dr["SAILNM"].ToString()); //"유치자";
                    oDB1_Z.SetValue("U_SDEPT", i, dr["SDEPT"].ToString()); //"유치부서";
                    oDB1_Z.SetValue("U_NOTE", i, dr["NOTE"].ToString()); //"배달상세";
                    oDB1_Z.SetValue("U_STATUS", i, dr["STATUS"].ToString()); //"배달상태";

                    oDB1_Z.SetValue("U_JOINDT", i, FN.SetDateFormatToDB(dr["JOINDT"].ToString(), FN.eDateType.n_YYYYMMDD)); //"가입일자";
                    oDB1_Z.SetValue("U_CLOSEDT", i, FN.SetDateFormatToDB(dr["CLOSEDT"].ToString(), FN.eDateType.n_YYYYMMDD)); //"중지일자";

                    oDB1_Z.SetValue("U_USERSG1", i, dr["USERSG1"].ToString()); //"등록자";

                    oDB1_Z.SetValue("U_BTEL1", i, dr["BTEL1"].ToString()); //"분국전화1";
                    oDB1_Z.SetValue("U_BTEL2", i, dr["BTEL2"].ToString()); //"분국전화1";

                    i += 1;
                }

                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_DUMY").Specific;
                oMatrix.LoadFromDataSource();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                findRows = null;
            }
        }
示例#17
0
        private void SetDefultMasterData(SAPbouiCOM.Form oForm)
        {
            string strNewCode = string.Empty;
            try
            {
                oDB_M = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                strNewCode = GetNewCode(oForm);
                oDB_M.SetValue("Code", 0, strNewCode);

                // HR/KR 관리자 , JH 관리자 = 릴리즈 / HR/KR 콜센터 = 계획
                if (oForm.Mode == BoFormMode.fm_ADD_MODE)
                {

                    // 2014.06.11 사용자 요청으로 상태값 무조건 릴리즈 처리한다.
                    oDB_M.SetValue("U_STATUS", 0, "R");

                    //if (SO.SO_COMMON_HRD.Authority == SO.SO_COMMON_HRD.AuthorityType.H_Manager || SO.SO_COMMON_HRD.Authority == SO.SO_COMMON_HRD.AuthorityType.J_Manager)
                    //    oDB_M.SetValue("U_STATUS", 0, "R");
                    //else
                    //    oDB_M.SetValue("U_STATUS", 0, "P");

                    oDB_M.SetValue("U_USERSG2", 0, B1Connections.diCompany.UserSignature.ToString()); // 등록자 / 수정자 저장
                }

                gDs.Tables[oForm.UniqueID + "_Deliver"].Rows.Clear();
                gDs.Tables[oForm.UniqueID + "_Call"].Rows.Clear();
                //gDs.Tables[oForm.UniqueID + "_Deliver"].Rows.Clear();
                //gDs.Tables[oForm.UniqueID + "_Call"].Rows.Clear();

            }
            catch (Exception)
            {

                throw;
            }
        }
示例#18
0
        private void GetAdvanceAmt(SAPbouiCOM.Form oForm)
        {           
            string strREADCD = string.Empty;
            try
            {
                oForm.Freeze(true);
                oUDS = oForm.DataSources.UserDataSources;
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                strREADCD = oDB_M.GetValue("Code", 0).Trim();

               string strRtnValue =  FN.GetRecordsetValue(string.Format( " SELECT ISNULL(U_AMT,0) FROM KIS_VW_SO02401_HRD WHERE U_READCD = '{0}' " , strREADCD));
               oUDS.Item("edtADVANCE").Value = strRtnValue;

            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText("GetAdvanceAmt " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oForm.Freeze(false);
                oForm.Refresh();
            }
        }
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            Int32 CantRol;

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

            oRecordSet      = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
            Funciones.SBO_f = FSBOf;
            try
            {
                Lista = new List <string>();
                FSBOf.LoadForm(xmlPath, "VID_FEPLANCTA.srf", uid);
                oForm = FSBOApp.Forms.Item(uid);
                oForm.Freeze(true);
                oForm.AutoManaged = true;

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

                oDBDSHeader = oForm.DataSources.DBDataSources.Add("@VID_FEPLANCTA");

                if (((System.Int32)oRecordSet.Fields.Item("cant").Value) == 0)
                {
                    FSBOApp.StatusBar.SetText("Iniciando carga de cuentas SII", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Warning);
                    CargarCtaSII();
                }

                // Ok  Ad  Fnd Vw Rq Sec
                Lista.Add("grid       , t,  t,  f,  t, n, 1 ");
                FSBOf.SetAutoManaged(oForm, Lista);

                oForm.DataSources.UserDataSources.Add("Cuenta", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 30);
                oEditText = ((EditText)oForm.Items.Item("Cuenta").Specific);
                oEditText.DataBind.SetBound(true, "", "Cuenta");

                oForm.DataSources.UserDataSources.Add("Descr", SAPbouiCOM.BoDataType.dt_LONG_TEXT, 60);
                oEditText = ((EditText)oForm.Items.Item("Descr").Specific);
                oEditText.DataBind.SetBound(true, "", "Descr");

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

                CargarGrilla();
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            finally
            {
                oForm.Freeze(false);
            }


            return(Result);
        }//fin InitForm
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            //SAPbouiCOM.ComboBox oCombo;
            TFunctions Param;

            SAPbouiCOM.CheckBox oCheckBox;
            SAPbouiCOM.EditText oEditText;

            //
            //  obetener recurso
            //  try
            //  .....
            //  finally
            //  liberar recurso
            //  end

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

            oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
            try
            {
                //Lista    := New list<string>;

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

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

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

                oDBDSHeader = (DBDataSource)(oForm.DataSources.DBDataSources.Item("@VID_FEPARAM"));

                oCheckBox        = (CheckBox)(oForm.Items.Item("chkMon").Specific);
                oCheckBox.ValOn  = "Y";
                oCheckBox.ValOff = "N";

                oCheckBox        = (CheckBox)(oForm.Items.Item("chkDteTra").Specific);
                oCheckBox.ValOn  = "Y";
                oCheckBox.ValOff = "N";

                //oCheckBox = (CheckBox)(oForm.Items.Item("chkCrearD").Specific);
                //oCheckBox.ValOn = "Y";
                //oCheckBox.ValOff = "N";

                //oCheckBox = (CheckBox)(oForm.Items.Item("chkCrearDS").Specific);
                //oCheckBox.ValOn = "Y";
                //oCheckBox.ValOff = "N";

                oCheckBox        = (CheckBox)(oForm.Items.Item("chkPrint").Specific);
                oCheckBox.ValOn  = "Y";
                oCheckBox.ValOff = "N";

                oCheckBox        = (CheckBox)(oForm.Items.Item("chkDistrib").Specific);
                oCheckBox.ValOn  = "Y";
                oCheckBox.ValOff = "N";

                oCheckBox        = (CheckBox)(oForm.Items.Item("chkVal90").Specific);
                oCheckBox.ValOn  = "Y";
                oCheckBox.ValOff = "N";

                oCheckBox        = (CheckBox)(oForm.Items.Item("MultiSoc").Specific);
                oCheckBox.ValOn  = "Y";
                oCheckBox.ValOff = "N";

                oCheckBox        = (CheckBox)(oForm.Items.Item("ValDescL").Specific);
                oCheckBox.ValOn  = "Y";
                oCheckBox.ValOff = "N";

                oCheckBox        = (CheckBox)(oForm.Items.Item("GeneraT").Specific);
                oCheckBox.ValOn  = "Y";
                oCheckBox.ValOff = "N";

                oCheckBox        = (CheckBox)(oForm.Items.Item("SubirSuc").Specific);
                oCheckBox.ValOn  = "Y";
                oCheckBox.ValOff = "N";

                oCheckBox        = (CheckBox)(oForm.Items.Item("AbrirDoc").Specific);
                oCheckBox.ValOn  = "Y";
                oCheckBox.ValOff = "N";

                oCheckBox        = (CheckBox)(oForm.Items.Item("chkFProv").Specific);
                oCheckBox.ValOn  = "Y";
                oCheckBox.ValOff = "N";

                oEditText            = (EditText)(oForm.Items.Item("Pasword").Specific);
                oEditText.IsPassword = true;


                //Configuración RadioButtons
                DSOpDif = oForm.DataSources.UserDataSources.Add("rbOpDif", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1);
                ((OptionBtn)oForm.Items.Item("opDifPor").Specific).DataBind.SetBound(true, "", "rbOpDif"); //1

                ((OptionBtn)oForm.Items.Item("opDifMon").Specific).DataBind.SetBound(true, "", "rbOpDif"); //2
                ((OptionBtn)oForm.Items.Item("opDifMon").Specific).GroupWith("opDifPor");


                if (!GlobalSettings.RunningUnderSQLServer)
                {
                    oForm.Items.Item("btnProcFE").Visible = false;
                }
                else
                {
                    oForm.Items.Item("btnProcFE").Visible = true;
                }

                //s := 'Select count(*) cant from [@VID_FEPARAM]';
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"Select count(*) CANT
                                ,U_Usuario
                                ,U_Password
                                ,U_UserWSCL
                                ,U_PassWSCL
                                ,ISNULL(U_TipoDif,'M') 'U_TipoDif'
                            from [@VID_FEPARAM] 
                            group by U_Usuario
                                ,U_Password
                                ,U_UserWSCL
                                ,U_PassWSCL
                                ,ISNULL(U_TipoDif,'M')";
                }
                else
                {
                    s = @"Select count(*) ""CANT"" 
                           ,""U_Usuario"" 
                           ,""U_Password""
                           ,""U_UserWSCL""
                           ,""U_PassWSCL""
                           ,IFNULL(""U_TipoDif"",'M') ""U_TipoDif""
                      from ""@VID_FEPARAM"" 
                     group by ""U_Usuario"" 
                             ,""U_Password""
                             ,""U_UserWSCL""
                             ,""U_PassWSCL""
                             ,IFNULL(""U_TipoDif"",'M') ";
                }
                oRecordSet.DoQuery(s);
                if ((System.Int32)(oRecordSet.Fields.Item("CANT").Value) > 0)
                {
                    Param       = new TFunctions();
                    Param.SBO_f = FSBOf;

                    oForm.SupportedModes = 1;
                    oForm.Mode           = BoFormMode.fm_UPDATE_MODE;
                    oDBDSHeader.Query(null);

                    s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_Usuario").Value).ToString().Trim());
                    oDBDSHeader.SetValue("U_Usuario", 0, s);

                    s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_Password").Value).ToString().Trim());
                    oDBDSHeader.SetValue("U_Password", 0, s);

                    s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_UserWSCL").Value).ToString().Trim());
                    oDBDSHeader.SetValue("U_UserWSCL", 0, s);

                    s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_PassWSCL").Value).ToString().Trim());
                    oDBDSHeader.SetValue("U_PassWSCL", 0, s);

                    oForm.PaneLevel = 101;

                    if (((System.String)oDBDSHeader.GetValue("U_MultiSoc", 0)).Trim() == "Y")
                    {
                        oForm.Items.Item("chkDistrib").Visible = false;
                        oForm.Items.Item("AbrirDoc").Visible   = true;
                    }
                    else if (((System.String)oDBDSHeader.GetValue("U_MultiSoc", 0)).Trim() == "N")
                    {
                        oForm.Items.Item("chkDistrib").Visible = true;
                        oForm.Items.Item("AbrirDoc").Visible   = false;
                    }

                    oForm.Freeze(false);
                    if (((System.String)oRecordSet.Fields.Item("U_TipoDif").Value).Trim() == "M")
                    {
                        DSOpDif.Value = "2";
                    }
                    //((OptionBtn)oForm.Items.Item("opDifMon").Specific).Selected = true;
                    else
                    {
                        DSOpDif.Value = "1";
                    }
                    //((OptionBtn)oForm.Items.Item("opDifPor").Specific).Selected = true;
                }
                else
                {
                    oForm.SupportedModes = 3;
                    oForm.Mode           = BoFormMode.fm_ADD_MODE;
                    oForm.PaneLevel      = 101;
                    ((OptionBtn)oForm.Items.Item("opDifMon").Specific).Selected = true;
                }
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            finally
            {
                oForm.Freeze(false);
            }


            return(Result);
        }//fin InitForm
示例#21
0
        public SAPbouiCOM.DBDataSource CalcImport(string pStrTypeTicket, SAPbouiCOM.IMatrix pObjMatrix, int pIntRow, SAPbouiCOM.DBDataSource pDBDataSourceD)
        {
            try
            {
                double lDblPesoNeto = 0;
                double lDblPeso1    = 0;
                double lDblPeso2    = 0;
                double lDblImporte  = 0;
                double lDblPrice    = 0;
                string lStrSacos    = "";

                if (pIntRow <= pObjMatrix.RowCount && !string.IsNullOrEmpty((pObjMatrix.Columns.Item("Peso2").Cells.Item(pIntRow).Specific as EditText).Value.Trim()))
                {
                    lDblPeso1 = Convert.ToDouble((pObjMatrix.Columns.Item("Peso1").Cells.Item(pIntRow).Specific as EditText).Value.Trim());  //itemcode = VALUE OF CELL. COLUMN "1": ITEMCODE COLUMN. CURRENT ROW: pVal.Row
                    lDblPeso2 = Convert.ToDouble((pObjMatrix.Columns.Item("Peso2").Cells.Item(pIntRow).Specific as EditText).Value.Trim());
                    lDblPrice = Convert.ToDouble((pObjMatrix.Columns.Item("Price").Cells.Item(pIntRow).Specific as EditText).Value.Trim());
                    if (pStrTypeTicket != "Venta de pesaje" && pStrTypeTicket != "Pesaje")
                    {
                        lStrSacos = ((SAPbouiCOM.EditText)pObjMatrix.Columns.Item("Sacos").Cells.Item(pIntRow).Specific).Value;
                    }
                    //  lDblPesoNeto = Convert.ToDouble((mObjMatrix.Columns.Item("PesoN").Cells.Item(mIntRow).Specific as EditText).Value.Trim());


                    if (!((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(pIntRow).Specific).Checked)
                    {
                        pDBDataSourceD.SetValue("TreeType", pIntRow - 1, "N");
                        if (lDblPeso1 != 0 && lDblPeso2 != 0 && lDblPesoNeto == 0)
                        {
                            lDblPesoNeto = lDblPeso2 - lDblPeso1;
                        }
                    }
                    else
                    {
                        pDBDataSourceD.SetValue("TreeType", pIntRow - 1, "Y");
                        lDblPesoNeto = Convert.ToDouble((pObjMatrix.Columns.Item("PesoN").Cells.Item(pIntRow).Specific as EditText).Value.Trim());
                    }

                    lDblPrice = Convert.ToDouble((pObjMatrix.Columns.Item("Price").Cells.Item(pIntRow).Specific as EditText).Value.Trim());

                    if (mObjValidations.ValidateWeight(pStrTypeTicket, lDblPesoNeto, lDblPeso2, pObjMatrix, pIntRow))
                    {
                        //Valida el tipo de peso
                        if (lDblPesoNeto < 0)
                        {
                            lDblPesoNeto = lDblPesoNeto * -1;
                        }

                        if (!((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(pIntRow).Specific).Checked)
                        {
                            (pObjMatrix.Columns.Item("PesoN").Cells.Item(pIntRow).Specific as EditText).Value = lDblPesoNeto.ToString("C");
                        }
                        //(pObjMatrix.Columns.Item("Price").Cells.Item(pIntRow).Specific as EditText).Value = lDblPrice.ToString("C");
                        pDBDataSourceD.SetValue("Quantity", pIntRow - 1, lDblPesoNeto.ToString("C"));
                        pDBDataSourceD.SetValue("Price", pIntRow - 1, lDblPrice.ToString("C"));
                        //  (pObjMatrix.Columns.Item("Peso1").Cells.Item(pIntRow).Specific as EditText).Value = lDblPeso1.ToString();
                        //  (pObjMatrix.Columns.Item("Peso2").Cells.Item(pIntRow).Specific as EditText).Value = lDblPeso2.ToString();

                        pDBDataSourceD.SetValue("Weight1", pIntRow - 1, lDblPeso1.ToString());
                        pDBDataSourceD.SetValue("Weight2", pIntRow - 1, lDblPeso2.ToString());

                        pDBDataSourceD.SetValue("U_GLO_BagsBales", pIntRow - 1, lStrSacos);


                        //mObjMatrix.Item.Visible = false;
                        //mObjMatrix.Item.Visible = true;
                        //mObjMatrix.LoadFromDataSource();

                        if (pStrTypeTicket == "Venta de pesaje" || pStrTypeTicket == "Pesaje")
                        {
                            lDblImporte = lDblPrice;
                        }
                        else
                        {
                            lDblImporte = lDblPesoNeto * lDblPrice;
                        }

                        //if (lDblImporte < 0)
                        //{
                        //    lDblImporte = lDblImporte * -1;
                        //}

                        (pObjMatrix.Columns.Item("Importe").Cells.Item(pIntRow).Specific as EditText).Value = lDblImporte.ToString("C");
                        pDBDataSourceD.SetValue("LineTotal", pIntRow - 1, lDblImporte.ToString("C"));
                        pObjMatrix.Item.Update();
                        //pObjMatrix.LoadFromDataSource();
                    }
                }
            }
            catch (Exception ex)
            {
                LogService.WriteError("[CalcImport]: " + ex.Message);
                LogService.WriteError(ex);
                UIApplication.ShowMessageBox("Error al calcular Importe " + ex.Message);
            }
            return(pDBDataSourceD);
        }
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            Int32 CantRol;

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

            oRecordSet      = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
            Funciones.SBO_f = FSBOf;
            try
            {
                Lista = new List <string>();
                FSBOf.LoadForm(xmlPath, "VID_MenuConf.srf", uid);

                oForm = FSBOApp.Forms.Item(uid);
                oForm.Freeze(true);
                oForm.Visible        = true;
                oForm.AutoManaged    = true;
                oForm.SupportedModes = -1;

                ((StaticText)oForm.Items.Item("18").Specific).Caption = "Conexión a HANA";
                oForm.Mode = BoFormMode.fm_ADD_MODE;

                oDBDSHeader = oForm.DataSources.DBDataSources.Item("@VID_MENUSU");

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"SELECT Code FROM [@VID_MENUSU]";
                }
                else
                {
                    s = @"SELECT ""Code"" FROM ""@VID_MENUSU"" ";
                }
                oRecordSet.DoQuery(s);

                if (oRecordSet.RecordCount == 0)
                {
                    if (((System.String)oRecordSet.Fields.Item("Code").Value) == "1")
                    {
                        oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE;
                    }
                    else
                    {
                        oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE;
                    }
                }
                else
                {
                    oDBDSHeader.Query(null);
                    oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE;
                }
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            finally
            {
                oForm.Freeze(false);
            }


            return(Result);
        }//fin InitForm
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            //SAPbouiCOM.ComboBox oComboBox;
            bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

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

                Lista = new List <string>();

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

                VID_DelRow   = false;
                VID_DelRowOK = false;

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

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

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

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

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

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

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

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

                //EditText(oForm.Items.Item('CardCode').Specific).Active := True;
                oForm.Mode = BoFormMode.fm_OK_MODE;
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            oForm.Freeze(false);

            return(Result);
        }//fin InitForm
示例#24
0
        /// <summary>
        /// 독자코드가 존재하면 새로운 코드를 채번해서 화면상에 Bind하고 저장하도록 한다.
        /// </summary>
        /// <param name="oForm"></param>
        private void SeNewCodeApply(SAPbouiCOM.Form oForm)
        {
            string strNewCode = string.Empty;
            string strLineID = string.Empty;
            try
            {
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                strNewCode = GetNewCode(oForm);

                oDB_M.SetValue("Code", 0, strNewCode);
                foreach (System.Data.DataRow dr in gDs.Tables[oForm.UniqueID + "_Deliver"].Rows)
                {
                    strLineID = dr["LINEID"].ToString().Trim().PadLeft(4, '0');
                    dr["DELVCD"] = strNewCode + "_" + strLineID;
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#25
0
        private void GetDataLoad(SAPbouiCOM.Form oForm, string pCode)
        {
            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
            oDB1_O = oForm.DataSources.DBDataSources.Item("@KIS_SO00301_HRD");
            oDB2_O = oForm.DataSources.DBDataSources.Item("@KIS_SO00302_HRD");
            oDB1_Z = oForm.DataSources.DBDataSources.Item("@KIS_SO00301Z_HRD");
            oDB2_Z = oForm.DataSources.DBDataSources.Item("@KIS_SO00302Z_HRD");

            //헤더데이터를 조회
            QueryWithConditions(ref oDB_M, "Code", pCode);
            if (oDB_M.Size > 0)
            {
                //헤더를 기준으로 라인데이터 조회
                QueryWithConditions(ref oDB1_O, "Code", pCode);
                QueryWithConditions(ref oDB2_O, "Code", pCode);

                SetSystemDataTable(oForm);
                oForm.Mode = BoFormMode.fm_OK_MODE;
            }
            oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_ORIG").Specific;
            oMatrix.LoadFromDataSource();

            oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_ORIG").Specific;
            oMatrix.LoadFromDataSource();
        }
示例#26
0
 private void AddDataSourceNoForm()
 {
     oUserDataSource = oForm.DataSources.UserDataSources.Add("IntPhone", BoDataType.dt_SHORT_TEXT, 20);
     oDBDataSource   = oForm.DataSources.DBDataSources.Add("OCRD");
 }
示例#27
0
        public virtual void ET_cboJOB_AFComboSelect(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oComboBox = ((SAPbouiCOM.ComboBox)(oForm.Items.Item("cboJOB").Specific));
            // ADD YOUR ACTION CODE HERE ...

            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
            oDB_M.SetValue("U_JOBNM", 0, oComboBox.Selected.Description);
        }
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            Int32 i;
            //TFunctions Reg;
            bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

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

                Lista = new List <string>();

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

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

                //oForm.DataBrowser.BrowseBy := "Code";
                oDBDSH = oForm.DataSources.DBDataSources.Item("@VID_FEPROCED");

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

                //oCombo := ComboBox(oForm.Items.Item('TipDoc').Specific);
                //oCombo.ValidValues.Add('33', 'Factura');

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

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


                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select DocEntry, ISNULL(U_TipoDoc,'') TipoDoc, ISNULL(U_ProcNomE,'') ProcNomE, ISNULL(U_ProcNomD,'') ProcNomD, ISNULL(U_ProcNomR,'') ProcNomR, ISNULL(U_ProcNomC,'') ProcNomC, ISNULL(U_ProcNomDe,'') ProcNomDe, ISNULL(U_ProcNomL,'') ProcNomL, ISNULL(U_ProcNomS,'') ProcNomS, ISNULL(U_Habili,'Y') 'Habilitada', ISNULL(U_CantLineas,0) 'CantLineas' from [@VID_FEPROCED]";
                }
                else
                {
                    s = @"select ""DocEntry"", IFNULL(""U_TipoDoc"",'') ""TipoDoc"", IFNULL(""U_ProcNomE"",'') ""ProcNomE"", IFNULL(""U_ProcNomD"",'') ""ProcNomD"", IFNULL(""U_ProcNomR"",'') ""ProcNomR"", IFNULL(""U_ProcNomC"",'') ""ProcNomC"", IFNULL(""U_ProcNomDe"",'') ""ProcNomDe"", IFNULL(""U_ProcNomL"",'') ""ProcNomL"", IFNULL(""U_ProcNomS"",'') ""ProcNomS"", IFNULL(""U_Habili"",'Y') ""Habilitada"", IFNULL(""U_CantLineas"",0) ""CantLineas"" from ""@VID_FEPROCED"" ";
                }
                oRecordSet.DoQuery(s);

                i = 0;
                oDBDSH.Clear();
                while (!oRecordSet.EoF)
                {
                    oDBDSH.InsertRecord(i);
                    oDBDSH.SetValue("DocEntry", i, Convert.ToString((System.Int32)(oRecordSet.Fields.Item("DocEntry").Value)));
                    oDBDSH.SetValue("U_TipoDoc", i, (System.String)(oRecordSet.Fields.Item("TipoDoc").Value));
                    //oDBDSH.SetValue("U_TipoDocPE", i, (System.String)(oRecordSet.Fields.Item("TipoDocPE").Value));
                    oDBDSH.SetValue("U_ProcNomE", i, (System.String)(oRecordSet.Fields.Item("ProcNomE").Value));
                    oDBDSH.SetValue("U_ProcNomD", i, (System.String)(oRecordSet.Fields.Item("ProcNomD").Value));
                    oDBDSH.SetValue("U_ProcNomR", i, (System.String)(oRecordSet.Fields.Item("ProcNomR").Value));
                    oDBDSH.SetValue("U_ProcNomC", i, (System.String)(oRecordSet.Fields.Item("ProcNomC").Value));
                    //oDBDSH.SetValue("U_ProcNomDe", i, (System.String)(oRecordSet.Fields.Item("ProcNomDe").Value));
                    //oDBDSH.SetValue("U_ProcNomL", i, (System.String)(oRecordSet.Fields.Item("ProcNomL").Value));
                    //oDBDSH.SetValue("U_ProcNomS", i, (System.String)(oRecordSet.Fields.Item("ProcNomS").Value));
                    oDBDSH.SetValue("U_Habili", i, (System.String)(oRecordSet.Fields.Item("Habilitada").Value));
                    oDBDSH.SetValue("U_CantLineas", i, Convert.ToString((System.Int32)(oRecordSet.Fields.Item("CantLineas").Value)));
                    oRecordSet.MoveNext();
                    i++;
                }

                oDBDSH.InsertRecord(i);
                oDBDSH.SetValue("DocEntry", i, "");
                oDBDSH.SetValue("U_TipoDoc", i, "");
                //oDBDSH.SetValue("U_TipoDocPE", i, "");
                oDBDSH.SetValue("U_ProcNomE", i, "");
                oDBDSH.SetValue("U_ProcNomD", i, "");
                oDBDSH.SetValue("U_ProcNomR", i, "");
                oDBDSH.SetValue("U_ProcNomC", i, "");
                //oDBDSH.SetValue("U_ProcNomDe", i, "");
                //oDBDSH.SetValue("U_ProcNomL", i, "");
                //oDBDSH.SetValue("U_ProcNomS", i, "");
                oDBDSH.SetValue("U_Habili", i, "Y");
                oDBDSH.SetValue("U_CantLineas", i, "60");

                if (GlobalSettings.RunningUnderSQLServer) //TipoDoc
                {
                    s = @"select U1.FldValue 'Code', U1.Descr 'Name' from UFD1 U1 join CUFD U0 on U0.TableID = U1.TableID and U0.FieldID = U1.FieldID where U1.TableID = '@VID_FEPROCED' and U0.AliasID = '{0}'";
                }
                else
                {
                    s = @"select U1.""FldValue"" ""Code"", U1.""Descr"" ""Name"" from ""UFD1"" U1 join ""CUFD"" U0 on U0.""TableID"" = U1.""TableID"" and U0.""FieldID"" = U1.""FieldID"" where U1.""TableID"" = '@VID_FEPROCED' and U0.""AliasID"" = '{0}' ";
                }

                s = String.Format(s, "TipoDoc");
                oRecordSet.DoQuery(s);
                oColumn = (SAPbouiCOM.Column)(oMtx.Columns.Item("TipoDoc"));
                FSBOf.FillComboMtx(oColumn, ref oRecordSet, false);
                //((SAPbouiCOM.Column)oMtx.Columns.Item("TipoDocPE")).Visible = false;

                if (GlobalSettings.RunningUnderSQLServer) //Habilitado
                {
                    s = @"select FldValue 'Code', Descr 'Name' from UFD1 where TableID = '@VID_FEPROCED' and FieldID = 2";
                }
                else
                {
                    s = @"select ""FldValue"" ""Code"", ""Descr"" ""Name"" from ""UFD1"" where ""TableID"" = '@VID_FEPROCED' and ""FieldID"" = 2";
                }
                oRecordSet.DoQuery(s);
                oColumn = (SAPbouiCOM.Column)(oMtx.Columns.Item("Habili"));
                FSBOf.FillComboMtx(oColumn, ref oRecordSet, false);


                //EditText(oForm.Items.Item('CardCode').Specific).Active := True;
                oMtx.LoadFromDataSource();


                oForm.Mode = BoFormMode.fm_OK_MODE;
                oMtx.AutoResizeColumns();
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            oForm.Freeze(false);
            return(Result);
        }//fin InitForm
示例#29
0
        /// <summary>
        /// 새로운 독자코드를 채번한다.
        /// </summary>
        /// <param name="oForm"></param>
        /// <returns></returns>
        private string GetNewCode(SAPbouiCOM.Form oForm)
        {
            string strMaxCode = string.Empty;
            StringBuilder sb = new StringBuilder();
            try
            {
                sb.AppendLine(" SELECT   (CASE                                                                                                         ");
                sb.AppendLine("              WHEN (SELECT ISNULL (U_USERGBN, '')                                                                       ");
                sb.AppendLine("                      FROM [@KIS_SO0010M_HRD]                                                                           ");
                sb.AppendLine("                     WHERE Code = '{0}') IN ('10', '20')                                                                ");
                sb.AppendLine("              THEN                                                                                                      ");
                sb.AppendLine("                 'H'                                                                                                    ");
                sb.AppendLine("              ELSE                                                                                                      ");
                sb.AppendLine("                 'J'                                                                                                    ");
                sb.AppendLine("           END)                                                                                                         ");
                sb.AppendLine("  + RIGHT ('000000000' +  ISNULL ( (SELECT CONVERT (NVARCHAR (10), MAX(DocEntry) + 1) FROM [@KIS_SO0030M_HRD]), '1'), 9) ");


                string strUserName = B1Connections.diCompany.UserName;
                oDB_M = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                strMaxCode = FN.GetRecordsetValue(string.Format(sb.ToString(), strUserName));

            }
            catch (Exception)
            {
                throw;
            }
            return strMaxCode;
        }
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            //SAPbouiCOM.ComboBox oCombo;
            TFunctions Param;

            SAPbouiCOM.CheckBox oCheckBox;
            SAPbouiCOM.EditText oEditText;

            //
            //  obetener recurso
            //  try
            //  .....
            //  finally
            //  liberar recurso
            //  end

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

            oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
            try
            {
                //Lista    := New list<string>;

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

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

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

                oDBDSHeader = (DBDataSource)(oForm.DataSources.DBDataSources.Item("@VID_FEPARAM"));

                if (!GlobalSettings.RunningUnderSQLServer)
                {
                    oForm.Items.Item("btnProcFE").Visible = false;
                }
                else
                {
                    oForm.Items.Item("btnProcFE").Visible = true;
                }

                //s := 'Select count(*) cant from [@VID_FEPARAM]';
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"Select count(*) CANT
                                ,U_UserED
                                ,U_PwdED
                                ,U_UserWS
                                ,U_PassWS
                            from [@VID_FEPARAM] 
                            group by U_UserED
                                ,U_PwdED
                                ,U_UserWS
                                ,U_PassWS";
                }
                else
                {
                    s = @"Select count(*) ""CANT"" 
                           ,""U_UserED""
                           ,""U_PwdED""
                           ,""U_UserWS""
                           ,""U_PassWS""
                      from ""@VID_FEPARAM"" 
                     group by ""U_UserED""
                             ,""U_PwdED""
                             ,""U_UserWS""
                             ,""U_PassWS""";
                }
                oRecordSet.DoQuery(s);
                if ((System.Int32)(oRecordSet.Fields.Item("CANT").Value) > 0)
                {
                    Param       = new TFunctions();
                    Param.SBO_f = FSBOf;

                    oForm.SupportedModes = 1;
                    oForm.Mode           = BoFormMode.fm_UPDATE_MODE;
                    oDBDSHeader.Query(null);

                    s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_UserED").Value).ToString().Trim());
                    oDBDSHeader.SetValue("U_UserED", 0, s);

                    s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_PwdED").Value).ToString().Trim());
                    oDBDSHeader.SetValue("U_PwdED", 0, s);

                    s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_UserWS").Value).ToString().Trim());
                    oDBDSHeader.SetValue("U_UserWS", 0, s);

                    s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_PassWS").Value).ToString().Trim());
                    oDBDSHeader.SetValue("U_PassWS", 0, s);
                }
                else
                {
                    oForm.SupportedModes = 3;
                    oForm.Mode           = BoFormMode.fm_ADD_MODE;
                    oForm.PaneLevel      = 106;
                }
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            finally
            {
                oForm.Freeze(false);
            }


            return(Result);
        }//fin InitForm
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

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

                //Lista    := New list<string>;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                CargarDatosPE();
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            oForm.Freeze(false);
            return(Result);
        }//fin InitForm
示例#32
0
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

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

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


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

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

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

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

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

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

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


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

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

                oGrid.AutoResizeColumns();
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            oForm.Freeze(false);
            return(Result);
        }//fin InitForm
示例#33
0
        /// <summary>
        /// 마스터의 구독부수를 갱신한다.
        /// </summary>
        /// <param name="oForm"></param>
        private void SetSumNumberOfCofies(SAPbouiCOM.Form oForm)
        {

            try
            {
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                string strSum = gDs.Tables[oForm.UniqueID + "_Deliver"].Compute(" SUM(DELVCNT) ", " STATUS = 'UO'").ToString();

                if (string.IsNullOrEmpty(strSum))
                    strSum = "0";

                oDB_M.SetValue("U_SUMCNT", 0, strSum);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            //SAPbouiCOM.ComboBox oCombo;
            SAPbouiCOM.GridColumn oColumn;
            bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

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

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

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

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

                ogrid.DataTable = oDataTable;

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


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

                oForm.Mode = BoFormMode.fm_OK_MODE;
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            oForm.Freeze(false);
            return(Result);
        }//fin Initform
示例#35
0
        public virtual void ET_edtCALLPER_AFValidate(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oEditText = ((SAPbouiCOM.EditText)(oForm.Items.Item("edtCALLPER").Specific));
            // ADD YOUR ACTION CODE HERE ....

            if (pVal.ItemChanged == true)
            {
                if (oEditText.Value == "")
                {
                    oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                    oDB_M.SetValue("U_CALLNM", 0, "");
                }
            }
        }
        public new bool InitForm(string uid, string xmlPath, ref SAPbouiCOM.Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            Int32 CantRol;

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

            oRecordSet      = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset));
            Funciones.SBO_f = FSBOf;
            try
            {
                Lista = new List <string>();
                FSBOf.LoadForm(xmlPath, "VID_FEMonDTE.srf", uid);
                //EnableCrystal := true;
                oForm = FSBOApp.Forms.Item(uid);
                oForm.Freeze(true);
                oForm.AutoManaged    = false;
                oForm.SupportedModes = -1;       // afm_All
                oForm.EnableMenu("1282", false); //Crear
                oForm.EnableMenu("1281", false); //Actualizar

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

                oDBDSHC = oForm.DataSources.DBDataSources.Add("@VID_FEDTECPRA");
                oDBDSHV = oForm.DataSources.DBDataSources.Add("@VID_FEDTEVTA");

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

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

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

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

                DSOpFec = oForm.DataSources.UserDataSources.Add("FechaEmi", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1);
                ((OptionBtn)oForm.Items.Item("FechaEmi").Specific).DataBind.SetBound(true, "", "FechaEmi");

                ((OptionBtn)oForm.Items.Item("FechaRecep").Specific).DataBind.SetBound(true, "", "FechaEmi");
                ((OptionBtn)oForm.Items.Item("FechaRecep").Specific).GroupWith("FechaEmi");
                ((OptionBtn)oForm.Items.Item("FechaEmi").Specific).Selected = true;


                oComboBox = (ComboBox)(oForm.Items.Item("Cliente").Specific);
                oForm.DataSources.UserDataSources.Add("Cliente", BoDataType.dt_SHORT_TEXT, 10);
                oComboBox.DataBind.SetBound(true, "", "Cliente");
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"SELECT 'Todos' Code, 'Todos' Name UNION ALL 
                          SELECT T1.FldValue Code, T1.Descr Name
                          FROM CUFD T0
                          JOIN UFD1 T1 ON T1.TableID = T0.TableID
                                      AND T1.FieldID = T0.FieldID
                         WHERE T0.TableID = '{0}'
                           AND T0.AliasID = 'EstadoC'";
                }
                else
                {
                    s = @"SELECT 'Todos' ""Code"", 'Todos' ""Name"" FROM DUMMY UNION ALL
                          SELECT T1.""FldValue"" ""Code"", T1.""Descr"" ""Name""
                          FROM ""CUFD"" T0
                          JOIN ""UFD1"" T1 ON T1.""TableID"" = T0.""TableID""
                                      AND T1.""FieldID"" = T0.""FieldID""
                         WHERE T0.""TableID"" = '{0}'
                           AND T0.""AliasID"" = 'EstadoC'";
                }
                s = String.Format(s, "@VID_FEDTEVTA");
                oRecordSet.DoQuery(s);
                FSBOf.FillCombo(oComboBox, ref oRecordSet, false);
                oComboBox.Select("Todos", BoSearchKey.psk_ByValue);

                oComboBox = (ComboBox)(oForm.Items.Item("SII").Specific);
                oForm.DataSources.UserDataSources.Add("SII", BoDataType.dt_SHORT_TEXT, 10);
                oComboBox.DataBind.SetBound(true, "", "SII");
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"SELECT 'Todos' Code, 'Todos' Name UNION ALL
                          SELECT T1.FldValue Code, T1.Descr Name
                          FROM CUFD T0
                          JOIN UFD1 T1 ON T1.TableID = T0.TableID
                                      AND T1.FieldID = T0.FieldID
                         WHERE T0.TableID = '{0}'
                           AND T0.AliasID = 'EstadoSII'";
                }
                else
                {
                    s = @"SELECT 'Todos' ""Code"", 'Todos' ""Name"" FROM DUMMY UNION ALL
                          SELECT T1.""FldValue"" ""Code"", T1.""Descr"" ""Name""
                          FROM ""CUFD"" T0
                          JOIN ""UFD1"" T1 ON T1.""TableID"" = T0.""TableID""
                                      AND T1.""FieldID"" = T0.""FieldID""
                         WHERE T0.""TableID"" = '{0}'
                           AND T0.""AliasID"" = 'EstadoSII'";
                }
                s = String.Format(s, "@VID_FEDTEVTA");
                oRecordSet.DoQuery(s);
                FSBOf.FillCombo(oComboBox, ref oRecordSet, false);
                oComboBox.Select("Todos", BoSearchKey.psk_ByValue);

                oComboBox = (ComboBox)(oForm.Items.Item("Ley").Specific);
                oForm.DataSources.UserDataSources.Add("Ley", BoDataType.dt_SHORT_TEXT, 10);
                oComboBox.DataBind.SetBound(true, "", "Ley");
                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"SELECT 'Todos' Code, 'Todos' Name UNION ALL
                          SELECT T1.FldValue Code, T1.Descr Name
                          FROM CUFD T0
                          JOIN UFD1 T1 ON T1.TableID = T0.TableID
                                      AND T1.FieldID = T0.FieldID
                         WHERE T0.TableID = '{0}'
                           AND T0.AliasID = 'EstadoLey'";
                }
                else
                {
                    s = @"SELECT 'Todos' ""Code"", 'Todos' ""Name"" FROM DUMMY UNION ALL
                          SELECT T1.""FldValue"" ""Code"", T1.""Descr"" ""Name""
                          FROM ""CUFD"" T0
                          JOIN ""UFD1"" T1 ON T1.""TableID"" = T0.""TableID""
                                      AND T1.""FieldID"" = T0.""FieldID""
                         WHERE T0.""TableID"" = '{0}'
                           AND T0.""AliasID"" = 'EstadoLey'";
                }
                s = String.Format(s, "@VID_FEDTEVTA");
                oRecordSet.DoQuery(s);
                FSBOf.FillCombo(oComboBox, ref oRecordSet, false);
                oComboBox.Select("Todos", BoSearchKey.psk_ByValue);

                BuscarDatos();
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            finally
            {
                if (oForm != null)
                {
                    oForm.Freeze(false);
                }
            }


            return(Result);
        }//fin InitForm
示例#37
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;
            }
        }
示例#38
0
        private void FindSubData(SAPbouiCOM.Form oForm, int pRowIdx, string Type = "")
        {
            string strDeliveryCode = string.Empty;
            string strExpr = string.Empty;
            string strSort = string.Empty;
            System.Data.DataRow[] findRows = null;
            StringBuilder sb = new StringBuilder();
            int i = 0;

            try
            {
                oForm.Freeze(true);
                oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1_DUMY").Specific));

                oDB2_Z = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO00302Z_HRD");
                oDB2_Z.Clear();

                if (oMatrix.VisualRowCount > 0)
                {

                    strDeliveryCode = FN.GetMatirxCellValue(ref oMatrix, "U_DELVCD", pRowIdx);

                    sb.Append(" 1 = 1                                   ");
                    if (!string.IsNullOrEmpty(strDeliveryCode))
                    {
                        sb.AppendFormat(" AND DELVCD = '{0}'  ", strDeliveryCode);
                    }
                    if (Type == "")
                    {
                        sb.AppendFormat(" AND DELVCD = '{0}'  ", strDeliveryCode);
                        sFindTY = "F";
                    }
                    else
                    {
                        sFindTY = "";
                    }

                    findRows = gDs.Tables[oForm.UniqueID + "_Call"].Select(sb.ToString(), "IDX DESC");
                    oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_DUMY").Specific;

                    foreach (System.Data.DataRow dr in findRows)
                    {
                        oDB2_Z.InsertRecord(i);

                        oDB2_Z.SetValue("U_NO", i, (i + 1).ToString());
                        oDB2_Z.SetValue("U_IDX", i, dr["IDX"].ToString());//"데이터테이블 고유번호 IDX";
                        oDB2_Z.SetValue("LineId", i, dr["LINEID"].ToString());//"원본라인번호";
                        oDB2_Z.SetValue("U_DELVCD", i, dr["DELVCD"].ToString());//"배달코드"
                        oDB2_Z.SetValue("U_CALLTP", i, dr["CALLTP"].ToString());//"콜유형"
                        oDB2_Z.SetValue("U_MEMO", i, dr["MEMO"].ToString());//"접수내용"
                        oDB2_Z.SetValue("U_RECVID", i, dr["RECVID"].ToString());//"접수자ID"
                        oDB2_Z.SetValue("U_RECVNM", i, dr["RECVNM"].ToString());//"접수자명"
                        oDB2_Z.SetValue("U_RECVDT", i, dr["RECVDT"].ToString());//"접수일자"
                        oDB2_Z.SetValue("U_RECVTI", i, dr["RECVTI"].ToString());//"접수시간"
                        oDB2_Z.SetValue("U_PROCID", i, dr["PROCID"].ToString());//"처리자ID"
                        oDB2_Z.SetValue("U_PROCNM", i, dr["PROCNM"].ToString());//"처리자명"
                        oDB2_Z.SetValue("U_PROCDT", i, dr["PROCDT"].ToString());//"처리일자"
                        oDB2_Z.SetValue("U_PROSTAT", i, dr["PROSTAT"].ToString());//"처리상태"

                        i += 1;
                    }


                    oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_DUMY").Specific;
                    oMatrix.LoadFromDataSource();

                    //접수자 ID와 로그인 아이디가 다를경우 수정불가
                    for (int j = 0; j < oMatrix.VisualRowCount; j++)
                    {
                        if ((oMatrix.GetCellSpecific("U_RECVID", j + 1).Value.Trim() == B1Connections.diCompany.UserName.ToString()) && (sFindTY == "F"))
                        {
                            oMatrix.CommonSetting.SetCellEditable(j + 1, gCallTp_IDX, true);
                            oMatrix.CommonSetting.SetCellEditable(j + 1, gComment_IDX, true);
                        }
                        else
                        {
                            oMatrix.CommonSetting.SetCellEditable(j + 1, gCallTp_IDX, false);
                            oMatrix.CommonSetting.SetCellEditable(j + 1, gComment_IDX, false);
                        }

                    }

                }
            }
            catch (Exception)
            {
                oForm.Freeze(false);
                throw;
            }
            finally
            {
                oForm.Freeze(false);
                findRows = null;
            }
        }
示例#39
0
        /// <summary>
        /// 독자코드 존재여부 : 저장된 코드가 있으면 True 없으면 False
        /// </summary>
        /// <param name="oForm"></param>
        /// <returns></returns>
        private bool GetCodeExists(SAPbouiCOM.Form oForm)
        {
            bool rtnValue = false;
            string strSQL = string.Empty;
            string strCode = string.Empty;
            string strValue = string.Empty;
            try
            {
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                strCode = oDB_M.GetValue("Code", 0);
                strSQL = string.Format(" SELECT COUNT(1) FROM [@KIS_SO0030M_HRD] WHERE Code = '{0}' ", strCode);

                strValue = FN.GetRecordsetValue(strSQL);
                if (strValue != "0")
                    rtnValue = true;
            }
            catch (Exception)
            {
                throw;
            }
            return rtnValue;
        }
示例#40
0
        public virtual bool ET_BFFormDataUpdate(BusinessObjectInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            // ADD YOUR ACTION CODE HERE ...
            bool rtnValue = true;

            //메모리상의 데이터 테이블의 상태값을 기준으로 DBDataSource에 복사한다. 
            try
            {
                //oForm.Freeze(true);
                oDB_M = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                oDB_M.SetValue("U_USERSG2", 0, B1Connections.diCompany.UserSignature.ToString()); // 등록자 / 수정자 저장

                if (!DataToDbDataSource_DELIVER(oForm) || !DataToDbDataSource_CALL(oForm))
                    rtnValue = false;
                else
                    rtnValue = true;

            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                //oForm.Freeze(false);
            }

            return rtnValue;
        }
示例#41
0
        /// <summary>
        /// ItemValidate 를 한곳에서 처리하도록함.
        /// </summary>
        /// <param name="oForm"></param>
        /// <param name="pItemUID"></param>
        private void ItemValidate(SAPbouiCOM.Form oForm, string pItemUID)
        {
            string strItemValue = string.Empty;
            try
            {
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");

                switch (pItemUID)
                {
                    //납부방법 1
                    case "edtPAY_FR1":
                        strItemValue = FN.GetItemValue(ref oForm, pItemUID);
                        if (!string.IsNullOrEmpty(strItemValue))
                        {
                            string strMonthFirstDate = DateTimeLibrary.FirstDayOfCurrentMonth(strItemValue);
                            oDB_M.SetValue("U_PAY_FR1", 0, FN.SetDateFormatToDB(strMonthFirstDate, FN.eDateType.n_YYYYMMDD));

                            strItemValue = FN.GetItemValue(ref oForm, "edtPAY_TO1");
                            if (string.IsNullOrEmpty(strItemValue))
                                oDB_M.SetValue("U_PAY_TO1", 0, "29991231");
                        }
                        break;
                    case "edtPAY_TO1":
                        strItemValue = FN.GetItemValue(ref oForm, pItemUID);
                        if (!string.IsNullOrEmpty(strItemValue))
                        {
                            string strMonthLastDate = DateTimeLibrary.LastDayOfCurrentMonth(strItemValue);
                            oDB_M.SetValue("U_PAY_TO1", 0, FN.SetDateFormatToDB(strMonthLastDate, FN.eDateType.n_YYYYMMDD));
                        }
                        break;
                    //납부방법 2
                    case "edtPAY_FR2":
                        strItemValue = FN.GetItemValue(ref oForm, pItemUID);
                        if (!string.IsNullOrEmpty(strItemValue))
                        {
                            string strMonthFirstDate = DateTimeLibrary.FirstDayOfCurrentMonth(strItemValue);
                            oDB_M.SetValue("U_PAY_FR2", 0, FN.SetDateFormatToDB(strMonthFirstDate, FN.eDateType.n_YYYYMMDD));
                        }
                        break;
                    case "edtPAY_TO2":
                        strItemValue = FN.GetItemValue(ref oForm, pItemUID);
                        if (!string.IsNullOrEmpty(strItemValue))
                        {
                            string strMonthLastDate = DateTimeLibrary.LastDayOfCurrentMonth(strItemValue);
                            oDB_M.SetValue("U_PAY_TO2", 0, FN.SetDateFormatToDB(strMonthLastDate, FN.eDateType.n_YYYYMMDD));
                        }
                        break;

                    // 구독기간
                    case "edtR_FRDT":
                        strItemValue = FN.GetItemValue(ref oForm, pItemUID);
                        if (!string.IsNullOrEmpty(strItemValue))
                        {
                            strItemValue = FN.GetItemValue(ref oForm, "edtR_TODT");
                            if (string.IsNullOrEmpty(strItemValue))
                                oDB_M.SetValue("U_R_TODT", 0, "29991231");
                        }
                        break;
                    default:
                        break;
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#42
0
        private bool DataToDbDataSource_DELIVER(SAPbouiCOM.Form oForm)
        {
            bool rtnValue = false;
            try
            {
                oDB1_O = oForm.DataSources.DBDataSources.Item("@KIS_SO00301_HRD");
                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_ORIG").Specific;
                oMatrix.FlushToDataSource();
                /*
                // 1. 메트릭스 삭제대상 삭제 적용
                var objDelete = from row in gDs.Tables[oForm.UniqueID + "_Deliver"].AsEnumerable()
                                where row.Field<string>("ROWSTATE") == "D"
                                select new
                                {
                                    vIDX = row.Field<Int32>("IDX") +1                               
                                };

                foreach (var itemSub in objDelete)
                {
                    //삭제할것들 선택한다.
                    oMatrix.SelectRow(itemSub.vIDX, true, true);
                }

                // 선택된 Rows를 삭제한다.
                int iSelectIdx = 0;

                while (iSelectIdx != -1)
                {
                    iSelectIdx = oMatrix.GetNextSelectedRow(0, BoOrderType.ot_SelectionOrder);
                    if (iSelectIdx != -1)
                        oMatrix.DeleteRow(iSelectIdx);
                }
                if(objDelete.Count() > 0)
                    oMatrix.FlushToDataSource();
                */

                // 2. 수정, 추가된내역 적용
                var objModify = from row in gDs.Tables[oForm.UniqueID + "_Deliver"].AsEnumerable()
                                where row.Field<string>("ROWSTATE") == "M" || row.Field<string>("ROWSTATE") == "I"
                                select new
                                {
                                    vIDX = row.Field<Int32>("IDX")
                                    ,
                                    vDELVCD = row.Field<string>("DELVCD")
                                    ,
                                    vRDEPT = row.Field<string>("RDEPT")
                                    ,
                                    vPAPERTP = row.Field<string>("PAPERTP")
                                    ,
                                    vPAYCD = row.Field<string>("PAYCD")
                                    ,
                                    vPAYNM = row.Field<string>("PAYNM")
                                    ,
                                    vTEL = row.Field<string>("TEL")
                                    ,
                                    vMOBILE = row.Field<string>("MOBILE")
                                    ,
                                    vADDR1 = row.Field<string>("ADDR1")
                                    ,
                                    vADDR2 = row.Field<string>("ADDR2")
                                    ,
                                    vADDR1_D = row.Field<string>("ADDR1_D")
                                    ,
                                    vADDR2_D = row.Field<string>("ADDR2_D")
                                    ,
                                    vCENTCD = row.Field<string>("CENTCD")
                                    ,
                                    vCENTNM = row.Field<string>("CENTNM")
                                    ,
                                    vDELVFR = row.Field<string>("DELVFR")
                                    ,
                                    vDELVTO = row.Field<string>("DELVTO")
                                    ,
                                    vDELVCNT = row.Field<Int32>("DELVCNT")
                                    ,
                                    vMETHOD = row.Field<string>("METHOD")
                                    ,
                                    vSAILCD = row.Field<string>("SAILCD")
                                    ,
                                    vSAILNM = row.Field<string>("SAILNM")
                                    ,
                                    vSDEPT = row.Field<string>("SDEPT")
                                    ,
                                    vSTATUS = row.Field<string>("STATUS")
                                    ,
                                    vNOTE = row.Field<string>("NOTE")
                                    ,
                                    vJOINDT = row.Field<string>("JOINDT")
                                    ,
                                    vCLOSEDT = row.Field<string>("CLOSEDT")
                                    ,
                                    vUSERSG1 = row.Field<string>("USERSG1")
                                    ,
                                    vREADTP = row.Field<string>("READTP")
                                    ,
                                    vBTEL1 = row.Field<string>("BTEL1")
                                    ,
                                    vBTEL2 = row.Field<string>("BTEL2")
                                    ,
                                    vROWSTATE = row.Field<string>("ROWSTATE")
                                };

                foreach (var itemSub in objModify)
                {
                    if (itemSub.vROWSTATE == "I")
                        SetDbDataSourceAddRow(ref oForm, ref oMatrix, ref oDB1_O, "U_DELVCD");

                    oDB1_O.SetValue("U_DELVCD", itemSub.vIDX, itemSub.vDELVCD);
                    oDB1_O.SetValue("U_RDEPT", itemSub.vIDX, itemSub.vRDEPT);
                    oDB1_O.SetValue("U_PAPERTP", itemSub.vIDX, itemSub.vPAPERTP);
                    oDB1_O.SetValue("U_READTP", itemSub.vIDX, itemSub.vREADTP);

                    oDB1_O.SetValue("U_PAYCD", itemSub.vIDX, itemSub.vPAYCD);
                    oDB1_O.SetValue("U_PAYNM", itemSub.vIDX, itemSub.vPAYNM);

                    oDB1_O.SetValue("U_TEL", itemSub.vIDX, itemSub.vTEL);
                    oDB1_O.SetValue("U_MOBILE", itemSub.vIDX, itemSub.vMOBILE);
                    oDB1_O.SetValue("U_ADDR1", itemSub.vIDX, itemSub.vADDR1);
                    oDB1_O.SetValue("U_ADDR2", itemSub.vIDX, itemSub.vADDR2);
                    oDB1_O.SetValue("U_ADDR1_D", itemSub.vIDX, itemSub.vADDR1_D);
                    oDB1_O.SetValue("U_ADDR2_D", itemSub.vIDX, itemSub.vADDR2_D);
                    oDB1_O.SetValue("U_CENTCD", itemSub.vIDX, itemSub.vCENTCD);
                    oDB1_O.SetValue("U_CENTNM", itemSub.vIDX, itemSub.vCENTNM);
                    oDB1_O.SetValue("U_DELVFR", itemSub.vIDX, itemSub.vDELVFR);
                    oDB1_O.SetValue("U_DELVTO", itemSub.vIDX, itemSub.vDELVTO);
                    oDB1_O.SetValue("U_DELVCNT", itemSub.vIDX, itemSub.vDELVCNT.ToString());
                    oDB1_O.SetValue("U_METHOD", itemSub.vIDX, itemSub.vMETHOD);
                    oDB1_O.SetValue("U_STATUS", itemSub.vIDX, itemSub.vSTATUS);
                    oDB1_O.SetValue("U_SAILCD", itemSub.vIDX, itemSub.vSAILCD);
                    oDB1_O.SetValue("U_SAILNM", itemSub.vIDX, itemSub.vSAILNM);
                    oDB1_O.SetValue("U_SDEPT", itemSub.vIDX, itemSub.vSDEPT);
                    oDB1_O.SetValue("U_NOTE", itemSub.vIDX, itemSub.vNOTE);
                    oDB1_O.SetValue("U_JOINDT", itemSub.vIDX, itemSub.vJOINDT);
                    oDB1_O.SetValue("U_CLOSEDT", itemSub.vIDX, itemSub.vCLOSEDT);
                    oDB1_O.SetValue("U_USERSG1", itemSub.vIDX, itemSub.vUSERSG1); //등록자

                    oDB1_O.SetValue("U_BTEL1", itemSub.vIDX, itemSub.vBTEL1); //분국전화1
                    oDB1_O.SetValue("U_BTEL2", itemSub.vIDX, itemSub.vBTEL2); //분국전화2

                }
                if (objModify.Count() > 0)
                    oMatrix.LoadFromDataSource();

                rtnValue = true;
            }
            catch (Exception)
            {
                throw;
            }
            return rtnValue;
        }
示例#43
0
        private void FindRequestData(SAPbouiCOM.Form oForm)
        {
            //ADD YOUR ACTION CODE HERE ...
            SAPbouiCOM.Grid oGrid;

            StringBuilder sb;
            string strREADCD = string.Empty;


            try
            {
                oForm.Freeze(true);
                oUDS = oForm.DataSources.UserDataSources;
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                strREADCD = oDB_M.GetValue("Code", 0).Trim();

                sb = new StringBuilder();
                //조회
                /*
                sb.AppendLine(" SELECT M.U_REQYM    AS U_YYYYMM                                                                                             ");
                sb.AppendLine("      , M.U_AMT      AS REQAMT                                                                                               ");
                sb.AppendLine("      , M.U_DATE     AS DEPO_DATE                                                                                            ");
                sb.AppendLine("      , M.U_INAMT    AS DEPO_AMT                                                                                             ");
                sb.AppendLine("      , M.U_SMLNM + ' ' + M.U_SMLNM2    AS U_PMETHOD                                                                         ");
                sb.AppendLine("      , M.U_STATUS   AS U_STATUS                                                                                             ");
                sb.AppendLine("   FROM (                                                                                                                    ");
                sb.AppendLine(" 		SELECT A.U_READCD                                                                                                   ");
                sb.AppendLine(" 			 , A.U_REQYM                                                                                                    ");
                sb.AppendLine(" 			 , (SELECT SUM(CASE ISNULL(F.U_TYPE, '') WHEN '110' THEN ISNULL(F.U_DEBIT, 0)                                   ");
                sb.AppendLine(" 												 WHEN '120' THEN (-1) * ISNULL(F.U_CREDIT, 0)                               ");
                sb.AppendLine(" 											     ELSE 0 END)                                                                ");
                sb.AppendLine(" 			      FROM [@KIS_SO01403_HRD] F                                                                                 ");
                sb.AppendLine(" 			     WHERE A.DocEntry = F.DocEntry                                                                              ");
                sb.AppendLine(" 				   AND A.LineId = F.U_UPLINEID                                                                              ");
                sb.AppendLine(" 				   AND F.U_TYPE IN ('110', '120') ) AS U_AMT                                                                ");
                sb.AppendLine(" 			 , CASE WHEN ISNULL(B.U_TYPE, '') NOT IN ('110', '120','150') THEN ISNULL(B.U_CREDIT, 0) ELSE 0 END AS U_INAMT  ");
                sb.AppendLine(" 			 , B.U_DATE					                                                                                    ");
                sb.AppendLine(" 			 , ISNULL(B.U_DEBIT,0) AS U_DEBIT                                                                               ");
                sb.AppendLine(" 			 , ISNULL(B.U_CREDIT,0) AS U_CREDIT                                                                             ");
                sb.AppendLine(" 			 , B.U_TYPE                                                                                                     ");
                sb.AppendLine(" 			 , (SELECT F.U_SMLNM FROM [@KIS_AD00201] F WHERE F.Code = 'SO54' AND F.U_CD = B.U_TYPE) AS U_SMLNM              ");
                sb.AppendLine(" 			 , (SELECT F.U_SMLNM FROM [@KIS_AD00201] F WHERE F.Code = 'SO51' AND F.U_SMLCD = B.U_SUBTYPE) AS U_SMLNM2       ");
                sb.AppendLine(" 			 , A.U_STATUS                                                                                                   ");
                sb.AppendLine(" 		  FROM [@KIS_SO01401_HRD] A                                                                                         ");
                sb.AppendLine(" 		       LEFT OUTER JOIN [@KIS_SO01403_HRD] B ON A.DocEntry = B.DocEntry                                              ");
                sb.AppendLine(" 													AND A.LineId = B.U_UPLINEID                                             ");
                sb.AppendLine(" 													AND B.U_TYPE NOT IN ('110', '120', '150')                               ");
                sb.AppendLine(" 	   ) M                                                                                                                  ");
                sb.AppendLine("   WHERE M.U_AMT <> 0 AND M.U_READCD = '{0}'                                                                                 ");
                sb.AppendLine("   ORDER BY M.U_READCD, M.U_REQYM                                                                                            ");
                */

                sb.AppendLine(" SELECT CASE WHEN ROW_NUMBER() OVER (PARTITION BY M.U_READCD, M.U_REQYM ORDER BY M.U_READCD, M.U_REQYM, M.U_AMT, M.DocEntry, M.LineId, M.U_DATE) = 1 THEN M.U_REQYM ELSE NULL END AS U_YYYYMM                                                     ");
                sb.AppendLine("      , CASE WHEN ROW_NUMBER() OVER (PARTITION BY M.U_READCD, M.U_REQYM ORDER BY M.U_READCD, M.U_REQYM, M.U_AMT, M.DocEntry, M.LineId, M.U_DATE) = 1 THEN M.U_AMT ELSE NULL END AS REQAMT                                                         ");
                sb.AppendLine("      , M.U_DATE     AS DEPO_DATE                                                                                            ");
                sb.AppendLine("      , M.U_INAMT    AS DEPO_AMT                                                                                             ");
                sb.AppendLine("      , M.U_SMLNM + (CASE ISNULL(M.U_SMLNM2,'') WHEN '' THEN '' ELSE ' ' + M.U_SMLNM2 END) AS U_PMETHOD                      ");
                sb.AppendLine("      , M.U_STATUS   AS U_STATUS                                                                                             ");
                sb.AppendLine("   FROM (                                                                                                                    ");
                sb.AppendLine(" 		SELECT A.U_READCD                                                                                                   ");
                sb.AppendLine(" 			 , A.U_REQYM                                                                                                    ");
                sb.AppendLine(" 			 , A.DocEntry                                                                                                   ");
                sb.AppendLine(" 			 , A.LineId                                                                                                     ");
                sb.AppendLine(" 			 , ISNULL((SELECT SUM(ISNULL(F.U_DEBIT, 0))                                                                     ");
                sb.AppendLine(" 			             FROM [@KIS_SO01403_HRD] F                                                                          ");
                sb.AppendLine(" 			            WHERE A.DocEntry = F.DocEntry                                                                       ");
                sb.AppendLine(" 				          AND A.LineId = F.U_UPLINEID                                                                       ");
                sb.AppendLine(" 				          AND F.U_TYPE IN ('110') ), 0) AS U_AMT                                                            ");
                sb.AppendLine(" 			 , CASE WHEN ISNULL(B.U_TYPE, '') NOT IN ('110','150','910','920','000') THEN ISNULL(B.U_CREDIT, 0) ELSE 0 END AS U_INAMT         ");
                sb.AppendLine(" 			 , B.U_DATE					                                                                                    ");
                sb.AppendLine(" 			 , ISNULL(B.U_DEBIT,0) AS U_DEBIT                                                                               ");
                sb.AppendLine(" 			 , ISNULL(B.U_CREDIT,0) AS U_CREDIT                                                                             ");
                sb.AppendLine(" 			 , B.U_TYPE                                                                                                     ");
                sb.AppendLine(" 			 , (SELECT F.U_SMLNM FROM [@KIS_AD00201] F WHERE F.Code = 'SO54' AND F.U_CD = B.U_TYPE) AS U_SMLNM              ");
                sb.AppendLine(" 			 , (SELECT F.U_SMLNM FROM [@KIS_AD00201] F WHERE F.Code = 'SO51' AND F.U_SMLCD = B.U_SUBTYPE) AS U_SMLNM2       ");
                sb.AppendLine(" 			 , A.U_STATUS                                                                                                   ");
                sb.AppendLine(" 		  FROM [@KIS_SO01401_HRD] A                                                                                         ");
                sb.AppendLine(" 		       LEFT OUTER JOIN [@KIS_SO01403_HRD] B ON A.DocEntry = B.DocEntry                                              ");
                sb.AppendLine(" 													AND A.LineId = B.U_UPLINEID                                             ");
                sb.AppendLine(" 													AND B.U_TYPE NOT IN ('110','150','910','920','000')                                       ");
                sb.AppendLine(" 	   ) M                                                                                                                  ");
                sb.AppendLine("   WHERE M.U_AMT <> 0 AND M.U_READCD = '{0}'                                                                                 ");
                sb.AppendLine("   ORDER BY M.U_READCD, M.U_REQYM                                                                                            ");

                B1Connections.theAppl.StatusBar.SetText("데이터 조회중입니다", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다

                oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific;
                oForm.DataSources.DataTables.Item("grd").ExecuteQuery(string.Format(sb.ToString(), strREADCD));
                oGrid.DataTable = oForm.DataSources.DataTables.Item("grd"); //데이터 그리드에 Display                  

                //1. 납부방법
                //FN.SetComboBoxValidValues(oGrid, "U_PMETHOD", " SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code ='SO09' ", FN.Enum_WholeTp.m_Nothing);

                //2. 상태
                FN.SetComboBoxValidValues(oGrid, "U_STATUS", " SELECT 'O' [Code], '미납' AS [Name] UNION ALL SELECT 'C' [Code], '완납' AS [Name]  ", FN.Enum_WholeTp.m_Nothing);

                //조회된 내역이 없어도 1줄이 추가되므로 키값을 체크하여 조회안된 경우 1줄 삭제
                if (oGrid.DataTable.Rows.Count == 1 && (oGrid.DataTable.GetValue("U_YYYYMM", 0).ToString() == null || oGrid.DataTable.GetValue("U_YYYYMM", 0).ToString() == ""))
                {
                    FN.SetGridTitle(oGrid
                        , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid)
                        , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName)
                        , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible)
                        , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable));

                }
                else
                {
                    FN.BindGrid(oGrid
                        , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnUid)
                        , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.ColumnName)
                        , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotEditable)
                        , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.NotVisible)
                        , ""
                        , GetGridFieldInfo(oForm, SO.SO_COMMON_HRD.GridTitleType.AlignRight));

                    //FN.SetColoumnColor(oForm, "grd3", "#E0ECF8", "ETAX_YN,DTINO,DTSTAT"); //그리드 BG 기본색(#E6E6FA)
                    oGrid.RowHeaders.Width = 0;
                    oGrid.AutoResizeColumns();
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText("FindRequestData " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oForm.Freeze(false);
                oForm.Refresh();
            }
        }
示例#44
0
        private bool DataToDbDataSource_CALL(SAPbouiCOM.Form oForm)
        {
            bool rtnValue = false;
            try
            {
                oDB2_O = oForm.DataSources.DBDataSources.Item("@KIS_SO00302_HRD");
                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_ORIG").Specific;

                /*
                // 1. 메트릭스 삭제대상 삭제 적용
                var objDelete = from row in gDs.Tables[oForm.UniqueID + "_Call"].AsEnumerable()
                                where row.Field<string>("ROWSTATE") == "D"
                                select new
                                {
                                    vIDX = row.Field<Int32>("IDX") + 1
                                };

                foreach (var itemSub in objDelete)
                {
                    //삭제할것들 선택한다.
                    oMatrix.SelectRow(itemSub.vIDX, true, true);
                }

                // 선택된 Rows를 삭제한다.
                int iSelectIdx = 0;

                while (iSelectIdx != -1)
                {
                    iSelectIdx = oMatrix.GetNextSelectedRow(0, BoOrderType.ot_SelectionOrder);
                    if (iSelectIdx != -1)
                        oMatrix.DeleteRow(iSelectIdx);
                }
                if (objDelete.Count() > 0)
                    oMatrix.FlushToDataSource();

                 * */

                var objModify = from row in gDs.Tables[oForm.UniqueID + "_Call"].AsEnumerable()
                                where row.Field<string>("ROWSTATE") == "M" || row.Field<string>("ROWSTATE") == "I"
                                orderby row.Field<Int32>("IDX") descending                         
                                select new
                                {
                                    vIDX = row.Field<Int32>("IDX")
                                    ,
                                    vDELVCD = row.Field<string>("DELVCD")
                                    ,
                                    vCALLTP = row.Field<string>("CALLTP")
                                    ,
                                    vMEMO = row.Field<string>("MEMO")
                                    ,
                                    vRECVID = row.Field<string>("RECVID")
                                    ,
                                    vRECVNM = row.Field<string>("RECVNM")
                                    ,
                                    vRECVDT = row.Field<string>("RECVDT")
                                    ,
                                    vRECVTI = row.Field<string>("RECVTI")
                                    ,
                                    vPROCID = row.Field<string>("PROCID")
                                    ,
                                    vPROCNM = row.Field<string>("PROCNM")
                                    ,
                                    vPROCDT = row.Field<string>("PROCDT")
                                    ,
                                    vPROSTAT = row.Field<string>("PROSTAT")
                                    ,
                                    vROWSTATE = row.Field<string>("ROWSTATE")

                                };

                foreach (var itemSub in objModify)
                {

                    if (itemSub.vROWSTATE == "I")
                        SetDbDataSourceAddRow(ref oForm, ref oMatrix, ref oDB2_O, "U_DELVCD");

                    oDB2_O.SetValue("U_DELVCD", itemSub.vIDX, itemSub.vDELVCD);
                    oDB2_O.SetValue("U_CALLTP", itemSub.vIDX, itemSub.vCALLTP);
                    oDB2_O.SetValue("U_MEMO", itemSub.vIDX, itemSub.vMEMO);
                    oDB2_O.SetValue("U_RECVID", itemSub.vIDX, itemSub.vRECVID);
                    oDB2_O.SetValue("U_RECVNM", itemSub.vIDX, itemSub.vRECVNM);
                    oDB2_O.SetValue("U_RECVDT", itemSub.vIDX, itemSub.vRECVDT);
                    oDB2_O.SetValue("U_RECVTI", itemSub.vIDX, itemSub.vRECVTI);
                    oDB2_O.SetValue("U_PROCID", itemSub.vIDX, itemSub.vPROCID);
                    oDB2_O.SetValue("U_PROCNM", itemSub.vIDX, itemSub.vPROCNM);
                    oDB2_O.SetValue("U_PROCDT", itemSub.vIDX, itemSub.vPROCDT);
                    oDB2_O.SetValue("U_PROSTAT", itemSub.vIDX, itemSub.vPROSTAT);

                }
                if (objModify.Count() > 0)
                    oMatrix.LoadFromDataSource();

                rtnValue = true;
            }
            catch (Exception)
            {
                throw;
            }
            return rtnValue;
        }
示例#45
0
        public virtual bool ET_BFDataMenu_Remove(MenuEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.ActiveForm;
            // ADD YOUR ACTION CODE HERE ...

            try
            {
                if (B1Connections.theAppl.MessageBox(" 독자코드 전체를 삭제하시겠습니까? ", 1, "예", "아니오", "") != 1)
                {
                    return false;
                }

                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                if (SO.SO_COMMON_HRD.Authority == SO.SO_COMMON_HRD.AuthorityType.H_Manager)
                {
                    if (!oDB_M.GetValue("Code", 0).Trim().StartsWith("H"))
                    {
                        B1Connections.theAppl.StatusBar.SetText("삭제 권한이 없습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                        return false;
                    }
                }
                else if (SO.SO_COMMON_HRD.Authority == SO.SO_COMMON_HRD.AuthorityType.J_Manager)
                {
                    if (!oDB_M.GetValue("Code", 0).Trim().StartsWith("J"))
                    {
                        B1Connections.theAppl.StatusBar.SetText("삭제 권한이 없습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                        return false;
                    }
                }
                else
                {
                    B1Connections.theAppl.StatusBar.SetText("삭제 권한이 없습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    return false;
                }


                string strExists = FN.GetRecordsetValue(string.Format(" SELECT COUNT(1) FROM [@KIS_SO01401_HRD] WHERE U_READCD = '{0}' ", oDB_M.GetValue("Code", 0).Trim()));
                if (int.Parse(strExists) > 0)
                {
                    B1Connections.theAppl.StatusBar.SetText("트랜젝션이 발생한 데이터는 삭제 할 수 없습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    return false;
                }

            }
            catch (Exception)
            {
                throw;
            }
            return true;
        }
示例#46
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act3_DefualtSetting(SAPbouiCOM.Form oForm, string pStrPFormUID, string pCODE)
        {

            try
            {

                //oForm.UniqueID + "_Deliver" = oForm.UniqueID + "_Deliver";
                //oForm.UniqueID + "_Call" = oForm.UniqueID + "_Call";

                oForm.DataSources.UserDataSources.Item("pFORMUID").Value = pStrPFormUID;

                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_ORIG").Specific;
                oMatrix.SelectionMode = BoMatrixSelect.ms_NotSupported;

                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_ORIG").Specific;
                oMatrix.SelectionMode = BoMatrixSelect.ms_NotSupported;

                // '// ADD YOUR ACTION CODE HERE ...
                //메트릭스 첫줄 선택시 팝업박스 뜨는것 막는다.
                oForm.Settings.EnableRowFormat = false;
                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_DUMY").Specific;
                oMatrix.SelectionMode = BoMatrixSelect.ms_NotSupported;

                // 지종
                FN.SetComboBoxValidValues(oMatrix, "U_PAPERTP", " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO01' ", FN.Enum_WholeTp.m_Nothing);

                // 독자구분
                FN.SetComboBoxValidValues(oMatrix, "U_READTP", " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO08'  ", FN.Enum_WholeTp.m_Nothing);

                // 배달 상태
                FN.SetComboBoxValidValues(oMatrix, "U_STATUS", " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO13' ", FN.Enum_WholeTp.m_Nothing);

                // 배달 가입방법
                FN.SetComboBoxValidValues(oMatrix, "U_METHOD", " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO14' ", FN.Enum_WholeTp.m_Nothing);

                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_DUMY").Specific;
                oMatrix.SelectionMode = BoMatrixSelect.ms_NotSupported;

                gCallTp_IDX = FN.GetColumnIndex(oMatrix, "U_CALLTP");
                gComment_IDX = FN.GetColumnIndex(oMatrix, "U_MEMO");

                // 콜유형
                FN.SetComboBoxValidValues(oMatrix, "U_CALLTP", " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO12' ", FN.Enum_WholeTp.m_Nothing);

                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                oDB1_O = oForm.DataSources.DBDataSources.Item("@KIS_SO00301_HRD");
                oDB2_O = oForm.DataSources.DBDataSources.Item("@KIS_SO00302_HRD");
                oDB1_Z = oForm.DataSources.DBDataSources.Item("@KIS_SO00301Z_HRD");
                oDB2_Z = oForm.DataSources.DBDataSources.Item("@KIS_SO00302Z_HRD");


                System.Data.DataTable dt_DELIVER = SetParameterDataTableSchema(oForm.UniqueID + "_Deliver");
                System.Data.DataTable dt_CALL = SetParameterDataTableSchema(oForm.UniqueID + "_Call");

                gDs.Tables.AddRange(new System.Data.DataTable[] { dt_DELIVER, dt_CALL });

                // 독자그룹
                FN.SetComboBoxValidValues(oForm, " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO03' ", "cboCATEGP1", FN.Enum_WholeTp.m_Space, "");
                FN.SetComboBoxValidValues(oForm, " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO04' ", "cboCATEGP2", FN.Enum_WholeTp.m_Space, "");
                FN.SetComboBoxValidValues(oForm, " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO05' ", "cboCATEGP3", FN.Enum_WholeTp.m_Space, "");
                FN.SetComboBoxValidValues(oForm, " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO06' ", "cboCATEGP4", FN.Enum_WholeTp.m_Space, "");

                //문서상태 : 테이블 기본값에 지정함

                //계산서발행 
                FN.SetComboBoxValidValues(oForm, " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO15' ", "cboVATGRUP", FN.Enum_WholeTp.m_Nothing);

                //은행
                FN.SetComboBoxValidValues(oForm, " SELECT  U_CD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO40' AND U_USEYN = 'Y' ", "cboBANKNM", FN.Enum_WholeTp.m_Space, "");

                //신용카드
                FN.SetComboBoxValidValues(oForm, " SELECT  U_CD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO52' AND U_USEYN = 'Y' ", "cboCREDTBP", FN.Enum_WholeTp.m_Space, "");

                // 지종 2014-08-27
                FN.SetComboBoxValidValues(oForm, " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO01' ", "cboPAPERCD", FN.Enum_WholeTp.m_Space, "");

                // 납부방법
                FN.SetComboBoxValidValues(oForm, " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO09' ", "cboPAY_TP1", FN.Enum_WholeTp.m_Space, "");
                FN.SetComboBoxValidValues(oForm, " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO09' ", "cboPAY_TP2", FN.Enum_WholeTp.m_Space, "");

                // 선납/후납
                FN.SetComboBoxValidValues(oForm, " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO10' ", "cboADVPOST", FN.Enum_WholeTp.m_Space, "");

                // 납부시기
                FN.SetComboBoxValidValues(oForm, " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO11' ", "cboPAYINST", FN.Enum_WholeTp.m_Space, "");

                // 배달상태
                FN.SetComboBoxValidValues(oForm, " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO13' ", "cboF_STATU", FN.Enum_WholeTp.m_Space, "");

                // 직업
                FN.SetComboBoxValidValues(oForm, " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO55' ", "cboJOB", FN.Enum_WholeTp.m_Space, "");


                // 신용카드인증키 발급구분
                FN.SetComboBoxValidValues(oForm, " SELECT  U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE Code = 'SO56' ", "cboCREDREQ", FN.Enum_WholeTp.m_Space, "");

                oForm.DataBrowser.BrowseBy = "DocEntry";
                if (SO.SO_COMMON_HRD.Authority == SO.SO_COMMON_HRD.AuthorityType.H_CallCenter)
                {
                    FN.SetAutoManagedAttribute(ref oForm, "cboPAY_TP1,btnCREATE,btnSTOP,edtSTOPDT,btnFIND,btnPAYMETH,edtCode,edtF_RDEPT,edtF_CENT,edtF_TEL,cboF_STATU,edtF_ADDR,cboSTATUS,edtSUMCNT,btnEMAIL", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False);
                }
                else
                {
                    FN.SetAutoManagedAttribute(ref oForm, "cboPAY_TP1,btnCREATE,btnSTOP,edtSTOPDT,btnFIND,btnPAYMETH,edtCode,edtF_RDEPT,edtF_CENT,edtF_TEL,cboF_STATU,edtF_ADDR,edtSUMCNT", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False);
                }

                FN.SetAutoManagedAttribute(ref oForm, "btnCREATE,btnPAYMETH", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True);
                FN.SetAutoManagedAttribute(ref oForm, "cboPAY_TP1,edtCode,edtCALLNM", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_True);
                FN.SetAutoManagedAttribute(ref oForm, "btnSTOP,edtSTOPDT,btnFIND,btnPAYMETH,edtF_RDEPT,edtF_CENT,edtF_TEL,cboF_STATU,edtF_ADDR,btnEMAIL", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True);

                FN.SetAffectsFormMode(ref oForm, "edtF_RDEPT,edtF_CENT,edtF_TEL,cboF_STATU,edtF_ADDR", false);

                gUserName = FN.GetRecordsetValue(string.Format(" SELECT U_NAME FROM OUSR WHERE USERID = '{0}' ", B1Connections.diCompany.UserSignature.ToString()));

                // 거래처
                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtCARDCD", "CardCode", BoFormItemTypes.it_EDIT);
                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtCARDNM", "CardName", BoFormItemTypes.it_EDIT);

                #region 콜센터담당자
                SAPbouiCOM.Conditions oCons = new Conditions();
                StringBuilder sb = new StringBuilder();
                sb.AppendLine(" SELECT STUFF ( (SELECT ',' + a.Code                    ");
                sb.AppendLine("                   FROM (SELECT DISTINCT Code           ");
                sb.AppendLine("                           FROM [@KIS_SO0010M_HRD]      ");
                sb.AppendLine("                          WHERE U_USERGBN = '20') AS a  ");
                sb.AppendLine("                 FOR XML PATH ( '' ))                   ");
                sb.AppendLine("             , 1                                        ");
                sb.AppendLine("             , 1                                        ");
                sb.AppendLine("             , '')                                      ");

                string strUserCode = FN.GetRecordsetValue(string.Format(sb.ToString(), B1Connections.diCompany.UserName));
                oCons = FN.GetConditionsWithQuery(string.Format("USER_CODE == {0}", strUserCode));

                #endregion

                // 콜센터담당자
                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_User).ToString(), "edtCALLPER", "USER_CODE", BoFormItemTypes.it_EDIT, oCons);
                oCons = null;

                // 주소
                //FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtADDR1", "CardCode", BoFormItemTypes.it_EDIT);
                //FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "edtADDR2", "CardName", BoFormItemTypes.it_EDIT);

                // 요금제 
                FN.SetChooseFromListAdd(oForm, "KIS_SO0050_HRD", "mtx1_DUMY", "Name", BoFormItemTypes.it_MATRIX, null, "U_PAYNM");


                // 유치자
                FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_Employee).ToString(), "mtx1_DUMY", "U_EMPNO", BoFormItemTypes.it_MATRIX, null, "U_SAILCD");

                //// 분국
                FN.SetChooseFromListAdd(oForm, "KIS_SO0330_HRD", "mtx1_DUMY", "Name", BoFormItemTypes.it_MATRIX, null, "U_CENTNM");



                // 메트릭스 주소 (2014.06.12 TAB 이벤트로 처리)
                //FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "mtx1_DUMY", "CardCode", BoFormItemTypes.it_MATRIX, null, "U_ADDR1");
                //FN.SetChooseFromListAdd(oForm, ((int)BoLinkedObject.lf_BusinessPartner).ToString(), "mtx1_DUMY", "CardCode", BoFormItemTypes.it_MATRIX, null, "U_ADDR2");


                //string strTable = "@KIS_HR0060M";
                //string strFields = "U_DEPTCD,U_DEPTNM";

                //// 관련 테이블 필드 체크
                //if (!FN.GetUserFieldExists(strTable, strFields))
                //    throw new Exception(string.Format("독자관리에 필요한[{0}.{1}] 필드가 생성되지 않았습니다.", strTable, strFields));

                SetGridTitle(oForm);

                if (string.IsNullOrEmpty(SO.SO_COMMON_HRD.KeyValue) == false)
                {
                    GetDataLoad(oForm, SO.SO_COMMON_HRD.KeyValue);
                    SO.SO_COMMON_HRD.KeyValue = null;

                    // 청구데이터를 조회한다.
                    FindRequestData(oForm);

                    // 선수금잔액 조회
                    GetAdvanceAmt(oForm);
                }

                oForm.Items.Item("fld02").Click(BoCellClickType.ct_Regular);

            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                SO.SO_COMMON_HRD.KeyValue = null;
            }
        }
示例#47
0
        public virtual void ET_mtx2_DUMY_AFDoubleClick(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx2_DUMY").Specific));
            // ADD YOUR ACTION CODE HERE ...
            string sTYPE = "";
            try
            {
                if (pVal.Row != 0)
                {
                    //접수자ID 와 로그인 ID 가 다를경우 접수내용 수정 불가
                    oMatrix.FlushToDataSource();

                    if ((oMatrix.GetCellSpecific("U_RECVID", pVal.Row).Value.Trim() == B1Connections.diCompany.UserName.ToString()) && (sFindTY == "F"))
                    { sTYPE = "TRUE"; }
                    else { sTYPE = "FASLE"; }

                    oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                    string extCOM = ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("U_MEMO", pVal.Row)).Value.Trim();
                    string strChildFormID = oForm.DataSources.UserDataSources.Item("cFORMUID2").Value;
                    if (!FN.GetFormExistsChk(strChildFormID))
                    {
                        KIS_SO0033A_HRD SO0033A_HRD = new KIS_SO0033A_HRD();
                        SO0033A_HRD.A00_SubFormInit(oForm.UniqueID, pVal.Row, extCOM, "접수내용", "CallBack", sTYPE);
                        SO0033A_HRD = null;
                    }
                    else
                    {
                        SAPbouiCOM.Form pForm = pForm = B1Connections.theAppl.Forms.Item(strChildFormID);
                        KIS_SO0033A_HRD.extSetting(pForm, extCOM, pVal.Row);
                        pForm.Select();
                        pForm = null;
                    }
                }

            }
            catch (Exception)
            {
                throw;
            }
        }
示例#48
0
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            Int32 i;

            //SAPbouiCOM.EditTextColumn oEditText;
            SAPbouiCOM.CommonSetting oSetting;
            TFunctions Reg;
            bool       Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings);

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

                Lista = new List <string>();

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

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

                //oForm.DataBrowser.BrowseBy := "Code";
                oDBDSH = oForm.DataSources.DBDataSources.Item("@VID_FESUC");

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

                //oCombo := ComboBox(oForm.Items.Item('TipDoc').Specific);
                //oCombo.ValidValues.Add('33', 'Factura');

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

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

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select Code, Name, ISNULL(U_Habilitada,'Y') 'Habilitada' from [@VID_FESUC]";
                }
                else
                {
                    s = @"select ""Code"", ""Name"", IFNULL(""U_Habilitada"",'Y') ""Habilitada"" from ""@VID_FESUC"" ";
                }
                oRecordSet.DoQuery(s);
                if (oRecordSet.RecordCount == 0)
                {
                    if (GlobalSettings.RunningUnderSQLServer)
                    {
                        s = "select Code from [@VID_FESUC] where Code = 'Principal'";
                    }
                    else
                    {
                        s = @"select ""Code"" from ""@VID_FESUC"" where ""Code"" = 'Principal' ";
                    }
                    oRecordSet.DoQuery(s);
                    if (oRecordSet.RecordCount == 0)
                    {
                        Reg       = new TFunctions();
                        Reg.SBO_f = FSBOf;
                        oDBDSH.Clear();
                        oDBDSH.InsertRecord(0);
                        oDBDSH.SetValue("Code", 0, "Principal");
                        oDBDSH.SetValue("Name", 0, "SAP BO");
                        oDBDSH.SetValue("U_Habilitada", 0, "Y");
                        if (Reg.FESUCAdd(oDBDSH) == true)
                        {
                            FSBOApp.StatusBar.SetText("Sucursal Principal creada correctamente", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success);
                        }
                        else
                        {
                            FSBOApp.StatusBar.SetText("Sucursal Principal no ha sido creada", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                        }
                    }
                }

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select Code, Name, ISNULL(U_Habilitada,'Y') 'Habilitada' from [@VID_FESUC]";
                }
                else
                {
                    s = @"select ""Code"", ""Name"", IFNULL(""U_Habilitada"",'Y') ""Habilitada"" from ""@VID_FESUC"" ";
                }
                oRecordSet.DoQuery(s);
                i = 0;
                oDBDSH.Clear();
                while (!oRecordSet.EoF)
                {
                    oDBDSH.InsertRecord(i);
                    oDBDSH.SetValue("Code", i, (System.String)(oRecordSet.Fields.Item("Code").Value));
                    oDBDSH.SetValue("Name", i, (System.String)(oRecordSet.Fields.Item("Name").Value));
                    oDBDSH.SetValue("U_Habilitada", i, (System.String)(oRecordSet.Fields.Item("Habilitada").Value));
                    oRecordSet.MoveNext();
                    i++;
                }

                oDBDSH.InsertRecord(i);
                oDBDSH.SetValue("Code", i, "");
                oDBDSH.SetValue("Name", i, "");
                oDBDSH.SetValue("U_Habilitada", i, "Y");

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select FldValue 'Code', Descr 'Name' from UFD1 where TableID = '@VID_FESUC' and FieldID = 0";
                }
                else
                {
                    s = @"select ""FldValue"" ""Code"", ""Descr"" ""Name"" from ""UFD1"" where ""TableID"" = '@VID_FESUC' and ""FieldID"" = 0";
                }
                oRecordSet.DoQuery(s);
                oColumn = (SAPbouiCOM.Column)(oMtx.Columns.Item("Habilitada"));
                FSBOf.FillComboMtx(oColumn, ref oRecordSet, false);

                //EditText(oForm.Items.Item('CardCode').Specific).Active := True;
                oMtx.LoadFromDataSource();

                oSetting = oMtx.CommonSetting;
                i        = 1;
                while (i <= oMtx.RowCount)
                {
                    if ((System.String)(oDBDSH.GetValue("Code", i - 1)).Trim() != "")
                    {
                        oSetting.SetCellEditable(i, 1, false);
                    }
                    i++;
                }

                oForm.Mode = BoFormMode.fm_OK_MODE;
                oMtx.AutoResizeColumns();
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            oForm.Freeze(false);
            return(Result);
        }//fin InitForm
示例#49
0
 /// <summary>
 /// 데이터 있을때 패드워드타입, 없을때 일반 EditText 타입으로 변환
 /// </summary>
 /// <param name="oForm"></param>
 private void SetCreditKey_ItemAttribute(SAPbouiCOM.Form oForm)
 {
     try
     {
         SAPbouiCOM.EditText oEditText = oForm.Items.Item("edtCREDKEY").Specific;
         string strCreditKey = string.Empty;
         oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
         if (oDB_M.Size > 0)
         {
             strCreditKey = oDB_M.GetValue("U_CREDKEY", 0).Trim();
             if (string.IsNullOrEmpty(strCreditKey))
                 oEditText.IsPassword = false;
             else
                 oEditText.IsPassword = true;
         }
         else
         {
             oEditText.IsPassword = false;
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#50
0
        /// <summary>
        /// Metodo para buscar lineas en la matriz comparando los valores con la lista para marcar o no el checkbox
        /// </summary>
        /// <param name="pObjMatrix"></param>
        /// <param name="pLstTicketDetail"></param>
        /// <param name="pDBDataSourceD"></param>
        /// <returns></returns>
        public SAPbouiCOM.DBDataSource SetCheckbox2(SAPbouiCOM.IMatrix pObjMatrix, IList <TicketDetail> pLstTicketDetail, SAPbouiCOM.DBDataSource pDBDataSourceD)
        {
            SAPbouiCOM.CommonSetting lObjRowCtrl;
            lObjRowCtrl = pObjMatrix.CommonSetting;

            for (int i = 1; i <= pObjMatrix.RowCount; i++)
            {
                string l  = ((SAPbouiCOM.EditText)pObjMatrix.Columns.Item("ItemCode").Cells.Item(i).Specific).Value;
                double xe = Convert.ToDouble(((SAPbouiCOM.EditText)pObjMatrix.Columns.Item("PesoN").Cells.Item(i).Specific).Value);
                foreach (var item in pLstTicketDetail.Where(x => x.Item == l && x.netWeight == xe))
                {
                    if (item.WeighingM == 1)
                    {
                        ((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(i).Specific).Checked = true;
                        lObjRowCtrl.SetCellEditable(i, 5, true);
                        pDBDataSourceD.SetValue("TreeType", i - 1, "Y");
                    }
                    else
                    {
                        ((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(i).Specific).Checked = false;
                        pDBDataSourceD.SetValue("TreeType", i - 1, "N");
                    }
                }
            }



            //for (int i = 1; i <= pObjMatrix.RowCount; i++)
            //{
            //    if (pLstTicketDetail[i - 1].WeighingM == 1)
            //    {
            //        ((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(i).Specific).Checked = true;
            //        pDBDataSourceD.SetValue("TreeType", i - 1, "Y");
            //    }
            //    else
            //    {
            //        ((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(i).Specific).Checked = false;
            //        pDBDataSourceD.SetValue("TreeType", i - 1, "N");
            //    }

            //}
            return(pDBDataSourceD);
        }
示例#51
0
        private void SetSystemDataTable(SAPbouiCOM.Form oForm)
        {
            try
            {     
                oDB1_O = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO00301_HRD");
                oDB2_O = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO00302_HRD");

                oDB1_Z = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO00301Z_HRD");
                oDB1_Z.Clear();
                             
                //if (gDs.Tables[oForm.UniqueID + "_Deliver"] != null)
                //    gDs.Tables[oForm.UniqueID + "_Deliver"].Clear();
                //else
                //    gDs.Tables[oForm.UniqueID + "_Deliver"] = SetParameterDataTableSchema(oForm.UniqueID+"Deliver");

                if (gDs.Tables.Contains(oForm.UniqueID + "_Deliver"))
                {
                    gDs.Tables[oForm.UniqueID + "_Deliver"].Rows.Clear();
                }
                else
                {
                    System.Data.DataTable dt = SetParameterDataTableSchema(oForm.UniqueID + "_Deliver");
                    gDs.Tables.Add(dt);
                }
                if (oDB1_O.Size > 0 && oDB1_O.GetValue("U_DELVCD", 0).ToString().Trim() != "")
                {

                    for (int i = 0; i < oDB1_O.Size; i++)
                    {
                        System.Data.DataRow dr;

                        // 데이터 필터를 위해 DataTable에 담는다.
                        dr = gDs.Tables[oForm.UniqueID + "_Deliver"].NewRow();

                        dr["IDX"] = i; // "DataTable 고유ID"
                        dr["LINEID"] = oDB1_O.GetValue("LineId", i);//"원본라인번호";
                        dr["DELVCD"] = oDB1_O.GetValue("U_DELVCD", i).Trim(); //"배달코드";
                        dr["RDEPT"] = oDB1_O.GetValue("U_RDEPT", i).Trim(); //"부서";
                        dr["PAPERTP"] = oDB1_O.GetValue("U_PAPERTP", i).Trim(); //"지종";
                        dr["PAYCD"] = oDB1_O.GetValue("U_PAYCD", i).Trim(); //"요금제코드";
                        dr["PAYNM"] = oDB1_O.GetValue("U_PAYNM", i).Trim(); //"요금제명";
                        dr["TEL"] = oDB1_O.GetValue("U_TEL", i).Trim(); //"연락처";
                        dr["MOBILE"] = oDB1_O.GetValue("U_MOBILE", i).Trim(); //"휴대폰";
                        dr["ADDR1"] = oDB1_O.GetValue("U_ADDR1", i).Trim(); //"주소1";
                        dr["ADDR2"] = oDB1_O.GetValue("U_ADDR2", i).Trim(); //"주소2";
                        dr["ADDR1_D"] = oDB1_O.GetValue("U_ADDR1_D", i).Trim(); //"주소1상세";
                        dr["ADDR2_D"] = oDB1_O.GetValue("U_ADDR2_D", i).Trim(); //"주소2상세";
                        dr["CENTCD"] = oDB1_O.GetValue("U_CENTCD", i).Trim(); //"지국";
                        dr["CENTNM"] = oDB1_O.GetValue("U_CENTNM", i).Trim(); //"지국명";
                        dr["DELVFR"] = oDB1_O.GetValue("U_DELVFR", i).Trim(); //"배달시작일";
                        dr["DELVTO"] = oDB1_O.GetValue("U_DELVTO", i).Trim(); //"배달종료일";
                        dr["DELVCNT"] = oDB1_O.GetValue("U_DELVCNT", i).Trim(); //"배달부수";
                        dr["METHOD"] = oDB1_O.GetValue("U_METHOD", i).Trim(); //"가입방법";
                        dr["SAILCD"] = oDB1_O.GetValue("U_SAILCD", i).Trim(); //"유치자";
                        dr["SAILNM"] = oDB1_O.GetValue("U_SAILNM", i).Trim(); //"유치자";
                        dr["STATUS"] = oDB1_O.GetValue("U_STATUS", i).Trim(); //"배달상태";
                        dr["SDEPT"] = oDB1_O.GetValue("U_SDEPT", i).Trim(); //"유치부서";
                        dr["NOTE"] = oDB1_O.GetValue("U_NOTE", i).Trim(); //"배달상세";

                        dr["JOINDT"] = oDB1_O.GetValue("U_JOINDT", i).Trim(); //"가입일자";
                        dr["CLOSEDT"] = oDB1_O.GetValue("U_CLOSEDT", i).Trim(); //"해지일자";
                        dr["USERSG1"] = oDB1_O.GetValue("U_USERSG1", i).Trim(); //"등록자";
                        dr["READTP"] = oDB1_O.GetValue("U_READTP", i).Trim(); //"독자구분";

                        dr["BTEL1"] = oDB1_O.GetValue("U_BTEL1", i).Trim(); //"분국전화1";
                        dr["BTEL2"] = oDB1_O.GetValue("U_BTEL2", i).Trim(); //"분국전화1";

                        dr["ROWSTATE"] = ""; // 기본: "", 수정: M, 신규: I, 삭제: D 
                        gDs.Tables[oForm.UniqueID + "_Deliver"].Rows.Add(dr);


                        oDB1_Z.InsertRecord(i);

                        oDB1_Z.SetValue("U_NO", i, (i + 1).ToString());//"번호";
                        oDB1_Z.SetValue("U_IDX", i, (i).ToString());//"DataTable 고유ID";
                        oDB1_Z.SetValue("LineId", i, oDB1_O.GetValue("LineId", i));//"원본라인번호";
                        oDB1_Z.SetValue("U_DELVCD", i, oDB1_O.GetValue("U_DELVCD", i).Trim()); //"배달코드";
                        oDB1_Z.SetValue("U_RDEPT", i, oDB1_O.GetValue("U_RDEPT", i).Trim()); //"부서";
                        oDB1_Z.SetValue("U_PAPERTP", i, oDB1_O.GetValue("U_PAPERTP", i).Trim()); //"지종";
                        oDB1_Z.SetValue("U_PAYCD", i, oDB1_O.GetValue("U_PAYCD", i).Trim()); //"요금제코드";
                        oDB1_Z.SetValue("U_PAYNM", i, oDB1_O.GetValue("U_PAYNM", i).Trim()); //"요금제명";
                        oDB1_Z.SetValue("U_TEL", i, oDB1_O.GetValue("U_TEL", i).Trim()); //"연락처";
                        oDB1_Z.SetValue("U_MOBILE", i, oDB1_O.GetValue("U_MOBILE", i).Trim()); //"휴대폰";
                        oDB1_Z.SetValue("U_ADDR1", i, oDB1_O.GetValue("U_ADDR1", i).Trim()); //"주소1";
                        oDB1_Z.SetValue("U_ADDR2", i, oDB1_O.GetValue("U_ADDR2", i).Trim()); //"주소2";
                        oDB1_Z.SetValue("U_ADDR1_D", i, oDB1_O.GetValue("U_ADDR1_D", i).Trim()); //"주소1";
                        oDB1_Z.SetValue("U_ADDR2_D", i, oDB1_O.GetValue("U_ADDR2_D", i).Trim()); //"주소2";
                        oDB1_Z.SetValue("U_CENTCD", i, oDB1_O.GetValue("U_CENTCD", i).Trim()); //"지국";
                        oDB1_Z.SetValue("U_CENTNM", i, oDB1_O.GetValue("U_CENTNM", i).Trim()); //"지국명";
                        oDB1_Z.SetValue("U_DELVFR", i, oDB1_O.GetValue("U_DELVFR", i).Trim()); //"배달시작일";
                        oDB1_Z.SetValue("U_DELVTO", i, oDB1_O.GetValue("U_DELVTO", i).Trim()); //"배달종료일";
                        oDB1_Z.SetValue("U_DELVCNT", i, oDB1_O.GetValue("U_DELVCNT", i).Trim()); //"배달부수";
                        oDB1_Z.SetValue("U_METHOD", i, oDB1_O.GetValue("U_METHOD", i).Trim()); //"가입방법";
                        oDB1_Z.SetValue("U_SAILCD", i, oDB1_O.GetValue("U_SAILCD", i).Trim()); //"유치자";
                        oDB1_Z.SetValue("U_SAILNM", i, oDB1_O.GetValue("U_SAILNM", i).Trim()); //"유치자";
                        oDB1_Z.SetValue("U_STATUS", i, oDB1_O.GetValue("U_STATUS", i).Trim()); //"배달상태";
                        oDB1_Z.SetValue("U_SDEPT", i, oDB1_O.GetValue("U_SDEPT", i).Trim()); //"유치부서";
                        oDB1_Z.SetValue("U_NOTE", i, oDB1_O.GetValue("U_NOTE", i).Trim()); //"배달상세";

                        oDB1_Z.SetValue("U_JOINDT", i, oDB1_O.GetValue("U_JOINDT", i).Trim()); //"가입일자";
                        oDB1_Z.SetValue("U_CLOSEDT", i, oDB1_O.GetValue("U_CLOSEDT", i).Trim()); //"해지일자";
                        oDB1_Z.SetValue("U_USERSG1", i, oDB1_O.GetValue("U_USERSG1", i).Trim()); //"등록자";
                        oDB1_Z.SetValue("U_READTP", i, oDB1_O.GetValue("U_READTP", i).Trim()); //"등록자";     

                        oDB1_Z.SetValue("U_BTEL1", i, oDB1_O.GetValue("U_BTEL1", i).Trim()); //"분국전화1";
                        oDB1_Z.SetValue("U_BTEL2", i, oDB1_O.GetValue("U_BTEL2", i).Trim()); //"분국전화2";    
                    }
                }

                //if (gDs.Tables[oForm.UniqueID + "_Call"] != null)
                //    gDs.Tables[oForm.UniqueID + "_Call"].Clear();
                //else
                //    gDs.Tables[oForm.UniqueID + "_Call"] = SetParameterDataTableSchema(oForm.UniqueID+"Call");
                if (gDs.Tables.Contains(oForm.UniqueID + "_Call"))
                {
                    gDs.Tables[oForm.UniqueID + "_Call"].Rows.Clear();
                }
                else
                {
                    System.Data.DataTable dt = SetParameterDataTableSchema(oForm.UniqueID + "_Call");
                    gDs.Tables.Add(dt);
                }

                if (oDB2_O.Size > 0 && oDB2_O.GetValue("U_DELVCD", 0).ToString().Trim() != "")
                {
                    for (int i = 0; i < oDB2_O.Size; i++)
                    {
                        System.Data.DataRow dr;

                        // 데이터 필터를 위해 DataTable에 담는다.
                        dr = gDs.Tables[oForm.UniqueID + "_Call"].NewRow();
                        dr["IDX"] = i; //"DataTable 고유ID";
                        dr["LINEID"] = oDB2_O.GetValue("LineId", i);//"원본라인번호";
                        dr["DELVCD"] = oDB2_O.GetValue("U_DELVCD", i).Trim(); //"배달코드"
                        dr["CALLTP"] = oDB2_O.GetValue("U_CALLTP", i).Trim(); //"콜유형"
                        dr["MEMO"] = oDB2_O.GetValue("U_MEMO", i).Trim(); //"접수내용"
                        dr["RECVID"] = oDB2_O.GetValue("U_RECVID", i).Trim(); //"접수자ID"
                        dr["RECVNM"] = oDB2_O.GetValue("U_RECVNM", i).Trim(); //"접수자명"
                        dr["RECVDT"] = oDB2_O.GetValue("U_RECVDT", i).Trim(); //"접수일자"
                        dr["RECVTI"] = oDB2_O.GetValue("U_RECVTI", i).Trim(); //"접수시간"
                        dr["RECVTI"] = oDB2_O.GetValue("U_RECVTI", i).Trim(); //"접수시간"
                        dr["PROCID"] = oDB2_O.GetValue("U_PROCID", i).Trim(); //"처리자ID"
                        dr["PROCNM"] = oDB2_O.GetValue("U_PROCNM", i).Trim(); //"처리자명"
                        dr["PROCDT"] = oDB2_O.GetValue("U_PROCDT", i).Trim(); //"처리일자"
                        dr["PROSTAT"] = oDB2_O.GetValue("U_PROSTAT", i).Trim(); //"처리상태"
                        dr["ROWSTATE"] = ""; // 기본: "", 수정: M, 신규: I, 삭제: D 
                        gDs.Tables[oForm.UniqueID + "_Call"].Rows.Add(dr);
                    }
                }
                //else
                //{
                //    gDs.Tables[oForm.UniqueID + "_Call"].Rows.Clear();
                //}


                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_DUMY").Specific;
                oMatrix.LoadFromDataSource();

                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_DUMY").Specific;
                oMatrix.Clear();
                //oMatrix.LoadFromDataSource();

                // 데이터 로드하면 메트릭스 선택된행 값 초기화 함.(중요)
                gDeliverySelect = -1;
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#52
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;
            }
        }
示例#53
0
        //Pone el checkbox en Verdadero o falso
        public SAPbouiCOM.DBDataSource SetCheckbox(SAPbouiCOM.IMatrix pObjMatrix, IList <TicketDetail> pLstTicketDetail, SAPbouiCOM.DBDataSource pDBDataSourceD)
        {
            SAPbouiCOM.CommonSetting lObjRowCtrl;
            lObjRowCtrl = pObjMatrix.CommonSetting;

            for (int i = 1; i <= pObjMatrix.RowCount; i++)
            {
                if (pLstTicketDetail[i - 1].WeighingM == 1)
                {
                    ((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(i).Specific).Checked = true;
                    lObjRowCtrl.SetCellEditable(i, 5, true);
                    pDBDataSourceD.SetValue("TreeType", i - 1, "Y");
                }
                else
                {
                    ((SAPbouiCOM.CheckBox)pObjMatrix.Columns.Item("Check").Cells.Item(i).Specific).Checked = false;
                    pDBDataSourceD.SetValue("TreeType", i - 1, "N");
                }
            }
            return(pDBDataSourceD);
        }
        public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings)
        {
            Int32      i;
            TFunctions Param;

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

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

                Lista = new List <string>();

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

                VID_DelRow   = false;
                VID_DelRowOK = false;

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

                //oForm.DataBrowser.BrowseBy := "DocEntry";
                oDBDSH = oForm.DataSources.DBDataSources.Item("@VID_FEMULTISOC");
                //oDBDSBases := oForm.DataSources.DBDataSources.Item("@VID_FEMULTISOC");

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

                oMtx = (Matrix)(oForm.Items.Item("mtx").Specific);

                oMtx.AutoResizeColumns();
                //EditText(oForm.Items.Item('CardCode').Specific).Active := True;

                if (GlobalSettings.RunningUnderSQLServer)
                {
                    s = @"select U_Sociedad
                              ,U_RUT 
                              ,U_Servidor
                              ,U_Base
	                          ,U_Usuario
	                          ,U_Password
	                          ,DocEntry
	                          ,U_Habilitada
                          from [@VID_FEMULTISOC]";
                }
                else
                {
                    s = @"select ""U_Sociedad""
                              ,""U_RUT""
                              ,""U_Servidor""
                              ,""U_Base""
	                          ,""U_Usuario""
	                          ,""U_Password""
	                          ,""DocEntry""
	                          ,""U_Habilitada""
                          from ""@VID_FEMULTISOC"" ";
                }
                oRecordSet.DoQuery(s);

                if (oRecordSet.RecordCount == 0)
                {
                    oMtx.AddRow(1, 1);
                    oMtx.FlushToDataSource();
                    oMtx.AutoResizeColumns();
                }
                else
                {
                    i = 0;
                    oDBDSH.Clear();
                    while (!oRecordSet.EoF)
                    {
                        oDBDSH.InsertRecord(i);
                        oDBDSH.SetValue("U_Sociedad", i, (System.String)(oRecordSet.Fields.Item("U_Sociedad").Value));
                        oDBDSH.SetValue("U_RUT", i, (System.String)(oRecordSet.Fields.Item("U_RUT").Value));
                        oDBDSH.SetValue("U_Servidor", i, (System.String)(oRecordSet.Fields.Item("U_Servidor").Value));
                        oDBDSH.SetValue("U_Base", i, (System.String)(oRecordSet.Fields.Item("U_Base").Value));

                        oDBDSH.SetValue("U_Usuario", i, (System.String)(oRecordSet.Fields.Item("U_Usuario").Value));
                        //s = Param.DesEncriptar((System.String)(oRecordSet.Fields.Item("U_Password").Value).ToString().Trim());
                        oDBDSH.SetValue("U_Password", i, (System.String)(oRecordSet.Fields.Item("U_Password").Value));

                        oDBDSH.SetValue("DocEntry", i, Convert.ToString((System.Int32)(oRecordSet.Fields.Item("DocEntry").Value)));
                        oDBDSH.SetValue("U_Habilitada", i, (System.String)(oRecordSet.Fields.Item("U_Habilitada").Value));
                        i++;
                        oRecordSet.MoveNext();
                    }
                    oDBDSH.InsertRecord(i);
                    oMtx.LoadFromDataSource();
                    oMtx.AutoResizeColumns();
                }



                oForm.Mode = BoFormMode.fm_OK_MODE;
            }
            catch (Exception e)
            {
                OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
            }
            oForm.Freeze(false);
            return(Result);
        }//fin InitForm
示例#55
0
        // 데이터 저장후 LineId 값을 DataTabel에 적용한다.
        private bool DbDataSourceToDataTable(SAPbouiCOM.Form oForm)
        {
            bool rtnValue = true;
            System.Data.DataRow[] findRows = null;
            int idx = 0;
            try
            {

                //삭제상태인 데이터 삭제
                //DataTableDeleteRows("D");


                oDB1_O = oForm.DataSources.DBDataSources.Item("@KIS_SO00301_HRD");
                oDB2_O = oForm.DataSources.DBDataSources.Item("@KIS_SO00302_HRD");

                // 1. 배송리스트
                findRows = gDs.Tables[oForm.UniqueID + "_Deliver"].Select(" ROWSTATE = 'I' OR ROWSTATE = 'M' ", "");
                foreach (System.Data.DataRow dr in findRows)
                {
                    idx = int.Parse(dr["IDX"].ToString());
                    // 라인ID 적용
                    //gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["LINEID"] = oDB1_O.GetValue("LineId", idx).ToString();

                    // 상태값 초기화
                    gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[idx]["ROWSTATE"] = "";
                }


                // 2. 상담리스트
                findRows = gDs.Tables[oForm.UniqueID + "_Call"].Select(" ROWSTATE = 'I' OR ROWSTATE = 'M' ", "");
                foreach (System.Data.DataRow dr in findRows)
                {
                    idx = int.Parse(dr["IDX"].ToString());
                    // 라인ID 적용
                    gDs.Tables[oForm.UniqueID + "_Call"].Rows[idx]["LINEID"] = oDB2_O.GetValue("LineId", idx).ToString();

                    // 상태값 초기화
                    gDs.Tables[oForm.UniqueID + "_Call"].Rows[idx]["ROWSTATE"] = "";
                }
            }
            catch (Exception)
            {
                rtnValue = false;
                throw;
            }
            finally
            {
                findRows = null;
            }
            return rtnValue;
        }
示例#56
0
        public static void clsSalesOrder_ItemEvent(ref SAPbouiCOM.Application oApplication, ref SAPbobsCOM.Company oCompany, SAPbouiCOM.Form oSetupForm, ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent)
        {
            oForm            = oSetupForm;
            oHDBDataSource   = oForm.DataSources.DBDataSources.Item("ORDR");
            oChildDataSource = oForm.DataSources.DBDataSources.Item("RDR1");
            oMatrix          = (SAPbouiCOM.Matrix)oForm.Items.Item("38").Specific;

            if (pVal.BeforeAction)
            {
                switch (pVal.EventType)
                {
                case SAPbouiCOM.BoEventTypes.et_CLICK:
                    if (pVal.ItemUID == "38" && (pVal.ColUID == "U_Variance" || pVal.ColUID == "U_DiscExc"))
                    {
                        BubbleEvent = false;
                    }
                    if (oForm.Mode == SAPbouiCOM.BoFormMode.fm_OK_MODE || oForm.Mode == SAPbouiCOM.BoFormMode.fm_UPDATE_MODE)
                    {
                        if (pVal.ItemUID == "U_DocType")
                        {
                            BubbleEvent = false;
                        }
                    }
                    break;

                case SAPbouiCOM.BoEventTypes.et_PICKER_CLICKED:
                    if (pVal.ItemUID == "38" && pVal.ColUID == "U_Variance")
                    {
                        BubbleEvent = false;
                    }
                    break;

                case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED:
                    if (pVal.ItemUID == "btnSH")
                    {
                        if (((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim() == "")
                        {
                            oApplication.StatusBar.SetText("Select the Customer....", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                            BubbleEvent = false;
                        }

                        if (oHDBDataSource.GetValue("DocStatus", oHDBDataSource.Offset).ToString().Trim() != "O")
                        {
                            BubbleEvent = false;
                        }
                        // strDocEntry = oHDBDataSource.GetValue("DocEntry", 0).Trim();
                        //strDocType = oHDBDataSource.GetValue("U_DocType", 0).Trim();
                    }
                    break;


                default:
                    break;
                }
            }
            else if (pVal.BeforeAction == false)
            {
                switch (pVal.EventType)
                {
                case SAPbouiCOM.BoEventTypes.et_FORM_LOAD:
                    //Utilities.UtilitiesCls.CreateButtonItem(oForm, "btnSH", oForm.Items.Item("2").Left + oForm.Items.Item("2").Width + 6, oForm.Items.Item("2").Top, oForm.Items.Item("2").Width, oForm.Items.Item("2").Height, "Sales History", true, 0, "");
                    Utilities.UtilitiesCls.CreateButtonItem(oForm, "btnSH", oForm.Items.Item("46").Left, oForm.Items.Item("46").Top + 20, oForm.Items.Item("46").Width, oForm.Items.Item("2").Height, "Sales History", true, 0, "46");
                    ColsFromHistory = new List <string> {
                        "1", "11", "14", "1470002145"
                    };
                    break;

                case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED:
                    if (pVal.ItemUID == "1")
                    {
                        if (oForm.Mode != BoFormMode.fm_FIND_MODE)
                        {
                            if (pVal.ActionSuccess)
                            {
                                if (oWaitForm != null)
                                {
                                    try
                                    {
                                        oWaitForm.Close();
                                    }
                                    catch (Exception ex)
                                    {
                                    }
                                    oWaitForm = null;
                                }
                            }
                        }
                    }

                    if (pVal.ItemUID == "btnSH")
                    {
                        try
                        {
                            oWaitForm.Close();
                            oWaitForm = null;
                        }
                        catch
                        {
                        }
                        try
                        {
                            if (oWaitForm != null)
                            {
                                string strCardCode1 = ((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim();
                                string strCardCode2 = ((SAPbouiCOM.EditText)oWaitForm.Items.Item("6").Specific).Value.Trim();

                                if (strCardCode1 != strCardCode2)
                                {
                                    try
                                    {
                                        oWaitForm.Close();
                                    }
                                    catch (Exception ex)
                                    {
                                    }
                                    oWaitForm = null;
                                }
                            }
                        }
                        catch (Exception)
                        {
                            oWaitForm = null;
                        }

                        if (oWaitForm == null)
                        {
                            string strQry;
                            oWaitForm = clsSBO.LoadForm("EJ_OCSH.srf", "EJ_OCSH", oApplication);
                            try
                            {
                                oWaitForm.Settings.MatrixUID = "4";
                                oWaitForm.Settings.Enabled   = true;
                            }
                            catch { }

                            oWaitForm.State = BoFormStateEnum.fs_Maximized;

                            ((SAPbouiCOM.EditText)oWaitForm.Items.Item("6").Specific).Value = ((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim();
                            ((SAPbouiCOM.EditText)oWaitForm.Items.Item("8").Specific).Value = ((SAPbouiCOM.EditText)oForm.Items.Item("54").Specific).Value.Trim();
                            oWaitForm.Freeze(true);
                            oWaitForm.DataSources.DataTables.Add("@dtTemp");
                            SAPbouiCOM.Grid oGrid;
                            oGrid = (SAPbouiCOM.Grid)oWaitForm.Items.Item("4").Specific;

                            oRecordSet = (SAPbobsCOM.Recordset)oCompany.GetBusinessObject(BoObjectTypes.BoRecordset);

                            strQry = "EXEC dbo.EJ_CustomerSalesHistory  '" + ((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim() + "','" + ((SAPbouiCOM.EditText)oForm.Items.Item("8").Specific).Value.Trim() + "'";
                            System.Data.DataTable dtHistory = clsSBO.getDataTable(strQry, "History", oCompany);
                            oWaitForm.DataSources.DataTables.Item(0).ExecuteQuery(strQry);


                            oGrid.DataTable = oWaitForm.DataSources.DataTables.Item(0);
                            string strCardCode = ((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim();
                            int    i           = 0;
                            //foreach (System.Data.DataRow dr in dtHistory.Rows)
                            //{
                            //    try
                            //    {
                            //        if (dr["ItemCode"].ToString() != "")
                            //        {
                            //            SAPbobsCOM.ItemPriceReturnParams itemPrice = clsSBO.getUnitPriceSys(oCompany,dr["ItemCode"].ToString().Trim(), strCardCode , 1, DateTime.Now.Date, dr["UoM"].ToString().Trim());
                            //            oGrid.DataTable.SetValue("Current Selling Price", i, itemPrice.Price);
                            //            i++;
                            //        }
                            //    }
                            //    catch { }

                            //}

                            oGrid.Columns.Item(0).Editable = true;
                            SAPbouiCOM.EditTextColumn oEditTxt = ((SAPbouiCOM.EditTextColumn)oGrid.Columns.Item(0));
                            oEditTxt.ChooseFromListUID     = "CFL_2";
                            oEditTxt.ChooseFromListAlias   = "ItemCode";
                            oGrid.Columns.Item(1).Editable = false;
                            string showName = clsSBO.getColVisibility("EJ_OCSH", "ItemName", oCompany.UserName, oCompany);
                            if (showName == "N")
                            {
                                oGrid.Columns.Item(1).Visible = false;
                            }

                            oGrid.Columns.Item(2).Editable = true;
                            oGrid.Columns.Item(3).Editable = true;
                            oEditTxt = ((SAPbouiCOM.EditTextColumn)oGrid.Columns.Item(3));
                            oEditTxt.ChooseFromListUID     = "CFL_3";
                            oEditTxt.ChooseFromListAlias   = "UomCode";
                            oGrid.Columns.Item(4).Editable = true;


                            for (int j = 5; j < oGrid.Columns.Count; j++)
                            {
                                oGrid.Columns.Item(j).Editable = false;
                            }
                            oGrid.Columns.Item(1).Editable = false;
                            oGrid.Columns.Item(0).Editable = true;

                            oGrid.AutoResizeColumns();
                            oGrid.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Auto;
                            oGrid.DataTable.Rows.Add(1);

                            clsCustomerSalesHistory.oForm        = oWaitForm;
                            clsCustomerSalesHistory.oSOForm      = oForm;
                            clsCustomerSalesHistory.ORDR         = oForm.DataSources.DBDataSources.Item("ORDR");
                            clsCustomerSalesHistory.cardCode     = ((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim();
                            clsCustomerSalesHistory.oCompany     = oCompany;
                            clsCustomerSalesHistory.oApplication = oApplication;
                            clsCustomerSalesHistory.isAdding     = oForm.Mode == BoFormMode.fm_ADD_MODE ? true : false;
                            clsCustomerSalesHistory.CallingForm  = "SO";
                            clsCustomerSalesHistory.myDocNum     = Convert.ToInt32(((SAPbouiCOM.EditText)oForm.Items.Item("8").Specific).Value.Trim());
                            oWaitForm.Freeze(false);
                        }
                        else
                        {
                            SAPbouiCOM.Grid oGrid;
                            oGrid = (SAPbouiCOM.Grid)oWaitForm.Items.Item("4").Specific;

                            try
                            {
                                for (int i = 1; i < oMatrix.RowCount; i++)
                                {
                                    bool boolAvailable = false;
                                    for (int j = 0; j < oGrid.Rows.Count; j++)
                                    {
                                        if (((SAPbouiCOM.EditText)oMatrix.Columns.Item("1").Cells.Item(i).Specific).Value.Trim() == oGrid.DataTable.GetValue("ItemCode", j).ToString().Trim())
                                        {
                                            boolAvailable = true;
                                            oGrid.DataTable.SetValue("Order Qty", j, Convert.ToInt32(Convert.ToDouble(((SAPbouiCOM.EditText)oMatrix.Columns.Item("11").Cells.Item(i).Specific).Value.Trim())));
                                            break;
                                        }
                                    }
                                    if (boolAvailable == false)
                                    {
                                        int intGridRow = 0;
                                        if (oGrid.DataTable.GetValue("ItemCode", oGrid.Rows.Count - 2).ToString().Trim() == "")
                                        {
                                            intGridRow = oGrid.Rows.Count - 2;
                                        }
                                        else
                                        {
                                            intGridRow = oGrid.Rows.Count - 1;
                                        }

                                        oGrid.DataTable.SetValue("ItemCode", intGridRow, ((SAPbouiCOM.EditText)oMatrix.Columns.Item("1").Cells.Item(i).Specific).Value.Trim());
                                        oGrid.DataTable.SetValue("ItemName", intGridRow, ((SAPbouiCOM.EditText)oMatrix.Columns.Item("3").Cells.Item(i).Specific).Value.Trim());
                                        oGrid.DataTable.SetValue("Order Qty", intGridRow, Convert.ToInt32(Convert.ToDouble(((SAPbouiCOM.EditText)oMatrix.Columns.Item("11").Cells.Item(i).Specific).Value.Trim())));
                                        oGrid.DataTable.SetValue("UoM", intGridRow, ((SAPbouiCOM.EditText)oMatrix.Columns.Item("1470002145").Cells.Item(i).Specific).Value.Trim());
                                        string input = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("14").Cells.Item(i).Specific).Value.Trim();
                                        SAPbobsCOM.ItemPriceReturnParams itemPrice = clsSBO.getUnitPriceSys(oCompany, oGrid.DataTable.GetValue("ItemCode", pVal.Row).ToString().Trim(), ((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim(), 1, DateTime.Now.Date, ((SAPbouiCOM.EditText)oMatrix.Columns.Item("1470002145").Cells.Item(i).Specific).Value.Trim());
                                        oGrid.DataTable.SetValue("Current Selling Price", pVal.Row, itemPrice.Price);


                                        //oGrid.DataTable.SetValue("Current Selling Price", intGridRow, new string(input.Where(c => (Char.IsDigit(c) || c == '.' || c == ',')).ToArray()));

                                        oGrid.DataTable.Rows.Add();
                                    }
                                }
                            }
                            catch (Exception)
                            {
                            }


                            oWaitForm.Visible = true;
                        }
                    }
                    break;



                case SAPbouiCOM.BoEventTypes.et_LOST_FOCUS:
                    if (oForm.Mode == SAPbouiCOM.BoFormMode.fm_ADD_MODE || oForm.Mode == SAPbouiCOM.BoFormMode.fm_UPDATE_MODE)
                    {
                        if (pVal.ItemUID == "12")
                        {
                            //oForm.DefButton = "btnSH";
                            // oForm.ActiveItem = "btnSH";
                            ((SAPbouiCOM.Button)oForm.Items.Item("btnSH").Specific).Item.Click(BoCellClickType.ct_Regular);
                        }
                    }


                    break;



                case SAPbouiCOM.BoEventTypes.et_FORM_CLOSE:
                    if (oWaitForm != null)
                    {
                        try
                        {
                            oWaitForm.Close();
                        }
                        catch (Exception)
                        {
                        }

                        try
                        {
                        }
                        catch (Exception)
                        {
                            oWaitForm = null;
                        }
                    }
                    break;

                default:
                    break;
                }
            }
        }
示例#57
0
        ///<summary>    Loads matrix data from document. </summary>
        ///<remarks>    Amartinez, 08/05/2017. </remarks>
        ///<param name="pstrAlias"> The pstr alias. </param>
        ///<param name="pstrCond">  The pstr condition. </param>
        public SAPbouiCOM.DBDataSource LoadMatrixConditions(string pstrAlias, string pstrCond, SAPbouiCOM.DBDataSource pDBDataSourceD)
        {
            SAPbouiCOM.Conditions lObjCons = null;
            SAPbouiCOM.Condition  lObjCon  = null;

            //PL001  1
            lObjCons = new SAPbouiCOM.Conditions();
            lObjCon  = lObjCons.Add();
            lObjCon.BracketOpenNum  = 1;
            lObjCon.Alias           = pstrAlias;
            lObjCon.Operation       = SAPbouiCOM.BoConditionOperation.co_EQUAL;
            lObjCon.CondVal         = pstrCond;
            lObjCon.BracketCloseNum = 1;

            ///Validacion para cargar solo las lineas abiertas
            lObjCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

            lObjCon = lObjCons.Add();
            lObjCon.BracketOpenNum  = 1;
            lObjCon.Alias           = "LineStatus";
            lObjCon.Operation       = SAPbouiCOM.BoConditionOperation.co_EQUAL;
            lObjCon.CondVal         = "O";
            lObjCon.BracketCloseNum = 1;
            pDBDataSourceD.Query(lObjCons);

            //Validacion para evitar lineas sin cantidades pendientes
            lObjCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

            lObjCon = lObjCons.Add();
            lObjCon.BracketOpenNum  = 1;
            lObjCon.Alias           = "OpenQty";
            lObjCon.Operation       = SAPbouiCOM.BoConditionOperation.co_GRATER_THAN;
            lObjCon.CondVal         = "0";
            lObjCon.BracketCloseNum = 1;
            pDBDataSourceD.Query(lObjCons);

            return(pDBDataSourceD);
        }
示例#58
0
        public virtual void ET_AFRowDataMenu_Add(MenuEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.ActiveForm;
            // ADD YOUR ACTION CODE HERE ...


            string strCode = string.Empty;
            string strDELIVCD = string.Empty;

            if (gSelMtx == "mtx1_DUMY")
            {
                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item(gSelMtx).Specific;
                oDB1_Z = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO00301Z_HRD");

                // 배달코드 생성
                strDELIVCD = GetMaxDelivCode(oForm);

                // SystemDataTable에 행 추가하고 추가된 Index값을 리턴받는다.
                int index = AddRowDataTable_DELIVER(oForm, strDELIVCD);

                SetMatrixAddRow(ref oForm, ref oMatrix, ref oDB1_Z, index.ToString(), strDELIVCD, "U_DELVCD");
            }
            else
            {
                // 배달리스트에서 선택된 라인의 배달코드
                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_DUMY").Specific;


                int iSelectIndex = oMatrix.GetNextSelectedRow(0, BoOrderType.ot_RowOrder);
                strDELIVCD = FN.GetMatirxCellValue(ref oMatrix, "U_DELVCD", iSelectIndex);

                oDB2_Z = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SO00302Z_HRD");

                // SystemDataTable에 행 추가하고 추가된 Index값을 리턴받는다.
                int index = AddRowDataTable_CALL(oForm, strDELIVCD);

                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_DUMY").Specific;
                SetMatrixAddRow(ref oForm, ref oMatrix, ref oDB2_Z, index.ToString(), strDELIVCD, "U_DELVCD");

                // 상담리스트에 행추가하고 선택된 행의 Index 값을 가져와서 선택된 행의 수정여부를 수정한다.
                iSelectIndex = oMatrix.GetNextSelectedRow(0, BoOrderType.ot_RowOrder);

                oMatrix.CommonSetting.SetCellEditable(iSelectIndex, gCallTp_IDX, true);// 콜유형
                oMatrix.CommonSetting.SetCellEditable(iSelectIndex, gComment_IDX, true);// 접수내용

            }
            B1Connections.theAppl.StatusBar.SetText(pVal.MenuUID.ToString(), SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_None);
        }
示例#59
0
        public static void clsAPCreditMemo_ItemEvent(ref SAPbouiCOM.Application oApplication, ref SAPbobsCOM.Company oCompany, SAPbouiCOM.Form oSetupForm, ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent)
        {
            oForm            = oSetupForm;
            oHDBDataSource   = oForm.DataSources.DBDataSources.Item("ORPC");
            oChildDataSource = oForm.DataSources.DBDataSources.Item("RPC1");
            oMatrix          = (SAPbouiCOM.Matrix)oForm.Items.Item("38").Specific;

            if (pVal.BeforeAction)
            {
                switch (pVal.EventType)
                {
                case SAPbouiCOM.BoEventTypes.et_CLICK:
                    if (pVal.ItemUID == "38" && (pVal.ColUID == "U_Variance" || pVal.ColUID == "U_DiscExc"))
                    {
                        BubbleEvent = false;
                    }
                    if (oForm.Mode == SAPbouiCOM.BoFormMode.fm_OK_MODE || oForm.Mode == SAPbouiCOM.BoFormMode.fm_UPDATE_MODE)
                    {
                        if (pVal.ItemUID == "U_DocType")
                        {
                            BubbleEvent = false;
                        }
                    }
                    break;

                case SAPbouiCOM.BoEventTypes.et_PICKER_CLICKED:
                    if (pVal.ItemUID == "38" && pVal.ColUID == "U_Variance")
                    {
                        BubbleEvent = false;
                    }
                    break;

                case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED:
                    if (pVal.ItemUID == "btnSH")
                    {
                        if (((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim() == "")
                        {
                            oApplication.StatusBar.SetText("Select the Supplier....", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                            BubbleEvent = false;
                        }

                        if (oHDBDataSource.GetValue("DocStatus", oHDBDataSource.Offset).ToString().Trim() != "O")
                        {
                            BubbleEvent = false;
                        }

                        // strDocEntry = oHDBDataSource.GetValue("DocEntry", 0).Trim();
                        //strDocType = oHDBDataSource.GetValue("U_DocType", 0).Trim();
                    }
                    break;

                default:
                    break;
                }
            }

            else if (pVal.BeforeAction == false)
            {
                switch (pVal.EventType)
                {
                case SAPbouiCOM.BoEventTypes.et_FORM_LOAD:
                    //Utilities.UtilitiesCls.CreateButtonItem(oForm, "btnSH", oForm.Items.Item("2").Left + oForm.Items.Item("2").Width + 6, oForm.Items.Item("2").Top, oForm.Items.Item("2").Width + 8, oForm.Items.Item("2").Height, "Purchase History", true, 0, "");
                    Utilities.UtilitiesCls.CreateButtonItem(oForm, "btnSH", oForm.Items.Item("46").Left, oForm.Items.Item("46").Top + 20, oForm.Items.Item("46").Width, oForm.Items.Item("2").Height, "Purchase History", true, 0, "46");
                    break;

                case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED:
                    if (pVal.ItemUID == "1")
                    {
                        if (pVal.ActionSuccess)
                        {
                            if (oWaitForm != null)
                            {
                                oWaitForm.Close();
                                oWaitForm = null;
                            }
                        }
                    }

                    if (pVal.ItemUID == "btnSH")
                    {
                        try
                        {
                            if (oWaitForm != null)
                            {
                                string strCardCode1 = ((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim();
                                string strCardCode2 = ((SAPbouiCOM.EditText)oWaitForm.Items.Item("6").Specific).Value.Trim();

                                if (strCardCode1 != strCardCode2)
                                {
                                    oWaitForm.Close();
                                    oWaitForm = null;
                                }
                            }
                        }
                        catch (Exception)
                        {
                            oWaitForm = null;
                        }

                        if (oWaitForm == null)
                        {
                            string strQry;
                            oWaitForm = clsSBO.LoadForm("EJ_OSSH.srf", "EJ_OSSH", oApplication);

                            ((SAPbouiCOM.EditText)oWaitForm.Items.Item("6").Specific).Value = ((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim();
                            ((SAPbouiCOM.EditText)oWaitForm.Items.Item("8").Specific).Value = ((SAPbouiCOM.EditText)oForm.Items.Item("54").Specific).Value.Trim();
                            oWaitForm.Freeze(true);
                            oWaitForm.DataSources.DataTables.Add("@dtTemp");
                            SAPbouiCOM.Grid oGrid;
                            oGrid      = (SAPbouiCOM.Grid)oWaitForm.Items.Item("4").Specific;
                            oRecordSet = (SAPbobsCOM.Recordset)oCompany.GetBusinessObject(BoObjectTypes.BoRecordset);
                            //  strQry = "Exec \"EJ_SupplierCMPurchaseHistory\"  '" + ((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim() + "'";
                            strQry = "Exec \"EJ_SupplierPurchaseHistory\"  '" + ((SAPbouiCOM.EditText)oForm.Items.Item("4").Specific).Value.Trim() + "'";

                            oWaitForm.DataSources.DataTables.Item(0).ExecuteQuery(strQry);
                            oGrid.DataTable = oWaitForm.DataSources.DataTables.Item(0);
                            oGrid.Columns.Item(0).Editable = true;
                            SAPbouiCOM.EditTextColumn oEditTxt = ((SAPbouiCOM.EditTextColumn)oGrid.Columns.Item(0));
                            oEditTxt.ChooseFromListUID     = "CFL_2";
                            oEditTxt.ChooseFromListAlias   = "ItemCode";
                            oGrid.Columns.Item(1).Editable = false;
                            oGrid.Columns.Item(2).Editable = true;
                            oGrid.Columns.Item(3).Editable = true;
                            oEditTxt = ((SAPbouiCOM.EditTextColumn)oGrid.Columns.Item(3));
                            oEditTxt.ChooseFromListUID     = "CFL_3";
                            oEditTxt.ChooseFromListAlias   = "UomCode";
                            oGrid.Columns.Item(4).Editable = true;
                            oGrid.Columns.Item(0).Editable = true;

                            for (int j = 5; j < oGrid.Columns.Count; j++)
                            {
                                oGrid.Columns.Item(j).Editable = false;
                            }

                            oGrid.AutoResizeColumns();
                            oGrid.DataTable.Rows.Add(1);

                            clsSupplierPurchaseHistory.oForm   = oWaitForm;
                            clsSupplierPurchaseHistory.oSOForm = oForm;
                            oWaitForm.Freeze(false);
                        }
                        else
                        {
                            oWaitForm.Visible = true;
                        }
                    }
                    break;

                case SAPbouiCOM.BoEventTypes.et_LOST_FOCUS:
                    if (oForm.Mode == SAPbouiCOM.BoFormMode.fm_ADD_MODE || oForm.Mode == SAPbouiCOM.BoFormMode.fm_UPDATE_MODE)
                    {
                        if (pVal.ItemUID == "12")
                        {
                            //oForm.DefButton = "btnSH";
                            // oForm.ActiveItem = "btnSH";
                            ((SAPbouiCOM.Button)oForm.Items.Item("btnSH").Specific).Item.Click(BoCellClickType.ct_Regular);
                        }
                    }
                    break;

                case SAPbouiCOM.BoEventTypes.et_FORM_CLOSE:
                    if (oWaitForm != null)
                    {
                        oWaitForm.Close();
                        oWaitForm = null;
                    }
                    break;

                default:
                    break;
                }
            }
        }
示例#60
0
        /// <summary>
        /// 배송코드 채번
        /// </summary>
        /// <param name="oForm"></param>
        /// <returns></returns>
        private string GetMaxDelivCode(SAPbouiCOM.Form oForm)
        {
            string strCode = string.Empty;
            string strRtnValue = string.Empty;
            int iMaxIdx = 0;
            try
            {
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0030M_HRD");
                strCode = oDB_M.GetValue("Code", 0).ToString();

                // 
                if (gDs.Tables[oForm.UniqueID + "_Deliver"].Rows.Count > 0 && gDs.Tables[oForm.UniqueID + "_Deliver"] != null)
                    iMaxIdx = int.Parse(gDs.Tables[oForm.UniqueID + "_Deliver"].Compute(" MAX(LINEID) ", "").ToString());

                strRtnValue = strCode.Substring(0, 10) + "_" + (iMaxIdx + 1).ToString().PadLeft(4, '0');
            }
            catch (Exception)
            {
                throw;
            }
            return strRtnValue;
        }