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

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

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

            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
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;
            }
        }
示例#3
0
        public virtual bool ET_mtx2_DUMY_BFClick(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx2_DUMY").Specific));
            // ADD YOUR ACTION CODE HERE ...

            string USERID = string.Empty;

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

            iRightRowIndex = pVal.Row;

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

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

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

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


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

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

                    oCreationPackage = null;

                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            return true;
        }
示例#5
0
        /// <summary>
        /// 메트릭스의 컬럼 수수료율을 일괄 조종합니다.
        /// </summary>
        /// <param name="oColumnuid">컬럼UID</param>
        /// <param name="Rate">수수료율</param>
        private void SetMatrixRateColumn(string oColumnuid , string Rate)
        {
            oMatrix = oForm.Items.Item("mtx1").Specific;

            for (int iLooper = 1; iLooper <= oMatrix.VisualRowCount; iLooper++)
            {
                string U_ITMGRPCD = ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("U_ITMGRPCD", iLooper)).Value;
                if (string.IsNullOrEmpty(U_ITMGRPCD) == false)
                {
                    oMatrix.SetCellWithoutValidation(iLooper, oColumnuid, Rate);
                    SetCalc(oColumnuid, iLooper);
                }
            }

            SetMatrixCalc_Sum();
        }
示例#6
0
        private static void flushAll()
        {
            SAPbouiCOM.Grid oGrid;
            oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("4").Specific;
            SAPbouiCOM.DataTable dtHistory = oGrid.DataTable;
            oSOForm.Freeze(true);

            try
            {
                using (var progress = SboProgressBar.Create("Please Wait while system prepare sales order for selected item(s) ", 100, oForm, 400))
                {
                    System.Data.DataTable dtSelItems = new System.Data.DataTable();
                    dtSelItems.Columns.Add("ItemCode");
                    dtSelItems.Columns.Add("Quantity");
                    dtSelItems.Columns.Add("Price");
                    dtSelItems.Columns.Add("UOM");



                    int rowCount = 1;

                    for (int dtrown = 0; dtrown < dtHistory.Rows.Count; dtrown++)
                    {
                        string strQty = dtHistory.GetValue("Order Qty", dtrown).ToString().Trim();

                        if (strQty != "0" && strQty != "")
                        {
                            string strItemCode = oGrid.DataTable.GetValue("ItemCode", dtrown).ToString().Trim();
                            string strPrice    = oGrid.DataTable.GetValue("Current Purchase Price", dtrown).ToString().Trim();
                            string strUoM      = oGrid.DataTable.GetValue("UoM", dtrown).ToString().Trim();

                            dtSelItems.Rows.Add(strItemCode, strQty, strPrice, strUoM);



                            rowCount++;
                        }
                    }

                    if (dtSelItems.Rows.Count > 0)
                    {
                        for (int m = oMatrix.RowCount; m >= 1; m--)
                        {
                            oMatrix.DeleteRow(1);
                        }

                        progress.Value += 10;

                        rowCount = 1;
                        oMatrix.AddRow(dtSelItems.Rows.Count);
                        int incrmentVal = 90 / dtSelItems.Rows.Count;

                        foreach (System.Data.DataRow dr in dtSelItems.Rows)
                        {
                            if (progress.Value <= 100)
                            {
                                progress.Value += incrmentVal;
                            }
                            progress.Text = "Please Wait while system prepare document for selected item(s) " + dr["ItemCode"].ToString();
                            ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("1", rowCount)).Value  = dr["ItemCode"].ToString();
                            ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("11", rowCount)).Value = dr["Quantity"].ToString();
                            try
                            {
                                ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("1470002145", rowCount)).Value = dr["UOM"].ToString();
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("14", rowCount)).Value = dr["Price"].ToString();
                            }
                            catch (Exception)
                            {
                            }

                            rowCount++;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                oSOForm.Freeze(false);
            }
        }
示例#7
0
        public virtual void ET_mtx1_OnLostFocus(ItemEvent pVal) {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
            // ADD YOUR ACTION CODE HERE ...

            SAPbouiCOM.DBDataSource oKIS_HR00101_HRD = oForm.DataSources.DBDataSources.Item("@KIS_HR00101_HRD");
            if (pVal.ColUID == "U_DTCD" && oMatrix.GetCellSpecific("U_DTCD", pVal.Row).ToString() != "")
            {
                oForm.Freeze(true);
                FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oKIS_HR00101_HRD, FN.RowSelectMode.None, "U_DTCD");
                oForm.Freeze(false);
            }
        }
示例#8
0
        /// <summary>
        /// 선택된 메트릭스의 행값을 헤더의 텍스트 박스에 반영합니다.
        /// </summary>
        private void SetHeaderValues()
        {
            try
            {
                oMatrix = oForm.Items.Item("mtx1").Specific;

                int SelectRowNumber = oMatrix.GetNextSelectedRow();

                if (SelectRowNumber > 0)
                {
                    oForm.DataSources.UserDataSources.Item("edtDOCNUM").Value = ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("DocEntry", SelectRowNumber)).Value; ;
                    oForm.DataSources.UserDataSources.Item("edtYEAR").Value = ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("U_YEAR", SelectRowNumber)).Value;
                    oForm.DataSources.UserDataSources.Item("edtMONTH").Value = ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("U_MONTH", SelectRowNumber)).Value;
                    oForm.DataSources.UserDataSources.Item("edtWEEK").Value = ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("U_WEEK", SelectRowNumber)).Value;

                    oForm.DataSources.UserDataSources.Item("edtFRDT").Value = ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("U_FRDT", SelectRowNumber)).Value;
                    oForm.DataSources.UserDataSources.Item("edtTODT").Value = ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("U_TODT", SelectRowNumber)).Value;
                    oForm.DataSources.UserDataSources.Item("edtAMT").Value = ((SAPbouiCOM.EditText)oMatrix.GetCellSpecific("U_PLANSUM", SelectRowNumber)).Value;
                }
                else
                {
                    oForm.DataSources.UserDataSources.Item("edtDOCNUM").Value = "";
                    oForm.DataSources.UserDataSources.Item("edtYEAR").Value = "";
                    oForm.DataSources.UserDataSources.Item("edtMONTH").Value = "";
                    oForm.DataSources.UserDataSources.Item("edtWEEK").Value = "";

                    oForm.DataSources.UserDataSources.Item("edtFRDT").Value = "";
                    oForm.DataSources.UserDataSources.Item("edtTODT").Value = "";
                    oForm.DataSources.UserDataSources.Item("edtAMT").Value = "";
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            
        }