}//fin InitForm

        public new void FormEvent(String FormUID, ref SAPbouiCOM.ItemEvent pVal, ref Boolean BubbleEvent)
        {
            Int32  nErr;
            String sErr;

            SAPbouiCOM.DataTable oDataTable;
            String sValue, sValue1;

            SAPbouiCOM.IChooseFromListEvent oCFLEvento = null;

            base.FormEvent(FormUID, ref pVal, ref BubbleEvent);
            try
            {
                if ((pVal.EventType == BoEventTypes.et_ITEM_PRESSED) && (pVal.BeforeAction))
                {
                    if ((pVal.ItemUID == "1") && (oForm.Mode == BoFormMode.fm_ADD_MODE))
                    {
                        //BubbleEvent := ValidarDatosFE();
                    }
                }

                if ((pVal.EventType == BoEventTypes.et_CHOOSE_FROM_LIST) && (!pVal.BeforeAction))
                {
                    if (pVal.ColUID == "V_0")
                    {
                        oCFLEvento = (SAPbouiCOM.IChooseFromListEvent)(pVal);
                        oDataTable = oCFLEvento.SelectedObjects;
                        if (oDataTable != null)
                        {
                            sValue  = (System.String)(oDataTable.GetValue("Code", 0));
                            sValue1 = (System.String)(oDataTable.GetValue("Name", 0));

                            oMtx.FlushToDataSource();
                            oDBDSD.SetValue("U_Indicato", pVal.Row - 1, sValue);
                            oDBDSD.SetValue("U_Descrip", pVal.Row - 1, sValue1);
                            if (pVal.Row == oMtx.RowCount)
                            {
                                oDBDSD.InsertRecord(pVal.Row);
                            }
                            oMtx.LoadFromDataSource();
                            oMtx.AutoResizeColumns();
                            if (oForm.Mode == BoFormMode.fm_OK_MODE)
                            {
                                oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                FCmpny.GetLastError(out nErr, out sErr);
                FSBOApp.StatusBar.SetText("FormEvent: " + e.Message + " ** Trace: " + e.StackTrace, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                OutLog("FormEvent: " + e.Message + " ** Trace: " + e.StackTrace);
            }
        }//fin FormEvent
Exemplo n.º 2
0
        private void getCodes()
        {
            dtList.Rows.Clear();
            string codeType = "Group";

            if (opI.Selected)
            {
                codeType = "Item";
            }

            string strSql = "SELECT \"Name\",\"U_Descr\" FROM \"@B1_QA_ATTR_CODES\" WHERE \"U_CodeType\" = '" + codeType + "'";

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

            foreach (System.Data.DataRow dr in dtCodes.Rows)
            {
                i++;
                dtList.Rows.Add(1);
                dtList.SetValue("Id", i - 1, i.ToString());
                dtList.SetValue("Code", i - 1, dr["Name"].ToString());
                dtList.SetValue("Name", i - 1, dr["U_Descr"].ToString());
            }
            mtList.LoadFromDataSource();
        }
Exemplo n.º 3
0
        private void fillJeGrid()
        {
            fillAllJes();
            dtHead.Rows.Clear();
            int i = 0;

            foreach (DataRow dr in dtPendingJEs.Rows)
            {
                if (Convert.ToString(cbOr.Value).Trim() == "All" || Convert.ToString(cbOr.Value).Trim() == dr["Originator"].ToString())
                {
                    try
                    {
                        dtHead.Rows.Add(1);
                        dtHead.SetValue("cNum", i, dr["V#"].ToString());
                        dtHead.SetValue("cDate", i, Convert.ToDateTime(dr["Date"].ToString()));
                        dtHead.SetValue("cRemarks", i, dr["Remarks"].ToString());
                        dtHead.SetValue("cMonth", i, Convert.ToInt16(dr["Month"].ToString()));
                        dtHead.SetValue("cYear", i, Convert.ToInt16(dr["Year"].ToString()));
                        dtHead.SetValue("cPostedJE", i, Convert.ToInt16(dr["PostedJE"].ToString()));
                        dtHead.SetValue("cCanceledJE", i, Convert.ToInt16(dr["CanceledJE"].ToString()));
                    }
                    catch { }
                    i++;
                }
            }
            mtJE.LoadFromDataSource();
        }
Exemplo n.º 4
0
        private void fillJeGrid()
        {
            fillAllJes();
            dtHead.Rows.Clear();
            int i = 0;

            foreach (DataRow dr in dtPendingJEs.Rows)
            {
                if (Convert.ToString(cbOr.Value).Trim() == "All" || Convert.ToString(cbOr.Value).Trim() == dr["Originator"].ToString())
                {
                    try
                    {
                        dtHead.Rows.Add(1);
                        dtHead.SetValue("cNum", i, i.ToString());
                        dtHead.SetValue("cDate", i, Convert.ToDateTime(dr["DocDate"].ToString()));
                        dtHead.SetValue("cDN", i, Convert.ToInt32(dr["DocNum"].ToString()));
                        dtHead.SetValue("cTotal", i, Convert.ToDouble(dr["DocTotal"].ToString()));
                        dtHead.SetValue("cOrigen", i, Convert.ToString(dr["Originator"].ToString()));
                    }
                    catch { }
                    i++;
                }
            }
            mtJE.LoadFromDataSource();
        }
Exemplo n.º 5
0
        private void FillOrderMatrix()
        {
            oForm.Freeze(true);
            dtWebO.Rows.Clear();
            int      i = 0;
            DateTime OrdersSinceCreateDate = Convert.ToDateTime(dtHead.GetValue("From", 0));
            DateTime OrdersToCreateDate    = Convert.ToDateTime(dtHead.GetValue("To", 0));
            string   LTDINCCard            = Program.objHrmsUI.getSetting("INCCODE").ToString();

            string strSql = "Select DocEntry, Convert(varchar(30),DocDate,101) as DocDate,OINV.DocNum from OINV where OINV.CardCode = '" + LTDINCCard + "' And  DocDate between '" + OrdersSinceCreateDate.ToString("yyyyMMdd") + "' and '" + OrdersToCreateDate.ToString("yyyyMMdd") + "' order by DocNum";

            System.Data.DataTable dtOrders = Program.dsLTD.getDataTable(strSql, "gettingOrders");

            string selStatus = cbOS.Selected.Value.ToString();

            foreach (System.Data.DataRow dr in dtOrders.Rows)
            {
                string orderStatus = "O";
                string strId       = dr["DocEntry"].ToString();

                string pchEntry = getDocNum("LTD Inv # " + dr["DocNum"].ToString(), "OPOR");

                if (pchEntry != "" && pchEntry != "0")
                {
                    orderStatus = "C";
                }

                if (selStatus == "01" || (selStatus == "02" && orderStatus == "O") || (selStatus == "03" && orderStatus == "C"))
                {
                    dtWebO.Rows.Add(1);

                    dtWebO.SetValue("Id", i, (i + 1).ToString());
                    dtWebO.SetValue("WebNum", i, dr["DocNum"].ToString());
                    dtWebO.SetValue("RdrNum", i, pchEntry);

                    dtWebO.SetValue("RdrDT", i, dr["DocDate"].ToString());


                    i++;
                }
            }

            mtWO.LoadFromDataSource();
            oForm.Freeze(false);
            lblStatus.Caption = "";
            updateRetMatrix();
        }
        }//fin FormEvent

        private void Distribuir()
        {
            Int64 iFolio;
            Int64 iDesde;
            Int64 iHasta;
            Int32 i;

            SAPbouiCOM.EditText oEditText;

            try
            {
                oMtx.Clear();
                oMtx.FlushToDataSource();
                oEditText = (EditText)(oForm.Items.Item("Desde").Specific);
                iDesde    = Convert.ToInt64((System.String)(oEditText.Value), _nf);
                oEditText = (EditText)(oForm.Items.Item("Hasta").Specific);
                iHasta    = Convert.ToInt64((System.String)(oEditText.Value), _nf);
                if (iDesde <= 0)
                {
                    FSBOApp.StatusBar.SetText("Debe ingresar Folio desde", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                }
                else if (iHasta <= 0)
                {
                    FSBOApp.StatusBar.SetText("Debe ingresar Folio hasta", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                }
                else if (iDesde >= iHasta)
                {
                    FSBOApp.StatusBar.SetText("Ingrese rango Folio correcto", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                }
                else
                {
                    i = 0;
                    for (iFolio = iDesde; iFolio <= iHasta; iFolio++)
                    {
                        oDBDSD.InsertRecord(i);
                        oDBDSD.SetValue("U_Folio", i, Convert.ToString(iFolio));
                        oDBDSD.SetValue("U_Estado", i, "D");
                        i++;
                    }

                    if (Convert.ToDouble((System.String)(oDBDSD.GetValue("U_Folio", i)), _nf) == 0)
                    {
                        oDBDSD.RemoveRecord(i);
                    }

                    oMtx.LoadFromDataSource();
                    oColumn = oMtx.Columns.Item("Folio");
                    oColumn.TitleObject.Sortable = true;
                    oColumn.TitleObject.Sort(SAPbouiCOM.BoGridSortType.gst_Ascending);
                }
            }
            catch (Exception e)
            {
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
                OutLog("Distribuir: " + e.Message + " ** Trace: " + e.StackTrace);
            }
        }//fin Distribuir
        }//fin MenuEvent

        private void GuardarRegistros()
        {
            TFunctions Reg;
            Int32      i;
            Int32      DocEntryAsig;
            String     User, Pass;

            try
            {
                if (ValidarMatrix())
                {
                    Reg       = new TFunctions();
                    Reg.SBO_f = FSBOf;
                    oMtx.FlushToDataSource();
                    FCmpny.StartTransaction();

                    i = 0;
                    while (i < oMtx.RowCount)
                    {
                        User = (System.String)(oDBDSH.GetValue("U_Usuario", i));

                        Pass = (System.String)(oDBDSH.GetValue("U_Password", i));
                        //s = Reg.Encriptar(Pass);
                        oDBDSH.SetValue("U_Password", i, Pass);

                        if ((System.String)(oDBDSH.GetValue("DocEntry", i)) == "")
                        {
                            DocEntryAsig = Reg.FEMultiSocAdd((System.String)(oDBDSH.GetValue("U_Servidor", i)), (System.String)(oDBDSH.GetValue("U_RUT", i)), (System.String)(oDBDSH.GetValue("U_Base", i)), (System.String)(oDBDSH.GetValue("U_Usuario", i)), (System.String)(oDBDSH.GetValue("U_Password", i)), (System.String)(oDBDSH.GetValue("U_Sociedad", i)), (System.String)(oDBDSH.GetValue("U_Habilitada", i)));
                            oDBDSH.SetValue("DocEntry", i, DocEntryAsig.ToString());
                        }
                        else
                        {
                            Reg.FEMultiSocUpt((System.String)(oDBDSH.GetValue("DocEntry", i)), (System.String)(oDBDSH.GetValue("U_Servidor", i)), (System.String)(oDBDSH.GetValue("U_RUT", i)), (System.String)(oDBDSH.GetValue("U_Base", i)), (System.String)(oDBDSH.GetValue("U_Usuario", i)), (System.String)(oDBDSH.GetValue("U_Password", i)), (System.String)(oDBDSH.GetValue("U_Sociedad", i)), (System.String)(oDBDSH.GetValue("U_Habilitada", i)));
                        }

                        //oDBDSH.SetValue("U_Password", i, Pass);
                        i++;
                    }
                    FCmpny.EndTransaction(BoWfTransOpt.wf_Commit);
                    oDBDSH.InsertRecord(i);
                    oMtx.LoadFromDataSource();
                    oMtx.AutoResizeColumns();
                    FSBOApp.StatusBar.SetText("Sociedades registradas satisfactoriamente", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success);
                }
            }
            catch (Exception e)
            {
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
                OutLog("GuardarRegistros: " + e.Message + " ** Trace: " + e.StackTrace);
                if (FCmpny.InTransaction)
                {
                    FCmpny.EndTransaction(BoWfTransOpt.wf_RollBack);
                }
            }
        }//fin GuardarRegistros
Exemplo n.º 8
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();
        }
Exemplo n.º 9
0
        private void getCodes()
        {
            dtList.Rows.Clear();
            string codeType = "Group";

            string strSql = "SELECT \"Code\" , \"Name\" FROM \"@B1_QA_OUSR\"";

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

            foreach (System.Data.DataRow dr in dtCodes.Rows)
            {
                i++;
                dtList.Rows.Add(1);
                dtList.SetValue("Id", i - 1, i.ToString());
                dtList.SetValue("Code", i - 1, dr["Code"].ToString());
                dtList.SetValue("Name", i - 1, dr["Name"].ToString());
            }
            mtList.LoadFromDataSource();
        }
Exemplo n.º 10
0
        private void fillAddons()
        {
            dtHead.Rows.Clear();

            string strSql = "Select * from [@B1_MODULES]";

            System.Data.DataTable dtModules = Program.objHrmsUI.getDataTable(strSql, "Filling Module");
            int i = 0;

            foreach (System.Data.DataRow dr in dtModules.Rows)
            {
                dtHead.Rows.Add(1);
                dtHead.SetValue("Id", i, (i + 1).ToString());
                dtHead.SetValue("AC", i, dr["CODE"].ToString());
                dtHead.SetValue("AN", i, dr["NAME"].ToString());
                dtHead.SetValue("LK", i, dr["U_LicenseKey"].ToString());
                dtHead.SetValue("Active", i, dr["U_Enabled"].ToString());
                i++;
            }
            mtAddon.LoadFromDataSource();
        }
Exemplo n.º 11
0
        private void InitiallizeForm()
        {
            //  dtHead = oForm.DataSources.DataTables.Item("dtHead");
            // dtHead.Rows.Add(1);

            oForm.Freeze(true);

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

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



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

            mtDet.LoadFromDataSource();

            oForm.Freeze(false);
        }
Exemplo n.º 12
0
        public virtual void ET_mtx1_AFChooseFromList(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
            // ADD YOUR ACTION CODE HERE ...
            SAPbouiCOM.DataTable oDataTable = null;

            oDataTable = FN.GetCFLSelectedObjects(pVal);

            SAPbouiCOM.DBDataSource oKIS_SD00301_HRD = oForm.DataSources.DBDataSources.Item("@KIS_SD00301_HRD");

            string edtORDERRA = ((SAPbouiCOM.EditText)oForm.Items.Item("edtORDERRA").Specific).Value;
            string edtBPRATE = ((SAPbouiCOM.EditText)oForm.Items.Item("edtBPRATE").Specific).Value;

            try
            {
                if (oDataTable != null)
                {
                    oMatrix.FlushToDataSource();

                    int iRow = pVal.Row - 1;

                    switch (pVal.ColUID)
                    {
                        case "U_ITMGRPCD":
                        case "U_ITMGRPNM":
                            for (int iLooper = 0; iLooper < oDataTable.Rows.Count; iLooper++)
                            {
                                if (oKIS_SD00301_HRD.Size - 1 < iRow)
                                {
                                    oKIS_SD00301_HRD.InsertRecord(oKIS_SD00301_HRD.Size);
                                }

                                oKIS_SD00301_HRD.Offset = iRow;

                                oKIS_SD00301_HRD.SetValue("U_ITMGRPCD", oKIS_SD00301_HRD.Offset, oDataTable.GetValue("Code", iLooper).ToString());
                                oKIS_SD00301_HRD.SetValue("U_ITMGRPNM", oKIS_SD00301_HRD.Offset, oDataTable.GetValue("Name", iLooper).ToString());
                                //01.우선순위 로드.
                                oMatrix.LoadFromDataSource();

                                //02.실수주자 수수료 계산
                                oMatrix.SetCellWithoutValidation(iRow +1, "U_ORDERRAT", edtORDERRA);
                                SetCalc("U_ORDERRAT", iRow + 1);
                                //02.대행사 수수료 계산
                                oMatrix.SetCellWithoutValidation(iRow + 1, "U_BPRATE", edtBPRATE);
                                SetCalc("U_BPRATE", iRow + 1);

                                iRow++;
                            }

                            break;
                        default:
                            break;
                    }
                    
                    //행추가
                    //FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oKIS_SD00301, FN.RowSelectMode.CellClick, "U_ITMGRPCD");
                    //SetMatrixColumnVATGRP(gl_U_VATCD, gl_U_VATCDBP);
                    //SetMatrixRowNumbering(oMatrix, "U_LINENUM");

                    SetMatrixAddRow(FN.RowSelectMode.None);
                    SetMatrixCalc_Sum();

                    if (oForm.Mode == BoFormMode.fm_OK_MODE)
                        oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oKIS_SD00301_HRD = null;
                oDataTable = null;
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// 광고수주오더의 DBDatasource 정보를 광고매출확정 DBdataSource에 복제합니다.(라인)
        /// </summary>
        /// <param name="oKIS_SD00301_HRD">광고주수오더 행 DBDataSource</param>
        /// <param name="oKIS_SD00501_HRD">광고매출확정 행 DBDataSource</param>
        private void SetDBDataSourceCopy_Line(SAPbouiCOM.DBDataSource oKIS_SD00301_HRD, SAPbouiCOM.DBDataSource oKIS_SD00501_HRD)
        {
            try
            {
                List<string> list_KIS_SD00501_HRD = new List<string>();

                for (int iLooper = 0; iLooper < oKIS_SD00501_HRD.Fields.Count; iLooper++)
                {
                    string FieldName = oKIS_SD00501_HRD.Fields.Item(iLooper).Name;
                    //사용자 정의 필드만 복사 대상필드 리스트에 추가
                    if (FieldName.StartsWith("U_"))
                    {
                        list_KIS_SD00501_HRD.Add(oKIS_SD00501_HRD.Fields.Item(iLooper).Name);
                    }
                }

                //라인
                int iCount = 0;
                for (int jLooper = 0; jLooper < oKIS_SD00301_HRD.Size; jLooper++)
                {
                    oKIS_SD00301_HRD.Offset = jLooper;

                    if (oKIS_SD00501_HRD.Size - 1 < iCount)
                    {
                        oKIS_SD00501_HRD.InsertRecord(oKIS_SD00501_HRD.Size);
                    }

                    oKIS_SD00501_HRD.Offset = iCount;

                    //행상태가 미결인 것만 가져오기
                    if (oKIS_SD00301_HRD.GetValue("U_STATUS", oKIS_SD00301_HRD.Offset).Trim() == "O")
                    {
                        iCount++;
                    }
                    else
                    {
                        continue;
                    }

                    //컬럼
                    for (int iLooper = 0; iLooper < oKIS_SD00301_HRD.Fields.Count; iLooper++)
                    {
                        string FieldName = oKIS_SD00301_HRD.Fields.Item(iLooper).Name;

                        if (list_KIS_SD00501_HRD.Contains(FieldName))
                        {
                            switch (FieldName)
                            {
                                case "U_AMT":
                                    oKIS_SD00501_HRD.SetValue(FieldName, oKIS_SD00501_HRD.Offset, oKIS_SD00301_HRD.GetValue("U_OPENAMT", oKIS_SD00301_HRD.Offset).Trim());
                                    break;
                                case "U_BTYPE"://기준문서유형
                                    oKIS_SD00501_HRD.SetValue(FieldName, oKIS_SD00501_HRD.Offset, oKIS_SD00301_HRD.GetValue("Object", oKIS_SD00301_HRD.Offset).Trim());
                                    break;
                                case "U_BENTRY"://기준문서엔트리
                                    oKIS_SD00501_HRD.SetValue(FieldName, oKIS_SD00501_HRD.Offset, oKIS_SD00301_HRD.GetValue("DocEntry", oKIS_SD00301_HRD.Offset).Trim());
                                    break;
                                case "U_BLINEID"://기준문서 행ID
                                    oKIS_SD00501_HRD.SetValue(FieldName, oKIS_SD00501_HRD.Offset, oKIS_SD00301_HRD.GetValue("LineId", oKIS_SD00301_HRD.Offset).Trim());
                                    break;
                                case "U_TTYPE":
                                case "U_TENTRY":
                                case "U_TLINEID":
                                    oKIS_SD00501_HRD.SetValue(FieldName, oKIS_SD00501_HRD.Offset, "");
                                    break;
                                default:
                                    oKIS_SD00501_HRD.SetValue(FieldName, oKIS_SD00501_HRD.Offset, oKIS_SD00301_HRD.GetValue(FieldName, oKIS_SD00301_HRD.Offset).Trim());
                                    break;
                            }

                        }
                    }
                }
                oMatrix = oForm.Items.Item("mtx1").Specific;
                oMatrix.LoadFromDataSource();

                //분할된 미결금액이 있을지도 모르니까, 매출금액 기준으로 다시 재계산 시작
                for (int iLooper = 1; iLooper < oMatrix.VisualRowCount; iLooper++)
                {
                    SetCalc("U_AMT", iLooper);
                }

                SetMatrixCalc_Sum();

                list_KIS_SD00501_HRD = null;
            }
            catch (Exception)
            {

                throw;
            }

        }
        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
Exemplo n.º 15
0
        private void GetDataLoad(SAPbouiCOM.Form oForm)
        {
            string strYYYYMM = oForm.DataSources.UserDataSources.Item("U_YYYYMM").Value.Trim();
            string strCENTCD = oForm.DataSources.UserDataSources.Item("U_CENTCD").Value.Trim();
            string strCENTNM = oForm.DataSources.UserDataSources.Item("U_CENTNM").Value.Trim();
            string strBENTRY = oForm.DataSources.UserDataSources.Item("U_BENTRY").Value.Trim();

            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0420T_HRD");
            oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_SO04201_HRD");

            //헤더데이터를 조회
            QueryWithConditions_MASTER(ref oDB_M, strYYYYMM, strCENTCD);
            if (oDB_M.Size > 0)
            {
                string strDocEntry = oDB_M.GetValue("DocEntry", 0).Trim();
                //헤더를 기준으로 라인데이터 조회
                QueryWithConditions(ref oDB_1, "DocEntry", strDocEntry);
                oForm.Mode = BoFormMode.fm_OK_MODE;

                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx").Specific;
                oMatrix.LoadFromDataSource();
            }
            else
            {
                string strSTATUS = oForm.DataSources.UserDataSources.Item("U_STATUS").Value.Trim();
                if (strSTATUS == "P")
                {
                    // 아무것도 없는 마스터에 값을 입력할려고 하면 오류 발생 
                    // 폼 모드 Add모드로 강제로 전환 하고 데이터 입력해야함.
                    oForm.Mode = BoFormMode.fm_ADD_MODE;
                }
                oDB_M.SetValue("U_YYYYMM", 0, strYYYYMM);
                oDB_M.SetValue("U_CENTCD", 0, strCENTCD);
                oDB_M.SetValue("U_CENTNM", 0, strCENTNM);
                oDB_M.SetValue("U_BENTRY", 0, strBENTRY);
                oDB_M.SetValue("U_BTYPE", 0, "KIS_SO0310_HRD");
            }
        }
Exemplo n.º 16
0
        }//fin InitForm

        public new void FormEvent(String FormUID, ref SAPbouiCOM.ItemEvent pVal, ref Boolean BubbleEvent)
        {
            Int32  nErr;
            String sErr;

            SAPbouiCOM.DataTable oDataTable;
            String sValue, sValue1;

            SAPbouiCOM.IChooseFromListEvent oCFLEvento = null;
            base.FormEvent(FormUID, ref pVal, ref BubbleEvent);

            try
            {
                if ((pVal.EventType == BoEventTypes.et_ITEM_PRESSED) && (pVal.BeforeAction))
                {
                    if ((pVal.ItemUID == "1") && (oForm.Mode == BoFormMode.fm_ADD_MODE))
                    {
                        //BubbleEvent := ValidarDatosFE();
                    }
                }

                if ((pVal.EventType == BoEventTypes.et_COMBO_SELECT) && (!pVal.BeforeAction) && (pVal.ItemUID == "mtx"))
                {
                    if (pVal.ColUID == "V_0")
                    {
                        oMtx.FlushToDataSource();
                        sValue = ((System.String)oDBDSD.GetValue("U_CodeImp", pVal.Row - 1)).Trim();
                        if (GlobalSettings.RunningUnderSQLServer)
                        {
                            s = @"select Code, Name from OSTA where Code = '{0}'
                                  UNION ALL
                                  select WTCode 'Code', WTName 'Name' from OWHT where Inactive = 'N' and WTCode = '{0}'";
                        }
                        else
                        {
                            s = @"select ""Code"", ""Name"" from ""OSTA"" where ""Code"" = '{0}'
                                  UNION ALL
                                  select ""WTCode"" ""Code"", ""WTName"" ""Name"" from ""OWHT"" where ""Inactive"" = 'N' and ""WTCode"" = '{0}' ";
                        }
                        s = String.Format(s, sValue);
                        oRecordSet.DoQuery(s);

                        if (oRecordSet.RecordCount == 0)
                        {
                            FSBOApp.StatusBar.SetText("No se encuentra Impuesto o Retención: " + sValue, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                        }
                        else
                        {
                            sValue1 = ((System.String)oRecordSet.Fields.Item("Name").Value).Trim();


                            oDBDSD.SetValue("U_CodeImp", pVal.Row - 1, sValue);
                            oDBDSD.SetValue("U_Descrip", pVal.Row - 1, sValue1);
                            if (pVal.Row == oMtx.RowCount)
                            {
                                oDBDSD.InsertRecord(pVal.Row);
                            }
                            oMtx.LoadFromDataSource();
                            oMtx.AutoResizeColumns();
                            if (oForm.Mode == BoFormMode.fm_OK_MODE)
                            {
                                oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                FCmpny.GetLastError(out nErr, out sErr);
                FSBOApp.StatusBar.SetText("FormEvent: " + e.Message + " ** Trace: " + e.StackTrace, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                OutLog("FormEvent: " + e.Message + " ** Trace: " + e.StackTrace);
            }
        }//fin FormEvent
Exemplo n.º 17
0
        public virtual void ET_mtx_AFChooseFromList(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx").Specific));
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                switch (pVal.ColUID)
                {
                    case "U_PRCCD":

                        //데이터를 가져오기 위해 데이터테이블 추가
                        SAPbouiCOM.DataTable oDataTable;

                        //데이터 테이블을 ChooseFromList에 선택된 오브젝트에서 가져오도록 세팅
                        oDataTable = FN.GetCFLSelectedObjects(pVal);

                        if (oDataTable != null)
                        {
                            oDB_1.SetValue("U_PRCCD", pVal.Row - 1, oDataTable.GetValue("Code", 0).ToString());
                            oDB_1.SetValue("U_PRCNM", pVal.Row - 1, oDataTable.GetValue("Name", 0).ToString());
                        }

                        oMatrix.LoadFromDataSource();
                        oDataTable = null;

                        break;

                    default:
                        break;
                }

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

        }
Exemplo n.º 18
0
        private void SetTR(string TYPE)
        {
            bool bModify = false;
            SAPbobsCOM.Recordset oRS = null;
            oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
            try
            {
                oForm.Freeze(true);
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_FI0020M_HRD");
                oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_FI00201_HRD");

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

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

                string Code = string.Empty;
                string YYYYMM = string.Empty;
                string sQry = string.Empty;

                if (SelectRow != -1)
                {
                    if (TYPE == "TR")
                    {
                        Code = oForm.Items.Item("Code").Specific.value.Trim();
                        YYYYMM = oDB_1.GetValue("U_YYYYMM", SelectRow).ToString().Trim();
                        sQry = " EXEC KIS_SP_FI0020B1_HRD '" + YYYYMM + "'";
                        oRS.DoQuery(sQry);
                        if (oRS.RecordCount == 0)
                        {
                            oDB_1.SetValue("U_UPDATEDT", SelectRow, strNowDate.Replace(".", ""));
                            oDB_1.SetValue("U_STATUS", SelectRow, "Y");
                        }
                        sQry = "UPDATE [@KIS_FI00201_HRD] SET U_UPDATEDT = '" + strNowDate.Replace(".", "") + "' ,U_STATUS = 'Y' WHERE Code = '" + Code + "' AND U_YYYYMM = '" + YYYYMM + "'";
                        oRS.DoQuery(sQry);

                    }
                    else
                    {
                        Code = oForm.Items.Item("Code").Specific.value.Trim();
                        YYYYMM = oDB_1.GetValue("U_YYYYMM", SelectRow).ToString().Trim();
                        sQry = " DELETE FROM [@KIS_FI0020B1_HRD] WHERE U_YYYYMM = '" + YYYYMM + "'";
                        sQry = sQry + " DELETE FROM [@KIS_FI0020B2_HRD] WHERE U_YYYYMM = '" + YYYYMM + "'";
                        oRS.DoQuery(sQry);
                        if (oRS.RecordCount == 0)
                        {
                            oDB_1.SetValue("U_UPDATEDT", SelectRow, "");
                            oDB_1.SetValue("U_STATUS", SelectRow, "N");
                        }
                        sQry = "UPDATE [@KIS_FI00201_HRD] SET U_UPDATEDT = NULL ,U_STATUS = 'N' WHERE Code = '" + Code + "' AND U_YYYYMM = '" + YYYYMM + "'";
                        oRS.DoQuery(sQry);
                    }
                    bModify = true;
                }

                if (bModify)
                {
                    oMatrix.LoadFromDataSource();
                    SelectRow = -1;
                }

                B1Connections.theAppl.StatusBar.SetText("배치가 적용되었습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다
            }
            catch (Exception ex)
            {
                oForm.Freeze(false);
                B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);

            }
            finally
            {
                oForm.Freeze(false);
                oRS = null;
            }
        }
Exemplo n.º 19
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
Exemplo n.º 20
0
        private void GetDataLoad(SAPbouiCOM.Form oForm, string pDocEntry)
        {

            if (!string.IsNullOrEmpty(pDocEntry))
            {
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0190T_HRD");
                FN.SetDbsWithConditionsQuery(ref oDB_M, "DocEntry==" + pDocEntry);

                oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_SO01901_HRD");
                FN.SetDbsWithConditionsQuery(ref oDB_1, "DocEntry==" + pDocEntry);

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

                oForm.Mode = BoFormMode.fm_OK_MODE;
            }
        }
Exemplo n.º 21
0
        private void CopyDataLoad(SAPbouiCOM.Form oForm, string cDocEntry)
        {

            if (!string.IsNullOrEmpty(cDocEntry))
            {
                oForm.Mode = BoFormMode.fm_ADD_MODE;

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

                // MASTER
                string copyColNm_FM = "U_TAKEYM,U_TAKEDT,U_SERNO,U_ORGNO,U_BANKCD,U_BNKACCT,U_SFILE,U_STOTCNT,U_SFULCNT,U_SFULAMT,U_SPATCNT,U_SPATAMT,U_SMAC,DocEntry,Object";
                string copyColNm_TM = "U_TAKEYM,U_TAKEDT,U_SERNO,U_ORGNO,U_BANKCD,U_BNKACCT,U_SFILE,U_STOTCNT,U_SFULCNT,U_SFULAMT,U_SPATCNT,U_SPATAMT,U_SMAC,U_BENTRY,U_BTYPE";

                // DETAIL
                string copyColNm_FD = "U_READCD,U_READNM,U_SERNO,U_ORGNO,U_BANKCD,U_BNKACCT,U_BNKHOLD,U_JMNO,U_TEL,U_PAYNO,U_REQAMT,U_PAYTP,U_RMK,U_PMETHOD,U_PAYCD,U_PAPERTP,U_BRCCD,U_BRCNM,U_ZIPCD1,U_ADDR1,U_ADDR1_D,U_ZIPCD2,U_ADDR2,U_ADDR2_D,U_REQYM,U_CNT,U_USEYM,U_CENTGBN";
                string copyColNm_TD = "U_READCD,U_READNM,U_SERNO,U_ORGNO,U_BANKCD,U_BNKACCT,U_BNKHOLD,U_JMNO,U_TEL,U_PAYNO,U_REQAMT,U_PAYTP,U_RMK,U_PMETHOD,U_PAYCD,U_PAPERTP,U_BRCCD,U_BRCNM,U_ZIPCD1,U_ADDR1,U_ADDR1_D,U_ZIPCD2,U_ADDR2,U_ADDR2_D,U_REQYM,U_CNT,U_USEYM,U_CENTGBN";

                SetDBSFromDBSCopy(oForm, string.Format("@KIS_SO0190T_HRD({0})", copyColNm_TM), string.Format("@KIS_SO0180T_HRD({0})", copyColNm_FM), "DocEntry == " + cDocEntry, "DocEntry");
                SetDBSFromDBSCopy(oForm, string.Format("@KIS_SO01901_HRD({0})", copyColNm_TD), string.Format("@KIS_SO01801_HRD({0})", copyColNm_FD), "DocEntry == " + cDocEntry, "U_READCD");

                oMatrix.LoadFromDataSource();

                //oForm.Mode = BoFormMode.fm_OK_MODE;
                //oForm.Mode = BoFormMode.fm_ADD_MODE;
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// 지정된 문서를 DBDatasource로 다시 로드 합니다.
        /// </summary>
        /// <param name="KeyValue">문서번호(DocEntry)</param>
        private void SetFormLoadFromDBDatasource()
        {
            oForm.Freeze(true);
            try
            {
                string cboPUBLICA = oForm.DataSources.UserDataSources.Item("cboPUBLICA").Value;
                string cboYEAR = oForm.DataSources.UserDataSources.Item("cboYEAR").Value;
                string cboMONTH = oForm.DataSources.UserDataSources.Item("cboMONTH").Value;

                oForm.Mode = BoFormMode.fm_OK_MODE;

                SAPbouiCOM.Conditions oCons = new SAPbouiCOM.Conditions();

                SAPbouiCOM.DBDataSource oKIS_SD0170T_HRD = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_SD0170T_HRD");


                SAPbouiCOM.Condition oCon = null;

                oCon = oCons.Add();

                oCon.Alias = "U_PUBLICA";
                oCon.Operation = BoConditionOperation.co_EQUAL;
                oCon.CondVal = cboPUBLICA;

                oCon.Relationship = BoConditionRelationship.cr_AND;

                oCon = oCons.Add();
                oCon.Alias = "U_YEAR";
                oCon.Operation = BoConditionOperation.co_EQUAL;
                oCon.CondVal = cboYEAR;

                if (string.IsNullOrEmpty(cboMONTH) == false)
                {
                    oCon.Relationship = BoConditionRelationship.cr_AND;

                    oCon = oCons.Add();
                    oCon.Alias = "U_MONTH";
                    oCon.Operation = BoConditionOperation.co_EQUAL;
                    oCon.CondVal = cboMONTH;
                }

                oKIS_SD0170T_HRD.Query(oCons);

                oMatrix = oForm.Items.Item("mtx1").Specific;
                oMatrix.LoadFromDataSource();

                //월 데이터
                if (string.IsNullOrEmpty(cboMONTH)==false)
                {
                    FN.SetItemEnable(oForm, "btnADD", true);
                }

                oCon = null;
                oCons = null;

                oKIS_SD0170T_HRD = null;
                /* 아래 코드부터는  ET_AFFormDataLoad 이벤트와 동일하게 설정해준다.*/

                if (oMatrix.VisualRowCount>0)
                {
                    oMatrix.SelectRow(1, true, false);
                }

                SetHeaderValues();

            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oForm.Freeze(false);
            }
        }
Exemplo n.º 23
0
        private void FindData2(SAPbouiCOM.Form oForm)
        {
            
            oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd1").Specific;
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
            SAPbouiCOM.DBDataSource oKIS_HR00203_HRD = oForm.DataSources.DBDataSources.Item("@KIS_HR00203_HRD");
            StringBuilder pQuery = new StringBuilder();
            string sQry = string.Empty;

            oForm.Freeze(true);

            oMatrix.Clear();
            oKIS_HR00203_HRD.Clear();

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

            try
            {

                #region 조회Query
                pQuery.Clear();
                pQuery.AppendLine(" SELECT                                  ");
                pQuery.AppendLine("  U_CHEKER     AS U_CHEKER               ");
                pQuery.AppendLine(" ,U_EMPNO      AS U_EMPNO                ");
                pQuery.AppendLine(" ,U_EMPNM      AS U_EMPNM                ");
                pQuery.AppendLine(" ,U_JIKGBCD    AS U_JIKGBCD              ");
                pQuery.AppendLine(" ,U_JIKCHKCD   AS U_JIKCHKCD             ");
                pQuery.AppendLine(" ,U_DEPTCD     AS U_DEPTCD               ");
                pQuery.AppendLine(" ,U_CHKRATE    AS U_CHKRATE              ");
                pQuery.AppendLine(" FROM [@KIS_HR00203_HRD]                 ");
                pQuery.AppendLine(" WHERE Code = '{0}' AND U_EMPCD <> 'L'   ");
                pQuery.AppendLine(" ORDER BY U_CHEKER                       ");
                sQry = string.Format(pQuery.ToString(), GRIDCODE);
                #endregion

                oRS.DoQuery(sQry);

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


                if (oRS.RecordCount > 0)
                {
                    for (int i = 0; i < oRS.RecordCount; i++)
                    {
                        if (i < oRS.RecordCount)
                        { oKIS_HR00203_HRD.InsertRecord(i); }
                        oKIS_HR00203_HRD.SetValue("U_CHEKER", i, oRS.Fields.Item("U_CHEKER").Value);
                        oKIS_HR00203_HRD.SetValue("U_EMPNO", i, oRS.Fields.Item("U_EMPNO").Value);
                        oKIS_HR00203_HRD.SetValue("U_EMPNM", i, oRS.Fields.Item("U_EMPNM").Value);
                        oKIS_HR00203_HRD.SetValue("U_JIKGBCD", i, oRS.Fields.Item("U_JIKGBCD").Value);
                        oKIS_HR00203_HRD.SetValue("U_JIKCHKCD", i, oRS.Fields.Item("U_JIKCHKCD").Value);
                        oKIS_HR00203_HRD.SetValue("U_DEPTCD", i, oRS.Fields.Item("U_DEPTCD").Value);
                        oKIS_HR00203_HRD.SetValue("U_CHKRATE", i, oRS.Fields.Item("U_CHKRATE").Value);
                        oRS.MoveNext();
                    }
                    oMatrix.LoadFromDataSource();
                    B1Connections.theAppl.StatusBar.SetText("조회완료", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success); //조회완료
                }
                else
                {
                    FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oKIS_HR00203_HRD, FN.RowSelectMode.None, "U_CHEKER");
                    B1Connections.theAppl.StatusBar.SetText("데이터가 없습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터가 없습니다.
                }

            }
            catch (Exception ex)
            {
                oForm.Freeze(false);
                B1Connections.theAppl.StatusBar.SetText("btnFIND_OnAfterItemPressed " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);

            }
            finally
            {
                oForm.Freeze(false);
                oGrid = null;
                oMatrix = null;
                oRS = null;
                oKIS_HR00203_HRD = null;

            }
        }
Exemplo n.º 24
0
        public virtual void ET_mtx1_AFChooseFromList(ItemEvent pVal) {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
            // ADD YOUR ACTION CODE HERE ...
            SAPbouiCOM.DataTable oDataTable = null;
            SAPbouiCOM.DBDataSource oKIS_HR00203_HRD = oForm.DataSources.DBDataSources.Item("@KIS_HR00203_HRD");
            oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
            oDataTable = FN.GetCFLSelectedObjects(pVal);

            if (pVal.ColUID == "U_EMPNO")
            {
                try
                {
                    if (oDataTable != null)
                    {
                        oMatrix.FlushToDataSource();
                        string sQry = " SELECT B.U_DEPTCD FROM [@KIS_HR0120M] A INNER JOIN [@KIS_HR01202] B ON A.Code = B.Code";
                               sQry = sQry + "\r\n" + " WHERE A.U_EMPNO = '" + oDataTable.GetValue("U_EMPNO", 0).ToString() + "'";
                               oRS.DoQuery(sQry);

                        oKIS_HR00203_HRD.SetValue("U_EMPNO", pVal.Row-1, oDataTable.GetValue("U_EMPNO", 0).ToString());
                        oKIS_HR00203_HRD.SetValue("U_EMPNM", pVal.Row - 1, oDataTable.GetValue("U_EMPNM", 0).ToString());
                        oKIS_HR00203_HRD.SetValue("U_DEPTCD", pVal.Row - 1, oRS.Fields.Item("U_DEPTCD").Value);
                        oKIS_HR00203_HRD.SetValue("U_JIKGBCD", pVal.Row - 1, oDataTable.GetValue("U_JIKGBCD", 0).ToString());
                        oKIS_HR00203_HRD.SetValue("U_JIKCHKCD", pVal.Row - 1, oDataTable.GetValue("U_JIKCHCD", 0).ToString());
                        oMatrix.LoadFromDataSource();
                    }
                }
                catch (Exception ex)
                {
                    B1Connections.theAppl.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                }
                finally
                {
                    oRS = null;
                    oDataTable = null;
                    oKIS_HR00203_HRD = null; ;
                }
            }

        }
Exemplo n.º 25
0
        /// <summary>
        /// 저장 전에 필수 항목을 체크 합니다.
        /// </summary>
        /// <param name="oForm"></param>
        /// <returns></returns>
        private bool BeforeSave(SAPbouiCOM.Form oForm)
        {
            SAPbouiCOM.DBDataSource oKIS_SO00401_HRD = oForm.DataSources.DBDataSources.Item("@KIS_SO00401_HRD");

            try
            {
                oMatrix = oForm.Items.Item("mtx1").Specific;

                oMatrix.FlushToDataSource();
                FN.SetDBDataSourceDeleteRow(ref oKIS_SO00401_HRD, "U_CENTCD");
                oMatrix.LoadFromDataSource();


                // 1.필수 항목 체크
                string chkColumnList = string.Empty;
                string chkStaticList = string.Empty;

                chkColumnList = "cboAREA,edtCode,edtName,cboBRCGBN,edtCARDCD,edtCARDNM"; //cboPAPERTP,edtPAYCNT
                chkStaticList = "sttAREA,sttCode,sttName,sttBRCGBN,sttCARDCD,sttCARDNM"; //sttPAPERTP,sttPAYCNT
                if (!FN.CondValidationChk(oForm, chkColumnList, chkStaticList)) return false;


                chkColumnList = "U_CENTCD,U_CENTNM,U_SNM,U_STATUS||U_CENTGBN";
                //if (!FN.ValidationChk(oForm, "mtx1", chkColumnList)) return false;
                if (!SO.SO_COMMON_HRD.ValidationChk(oForm, "mtx1", chkColumnList)) return false;

            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
                return false;
            }
            finally
            {
                oKIS_SO00401_HRD = null;
            }

            return true;
        }
Exemplo n.º 26
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;
            }
        }
Exemplo n.º 27
0
        private void GetDataLoad(SAPbouiCOM.Form oForm, string pCode)
        {            
            SAPbouiCOM.DBDataSource oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0040M_HRD");
            SAPbouiCOM.DBDataSource oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_SO00401_HRD");

            oForm.Freeze(true);
            try
            {
                FN.SetDbsWithConditionsQuery(ref oDB_M, "Code==" + pCode);
                FN.SetDbsWithConditionsQuery(ref oDB_1, "Code==" + pCode);

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

                FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oDB_1, FN.RowSelectMode.None, "U_CENTCD");

                if (oDB_M.Size > 0) oForm.Mode = BoFormMode.fm_OK_MODE;
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oDB_M = null;
                oDB_1 = null;
                oForm.Freeze(false);
            }

        }
Exemplo n.º 28
0
        private void GetDataLoad(SAPbouiCOM.Form oForm, string pDocEntry)
        {

            if (!string.IsNullOrEmpty(pDocEntry))
            {
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0180T_HRD");
                FN.SetDbsWithConditionsQuery(ref oDB_M, "DocEntry==" + pDocEntry);

                oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_SO01801_HRD");
                FN.SetDbsWithConditionsQuery(ref oDB_1, "DocEntry==" + pDocEntry);

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

                string DocEntry = FN.GetDataSourceValue(oForm, "@KIS_SO0180T_HRD.DocEntry");
                string edtBENTRY = FN.GetRecordsetValue(string.Format("SELECT DocEntry FROM [@KIS_SO0190T_HRD] WHERE ISNULL(U_RJDTDOC,'') = '' AND U_BENTRY = {0}", DocEntry));

                FN.SetDataSourceValue(oForm, "edtBENTRY", edtBENTRY);

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


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

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

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


                    mtSearch = (SAPbouiCOM.Matrix)oItem.Specific;

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

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

                    lblCri.Caption = "Find";

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

                    //SAPbouiCOM.StaticText lblCri = oItem.Specific;



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

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

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

                    oform = null;
                }
            }
            catch (Exception ex)
            {
                bLoadInputEvents = false;
            }
        }
Exemplo n.º 30
0
        /// <summary>
        /// 지정된 문서를 DBDatasource로 다시 로드 합니다.
        /// </summary>
        /// <param name="KeyValue">문서번호(DocEntry)</param>
        private void SetFormLoadFromDBDatasource(string KeyValue)
        {
            try
            {
                oForm.Mode = BoFormMode.fm_OK_MODE;
                 
                SAPbouiCOM.Conditions oCons = new SAPbouiCOM.Conditions();

                SAPbouiCOM.DBDataSource oKIS_TR0090T_HRD = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_TR0090T_HRD");
                SAPbouiCOM.DBDataSource oKIS_TR00901_HRD = (SAPbouiCOM.DBDataSource)oForm.DataSources.DBDataSources.Item("@KIS_TR00901_HRD");

                SAPbouiCOM.Condition oCon = null;

                oCon = oCons.Add();

                oCon.Alias = "DocEntry";
                oCon.Operation = BoConditionOperation.co_EQUAL;
                oCon.CondVal = KeyValue;

                oKIS_TR0090T_HRD.Query(oCons);
                oKIS_TR00901_HRD.Query(oCons);

                oMatrix = oForm.Items.Item("mtx1").Specific;
                oMatrix.LoadFromDataSource();

                oCon = null;
                oCons = null;

                oKIS_TR0090T_HRD = null;
                /* 아래 코드부터는  ET_AFFormDataLoad 이벤트와 동일하게 설정해준다.*/

            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
Exemplo n.º 31
0
        private void GetCostCenterList()
        {
            StringBuilder sb = new StringBuilder();
            SAPbobsCOM.Recordset oRS = null;
            string expression = string.Empty;
            System.Data.DataRow[] foundRows;
            int iRow;
            bool bModify = false;
            try
            {
                oForm.Freeze(true);
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_FI0010M_HRD");
                oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_FI00101_HRD");

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

                oMatrix.Clear();
                FN.SetMatrixIsNullOrEmptDeleteRow(ref oForm, ref oMatrix, "U_PRCCD");

                sDataTable = FN.SapDBDataSourceToSystemDataTable(oDB_1);

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

                sb.Append(" SELECT Code,Name FROM [@KIS_CO0110M]                               \r");

                if (FN.GetItemValue(ref oForm, "edtCOSTFR") != "" && FN.GetItemValue(ref oForm, "edtCOSTTO") != "")
                    sb.Append("    WHERE Code BETWEEN '" + FN.GetItemValue(ref oForm, "edtCOSTFR") + "' AND '" + FN.GetItemValue(ref oForm, "edtCOSTTO") + "' \r");

                B1Connections.theAppl.StatusBar.SetText("불러오기를 시작합니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning);
                oRS.DoQuery(sb.ToString());

                iRow = oMatrix.VisualRowCount;
                if (!oRS.EoF)
                {
                    for (int i = 0; i < oRS.RecordCount; i++)
                    {
                        expression = "U_PRCCD = '" + oRS.Fields.Item("Code").Value.ToString() + "'";
                        foundRows = sDataTable.Select(expression);

                        if (foundRows.Length < 1)
                        {
                            if (iRow != 0)
                                oDB_1.InsertRecord(iRow-1);

                            //oDB_1.SetValue("U_LINENUM", iRow, (iRow+1).ToString());
                            oDB_1.SetValue("U_PRCCD", iRow, oRS.Fields.Item("Code").Value.ToString());
                            oDB_1.SetValue("U_PRCNM", iRow, oRS.Fields.Item("Name").Value.ToString());

                            iRow += 1;
                            bModify = true;
                        }
                        oRS.MoveNext();
                    }
                    if (bModify)
                    {
                        oMatrix.LoadFromDataSource();
                        if (oForm.Mode == BoFormMode.fm_OK_MODE)
                            oForm.Mode = BoFormMode.fm_UPDATE_MODE;
                    }
                }
                B1Connections.theAppl.StatusBar.SetText("불러오기가 완료 되었습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다
            }
            catch (Exception ex)
            {
                oForm.Freeze(false);
                B1Connections.theAppl.StatusBar.SetText("GetCostCenterList " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                if (oRS != null)
                {
                    oForm.Freeze(false);
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(oRS);
                    oRS = null;
                }
            }
        }
        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
Exemplo n.º 33
0
        private void getDocs()
        {
            string strWhs = "";

            foreach (string whs in userWhs)
            {
                if (strWhs == "")
                {
                    strWhs = "'" + whs + "'";
                }
                else
                {
                    strWhs += " ,'" + whs + "'";
                }
            }

            string strOT = "";

            foreach (string ot in userOT)
            {
                if (strOT == "")
                {
                    strOT = "'" + ot + "'";
                }
                else
                {
                    strOT += " ,'" + ot + "'";
                }
            }

            if (strOT == "" || strWhs == "")
            {
                return;
            }
            string strDocs = "  SELECT t0.\"Comments\" , t0.\"TransType\", t0.BASE_REF,t0.\"CreatedBy\", t1.\"Name\" , t1.\"U_TblScm\" FROM OINM t0 INNER JOIN \"@B1_QA_OBJS\" t1 ON t0.\"TransType\" = CAST(t1.\"Code\" AS integer)  ";

            strDocs += " WHERE t0.\"InQty\" > 0 AND t0.\"Warehouse\" IN (" + strWhs + ") AND  t0.\"TransType\" IN (" + strOT + ") " +
                       " AND  NOT EXISTS (SELECT tObj.\"U_ObjType\" FROM \"@B1_QA_DOC\" tObj WHERE tObj.\"U_Final\" = 'Y' AND  tObj.\"U_ObjType\" = t0.\"TransType\" AND tObj.\"U_DocEntry\" =  t0.\"CreatedBy\" ) " +
                       "GROUP BY  t0.\"TransType\", t0.BASE_REF,t0.\"CreatedBy\", t1.\"Name\", t1.\"U_TblScm\" ,t0.\"Comments\" ";

            System.Data.DataTable dtdocs = Program.objHrmsUI.getDataTable(strDocs, "getting docs");
            int i = 0;

            dtDoc.Rows.Clear();
            foreach (System.Data.DataRow dr in dtdocs.Rows)
            {
                string DocType   = dr["Name"].ToString();
                string transType = dr["TransType"].ToString();
                if (transType == "59")
                {
                    string DE         = dr["CreatedBy"].ToString();
                    string strProdNum = "SELECT \"U_B1_QA_INSP_PN\" FROM \"OIGN\" WHERE \"DocEntry\" ='" + DE + "'";
                    System.Data.DataTable dtProdNum = Program.objHrmsUI.getDataTable(strProdNum, "ProdNum");
                    if (dtProdNum != null && dtProdNum.Rows.Count > 0)
                    {
                        if (dtProdNum.Rows[0]["U_B1_QA_INSP_PN"] != DBNull.Value && Convert.ToInt32(dtProdNum.Rows[0]["U_B1_QA_INSP_PN"]) > 0)
                        {
                            DocType = "Offer for Inspection";
                        }
                    }
                }
                i++;
                dtDoc.Rows.Add(1);
                dtDoc.SetValue("Id", i - 1, i.ToString());
                dtDoc.SetValue("DE", i - 1, dr["CreatedBy"].ToString());
                dtDoc.SetValue("DN", i - 1, dr["BASE_REF"].ToString());
                dtDoc.SetValue("DT", i - 1, DocType);
                dtDoc.SetValue("Tbl", i - 1, dr["U_TblScm"].ToString());
                dtDoc.SetValue("OT", i - 1, dr["TransType"].ToString());
            }
            mtDocs.LoadFromDataSource();
        }
Exemplo n.º 34
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;
        }
Exemplo n.º 35
0
        public override void etAfterClick(ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent)
        {
            base.etAfterClick(ref pVal, ref BubbleEvent);

            if (pVal.ItemUID == mtOSCN.Item.UniqueID)
            {
                if (pVal.ColUID == "Id" && pVal.Row > 0)
                {
                    getOSCNDetail();
                }
            }

            if (pVal.ItemUID == mtOSCN.Item.UniqueID)
            {
                if (pVal.ColUID == "Id" && pVal.Row > 0)
                {
                    getOSCNDetail();
                }
            }

            if (pVal.ItemUID == "btUC")
            {
                updateOSCN();
            }

            if (pVal.ItemUID == "btOAdd")
            {
                addOSCN();
            }
            if (pVal.ItemUID == "btImg")
            {
                addAttacment();
            }
            if (pVal.ItemUID == "tbTS")
            {
                currentTab = "TS";
                getSchedule();
            }
            if (pVal.ItemUID == "tbSO")
            {
                currentTab = "SO";
                getSchedule();
            }

            if (pVal.ItemUID == "1")
            {
                updateSchedule();
            }
            if (pVal.ItemUID == "btAddDt")
            {
                string cardCode = Convert.ToString(dtHead.GetValue("CardCode", 0));

                addMODT(cardCode);
            }
            if (pVal.ItemUID == "btRemDt")
            {
                string cardCode = Convert.ToString(dtHead.GetValue("CardCode", 0));

                remMODT(cardCode);
            }
            if (pVal.ItemUID == "btAddWD")
            {
                string cardCode = Convert.ToString(dtHead.GetValue("CardCode", 0));

                addMODay(cardCode);
            }

            if (pVal.ItemUID == "btRemWD")
            {
                string cardCode = Convert.ToString(dtHead.GetValue("CardCode", 0));

                remMODay(cardCode);
            }


            if (pVal.ItemUID == "btAdd")
            {
                addSOItem();
            }
            if (pVal.ItemUID == "btOTAdd")
            {
                string cardCode = Convert.ToString(dtHead.GetValue("CardCode", 0));
                string otDT     = Convert.ToString(dtHead.GetValue("otDT", 0));
                if (cardCode == "")
                {
                    oApplication.MessageBox("Select Customer"); return;
                }
                if (otDT == "")
                {
                    oApplication.MessageBox("Select Date"); return;
                }

                addOT(cardCode);
            }

            if (pVal.ItemUID == "btRem")
            {
                int    selRow = mtSelRow(mtItem);
                string rowId  = Convert.ToString(dtItem.GetValue("Id", selRow - 1));
                dtItem.Rows.Remove(selRow - 1);
                mtItem.LoadFromDataSource();


                string strInsert = " Delete From  [@B1_SO] where  Code='" + rowId + "'";
                Program.objHrmsUI.ExecQuery(strInsert, "Delete SO Item");
            }
            if (pVal.ItemUID == "btOTRem")
            {
                int    selRow = mtSelRow(mtOT);
                string rowId  = Convert.ToString(dtOT.GetValue("Id", selRow - 1));
                dtOT.Rows.Remove(selRow - 1);
                mtOT.LoadFromDataSource();


                string strInsert = " Delete From [@B1_SCHOT] where  Code='" + rowId + "'";
                Program.objHrmsUI.ExecQuery(strInsert, "Delete OT Date");
            }
        }
Exemplo n.º 36
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;
            }
        }
Exemplo n.º 37
0
        private void GetDataLoad(SAPbouiCOM.Form oForm, string pDocEntry)
        {
            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0280T_HRD");
            oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_SO02801_HRD");

            //헤더데이터를 조회
            QueryWithConditions(ref oDB_M, "DocEntry", pDocEntry);
            if (oDB_M.Size > 0)
            {
                //헤더를 기준으로 라인데이터 조회
                QueryWithConditions(ref oDB_1, "DocEntry", oDB_M.GetValue("DocEntry", 0));

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

            SetButtonEnabled(oForm);
        }
Exemplo n.º 38
0
        private void SetApplyDataToParentForm(SAPbouiCOM.Form oForm)
        {
            pForm = B1Connections.theAppl.Forms.Item(oForm.DataSources.UserDataSources.Item("pFORMUID").ValueEx);

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

                string COM = oForm.DataSources.UserDataSources.Item("extCOM").Value;
                SAPbouiCOM.DBDataSource oDB_1 = pForm.DataSources.DBDataSources.Item("@KIS_SO00302_HRD");
                SAPbouiCOM.DBDataSource oDB_1Z = pForm.DataSources.DBDataSources.Item("@KIS_SO00302Z_HRD");

                int pRow = Convert.ToInt16(oForm.DataSources.UserDataSources.Item("pRows").Value);

                oDB_1.SetValue("U_MEMO", pRow - 1, COM);
                oDB_1Z.SetValue("U_MEMO", pRow - 1, COM);

                pForm.DataSources.UserDataSources.Item("cRow").ValueEx = pRow.ToString(); ;
                oMatrix.LoadFromDataSource();

            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                pForm.Freeze(false);
                if (pForm != null) { Marshal.ReleaseComObject(pForm); } pForm = null;
            }
        }
Exemplo n.º 39
0
        private void SetMatrixRemoveBlankRow()
        {
            oMatrix = oForm.Items.Item("mtx1").Specific;

            oMatrix.FlushToDataSource();

            SAPbouiCOM.DBDataSource oKIS_SD00501_HRD = oForm.DataSources.DBDataSources.Item("@KIS_SD00501_HRD");

            FN.SetDBDataSourceDeleteRow(ref oKIS_SD00501_HRD, "U_ITMGRPCD");

            oMatrix.LoadFromDataSource();

            SetMatrixRowNumbering(oMatrix, "U_LINENUM");
        }
Exemplo n.º 40
0
        public virtual bool ET_1_BFItemPressed(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oButton = ((SAPbouiCOM.Button)(oForm.Items.Item("1").Specific));
            
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                oForm.Freeze(true);

                switch (oForm.Mode)
                {
                    case BoFormMode.fm_ADD_MODE:
                        if (!FN.CondValidationChk(oForm, "cboREQYM,edtREQDT,edtAPPDT", "sttREQYM,sttREQDT,sttAPPDT")) 
                            return false;

                        string DocEntry = CreateDoc(oForm);

                        if (!string.IsNullOrEmpty(DocEntry))
                        {
                            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0160T_HRD");
                            FN.SetDbsWithConditionsQuery(ref oDB_M, "DocEntry==" + DocEntry);

                            oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_SO01601_HRD");
                            FN.SetDbsWithConditionsQuery(ref oDB_1, "DocEntry==" + DocEntry);

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

                            oForm.Mode = BoFormMode.fm_OK_MODE;
                        }

                        return false;

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

            //FN.GetRecordsetValue("EXEC [KIS_SP_ADDON] @work_type = 'I', @object_type = 'KIS_SO0160_HRD'");
            return true;
        }
Exemplo n.º 41
0
        public virtual bool ET_BFFormDataUpdate(BusinessObjectInfo pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            // ADD YOUR ACTION CODE HERE ...
            oForm.Freeze(true);
            try
            {
                oMatrix = oForm.Items.Item("mtx1").Specific;

                SAPbouiCOM.DBDataSource oKIS_SD00301_HRD = oForm.DataSources.DBDataSources.Item("@KIS_SD00301_HRD");

                FN.SetDBDataSourceDeleteRow(ref oKIS_SD00301_HRD, "U_ITMGRPCD");

                oMatrix.LoadFromDataSource();

                SetMatrixRowNumbering(oMatrix, "U_LINENUM");

            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oForm.Freeze(false);
            }
            return true;
        }
Exemplo n.º 42
0
        private bool GetMonth() 
        {
            int iRow;
            bool bModify = false;
            try
            {
                oForm.Freeze(true);
                oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_FI0020M_HRD");
                oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_FI00201_HRD");

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

                oMatrix.Clear();
                string Year = oForm.Items.Item("Code").Specific.value.Trim();
                YYYYCode = Year;
                int Month = 1;
                string YYYYMM = "";
                iRow = oMatrix.VisualRowCount;

                for (int i = 0; i < 12; i++)
                {
                    if (Month.ToString().Length == 1)
                    {
                        YYYYMM = Year + "0" + Month.ToString();
                    }
                    else
                    {
                        YYYYMM = Year + Month.ToString();
                    }
                    oDB_1.InsertRecord(iRow);

                    oDB_1.SetValue("U_YYYYMM", iRow, YYYYMM);

                    Month = Month + 1;
                    iRow += 1;
                    bModify = true;
                    if (i == 11)
                        oDB_1.RemoveRecord(iRow);
                }
                if (bModify)
                {
                    oMatrix.LoadFromDataSource();
                }

                //B1Connections.theAppl.StatusBar.SetText("저장이 완료 되었습니다.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //데이터 조회중입니다
            }
            catch (Exception ex)
            {
                oForm.Freeze(false);
                B1Connections.theAppl.StatusBar.SetText("GetCostCenterList " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                return false;
            }
            finally
            {
                oForm.Freeze(false);
                oRS = null;
            }
            return true;
        }
Exemplo n.º 43
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;
        }
Exemplo n.º 44
0
        private void GetDataLoad(SAPbouiCOM.Form oForm, Dictionary<string, string> pDictionary)
        {
            oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0290M_HRD");
            oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_SO02901_HRD");

            //헤더데이터를 조회
            QueryWithConditions(ref oDB_M, pDictionary);
            if (oDB_M.Size > 0)
            {
                //헤더를 기준으로 라인데이터 조회
                QueryWithConditions(ref oDB_1, "DocEntry", oDB_M.GetValue("DocEntry", 0));
                oForm.Mode = BoFormMode.fm_OK_MODE;

                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx").Specific;
                oMatrix.LoadFromDataSource();
            }
            else
            {
                // 아무것도 없는 마스터에 값을 입력할려고 하면 오류 발생 
                // 폼 모드 Add모드로 강제로 전환 하고 데이터 입력해야함.
                oForm.Mode = BoFormMode.fm_ADD_MODE;
                if (pDictionary != null)
                {
                    foreach (KeyValuePair<string, string> item in pDictionary)
                    {
                        switch (item.Key.ToString())
                        {
                            case "U_PAPERTP":
                                oDB_M.SetValue(item.Key.ToString(), 0, item.Value.ToString());
                                break;
                            case "U_CENTCD":
                                oDB_M.SetValue(item.Key.ToString(), 0, item.Value.ToString());
                                break;
                            case "U_BRCHCD":
                                oDB_M.SetValue(item.Key.ToString(), 0, item.Value.ToString());
                                break;
                            default:
                                break;
                        }
                    }
                }
            }
        }
Exemplo n.º 45
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();
        }
        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
Exemplo n.º 47
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;
            }
        }
Exemplo n.º 48
0
        private void loadInvoice()
        {
            if (txNum.Value.ToString() == "")
            {
                return;
            }
            dtDetail.Rows.Clear();
            mtDet.LoadFromDataSource();
            oForm.Items.Item("txCode").Specific.Value  = "";
            oForm.Items.Item("txCName").Specific.Value = "";
            string userCode = oCompany.UserName;

            string strQuery = "SELECT oinv.cardcode,oinv.cardname, inv1.docentry, dbo.INV1.LineNum, dbo.INV1.ItemCode, dbo.INV1.Dscription, dbo.INV1.ShipDate, dbo.INV1.U_DelShift, dbo.INV1.U_DelTypCd, dbo.INV1.U_PickDate, dbo.INV1.U_PickShift, dbo.INV1.U_DeliveryWH,  ";

            strQuery += " dbo.INV1.U_PickingWh , isnull(dbo.OUSR.user_code,'') as Owner , isnull(dbo.OUSR.SUPERUSER,'N') as SUPERUSER    FROM   dbo.INV1 INNER JOIN  dbo.OINV ON dbo.INV1.DocEntry = dbo.OINV.DocEntry  ";
            strQuery += "  INNER JOIN ohem on ohem.empid = oinv.ownercode inner join  dbo.OUSR ON ohem.userid = dbo.OUSR.USERID inner join owhs on inv1.whscode = owhs.whscode ";
            strQuery += " where oinv.docnum='" + txNum.Value.ToString() + "'  and '" + userCode + "' in ('manager', isnull(dbo.OUSR.User_Code,'') , owhs.u_WhsSprv ) ";


            strQuery = @"SELECT        dbo.OINV.CardCode, dbo.OINV.CardName, dbo.INV1.DocEntry, dbo.INV1.LineNum, dbo.INV1.ItemCode, dbo.INV1.Dscription, dbo.INV1.ShipDate, dbo.INV1.U_DelShift, dbo.INV1.U_DelTypCd, dbo.INV1.U_PickDate, 
                         dbo.INV1.U_PickShift, dbo.INV1.U_DeliveryWH, dbo.INV1.U_PickingWh , 'manager' as Owner
FROM            dbo.INV1 INNER JOIN
                         dbo.OINV ON dbo.INV1.DocEntry = dbo.OINV.DocEntry
WHERE        (dbo.OINV.DocNum = '" + txNum.Value.ToString() + @"') ";

            //    oApplication.SetStatusBarMessage(strQuery);
            System.Data.DataTable dtRows = Program.objHrmsUI.getDataTable(strQuery, "Getting invoice detail");



            int i = 0;

            if (dtRows != null && dtRows.Rows.Count > 0)
            {
                string userName   = dtRows.Rows[0]["Owner"].ToString();
                bool   isnotSuper = !issuperUser(oCompany.UserName);
                //if ((isnotSuper) && (oCompany.UserName != userName))
                //{
                //    oApplication.MessageBox("You are not authorize to update this document");
                //   // txNum.Value = "";
                //    return;
                //}
                oForm.Items.Item("txCode").Specific.Value  = dtRows.Rows[0]["cardcode"].ToString();
                oForm.Items.Item("txCName").Specific.Value = dtRows.Rows[0]["cardname"].ToString();

                foreach (DataRow dr in dtRows.Rows)
                {
                    dtDetail.Rows.Add(1);
                    dtDetail.SetValue("DocEntry", i, dr["DocEntry"].ToString());

                    dtDetail.SetValue("LineNum", i, dr["LineNum"].ToString());
                    dtDetail.SetValue("ItemCode", i, dr["ItemCode"].ToString());
                    dtDetail.SetValue("ItemName", i, dr["Dscription"].ToString());
                    dtDetail.SetValue("DelDate", i, Convert.ToDateTime(dr["shipdate"]));
                    dtDetail.SetValue("DelShift", i, dr["U_DelShift"].ToString());
                    dtDetail.SetValue("nDelDate", i, Convert.ToDateTime(dr["shipdate"]));
                    dtDetail.SetValue("nDelShift", i, dr["U_DelShift"].ToString());

                    if (dr["U_PickDate"] != null && Convert.ToDateTime(dr["U_PickDate"]) > Convert.ToDateTime("1/1/2000"))
                    {
                        dtDetail.SetValue("PickDate", i, Convert.ToDateTime(dr["u_PickDate"]));
                        dtDetail.SetValue("nPickDate", i, Convert.ToDateTime(dr["u_PickDate"]));
                    }
                    dtDetail.SetValue("PickShift", i, dr["U_PickShift"].ToString());
                    dtDetail.SetValue("nPickShift", i, dr["U_PickShift"].ToString());

                    dtDetail.SetValue("TypeCode", i, dr["U_DelTypCd"].ToString());
                    dtDetail.SetValue("DelWhs", i, dr["U_DeliveryWH"].ToString());
                    dtDetail.SetValue("PickWhs", i, dr["U_PickingWh"].ToString());


                    i++;
                }
                mtDet.LoadFromDataSource();
            }
            else
            {
                oApplication.MessageBox("Invoice not found");
            }
        }