Ejemplo n.º 1
0
 private void LastSelectedMatrixRow_Select(SAPbouiCOM.Form oForm)
 {
     oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_DUMY").Specific;
     if (gDeliverySelect > 0)
     {
         if (oMatrix.VisualRowCount >= gDeliverySelect)
         {
             if (!oMatrix.IsRowSelected(gDeliverySelect))
                 oMatrix.SelectRow(gDeliverySelect, true, false);
         }
     }
 }
Ejemplo n.º 2
0
        public virtual void ET_mtx2_DUMY_AFClick(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx2_DUMY").Specific));
            // ADD YOUR ACTION CODE HERE ...
            if (pVal.Row > 0)
            {
                //1. 콜리스트를 선택하면 배달코드를 찾아 자동으로 선택되도록 한다.
                oMatrix.SelectRow(pVal.Row, true, false);


                // 1-1 콜리스트 선택된 것에서 배달코드를 찾는다.
                string strDeliveryCode = FN.GetMatirxCellValue(ref oMatrix, "U_DELVCD", pVal.Row);

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

                // 2. 배달코드로 배송리스트에서 메트릭스의 행을 찾는다.
                var obj_Deliver = from row in gDs.Tables[oForm.UniqueID + "_Deliver"].AsEnumerable()
                                  where row.Field<string>("DELVCD") == strDeliveryCode
                                  select new
                                  {
                                      vIDX = row.Field<Int32>("IDX")
                                  };

                oMatrix1.SelectRow(obj_Deliver.Take(1).SingleOrDefault().vIDX +1, true, false);
                sFindTY = "F";

            }
            if (oForm.Settings.MatrixUID != pVal.ItemUID)
            {
                oForm.Freeze(true);
                oForm.Settings.MatrixUID = pVal.ItemUID;
                oMatrix.AutoResizeColumns();
                oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1_DUMY").Specific));
                oMatrix.AutoResizeColumns();
                oForm.Freeze(false);
            }
        }
Ejemplo n.º 3
0
        private bool DeleteMatrixRows_CALL(string pDeliveryCode)
        {
            bool bRtnValue = true;
            System.Data.DataRow[] findRows = null;
            string strIdx = string.Empty;
            int iBtnValue = -1;
            try
            {
                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_ORIG").Specific;
                findRows = gDs.Tables[oForm.UniqueID + "_Call"].Select(string.Format(" DELVCD = '{0}' ", pDeliveryCode));

                // 1. 메트릭스 삭제대상 삭제 적용
                if (findRows.Count() > 0)
                {
                    iBtnValue = B1Connections.theAppl.MessageBox("상담이력이 존재 합니다. 삭제하시겠습니까?", 1, "&Yes", "&No", "");

                    if (iBtnValue == 1)
                    {
                        foreach (System.Data.DataRow dr in findRows)
                        {
                            //삭제할것들 선택한다.
                            strIdx = dr["IDX"].ToString();
                            oMatrix.SelectRow(int.Parse(strIdx) + 1, true, true);

                            gDs.Tables[oForm.UniqueID + "_Call"].Rows.Remove(dr);
                        }

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

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

            catch (Exception)
            {
                bRtnValue = false;
                throw;
            }
            finally
            {
                findRows = null;
            }
            return bRtnValue;
        }
Ejemplo n.º 4
0
        public virtual bool ET_mtx_BFClick(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx").Specific));
            // ADD YOUR ACTION CODE HERE ...

            try
            {
                if (pVal.Row > 0)
                {
                    if (oMatrix.VisualRowCount >= pVal.Row)
                    {
                        if (oMatrix.IsRowSelected(pVal.Row) != true)
                        {
                            oMatrix.SelectRow(pVal.Row, true, false);
                        }
                    }
                }
            }
            catch (Exception ex)
            {

                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            return true;
        }
Ejemplo n.º 5
0
 public virtual void ET_mtx1_DUMY_AFClick(ItemEvent pVal)
 {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1_DUMY").Specific));
     // ADD YOUR ACTION CODE HERE ...
     if (pVal.Row > 0)
     {
         oMatrix.SelectRow(pVal.Row, true, false);
         gDeliverySelect = pVal.Row;
     }
     if (oForm.Settings.MatrixUID != pVal.ItemUID)
     {
         oForm.Freeze(true);
         oForm.Settings.MatrixUID = pVal.ItemUID;
         oMatrix.AutoResizeColumns();
         oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx2_DUMY").Specific));
         oMatrix.AutoResizeColumns();
         oForm.Freeze(false);
     }
 }
Ejemplo n.º 6
0
        public override void etAfterActClick(ref ItemEvent pVal, ref bool BubbleEvent)
        {
            base.etAfterActClick(ref pVal, ref BubbleEvent);
            if (pVal.ItemUID == "btFinal")
            {
                int confirm = oApplication.MessageBox("Are you sure you want to post stock?", 2, "Yes", "No");
                if (confirm == 1)
                {
                    int postingStatus  = -1;
                    int trsnsferResult = -1;
                    int selRow         = mtSelRow(mtDocs);
                    if (selRow > 0)
                    {
                        string strCode = Convert.ToString(dtDoc.GetValue("OT", selRow - 1));
                        string dn      = Convert.ToString(dtDoc.GetValue("DE", selRow - 1));
                        string docType = Convert.ToString(dtDoc.GetValue("DT", selRow - 1));
                        if (docType == "Offer for Inspection")
                        {
                            string strProdNum = "SELECT \"U_B1_QA_INSP_PN\" FROM \"OIGN\" WHERE \"DocEntry\" ='" + dn + "'";
                            System.Data.DataTable dtProdNum = Program.objHrmsUI.getDataTable(strProdNum, "ProdNum");
                            if (dtProdNum != null && dtProdNum.Rows.Count > 0)
                            {
                                if (dtProdNum.Rows[0]["U_B1_QA_INSP_PN"] != DBNull.Value && Convert.ToInt32(dtProdNum.Rows[0]["U_B1_QA_INSP_PN"]) > 0)
                                {
                                    postingStatus = ReleaseInspaction(dn);
                                }
                            }
                        }
                        else
                        {
                            postingStatus = PostTransfer(strCode, dn);
                        }
                        string strDocCode = strCode + "-" + dn;
                        if (strCode.Trim() != "" && postingStatus != -1)
                        {
                            string strInsert = "UPDATE   \"@B1_QA_DOC\"  SET \"U_Date\" = '" + DateTime.Now.ToString("yyyyMMdd") + "' ,  \"U_Final\"='Y' ,  \"U_WTRentry\" = '" + postingStatus + "'   WHERE \"Code\" = '" + strDocCode + "'";
                            Program.objHrmsUI.ExecQuery(strInsert, "Finalllizing Inspaction");
                        }
                    }


                    //
                    _iniForm();

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

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

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


                    mnus.Item(printMenuId).Activate();

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

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

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

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

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

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


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

                string strCode = RC + "-" + SBC;

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

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

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

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



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

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


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

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



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

                    dtHead.SetValue("SBC", 0, strCode);
                    getReport(RC + "-" + strCode, OBT, DE, LN, MM, strQty, ItemCode, strCode);
                }
            }
        }
Ejemplo n.º 7
0
        public override void etAfterClick(ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent)
        {
            base.etAfterClick(ref pVal, ref BubbleEvent);
            if (pVal.ItemUID == opG.Item.UniqueID || pVal.ItemUID == opI.Item.UniqueID)
            {
                if (opI.Selected)
                {
                    txCode.ChooseFromListUID   = "cflCode";
                    txCode.ChooseFromListAlias = "CardCode";
                }
                else
                {
                    txCode.ChooseFromListUID   = "cflGroup";
                    txCode.ChooseFromListAlias = "ItmsGrpCod";
                }
                getCodes();
            }

            if (pVal.ItemUID == btAdd.Item.UniqueID)
            {
                string code     = Convert.ToString(dtHead.GetValue("Code", 0));
                string name     = Convert.ToString(dtHead.GetValue("Name", 0));
                string codeType = opG.Selected ? "Group" : "Item";
                string strCode  = Program.objHrmsUI.getMaxId("@B1_QA_ATTR_CODES", "Code").ToString();
                if (code != "")
                {
                    string strInsert = "INSERT INTO \"@B1_QA_ATTR_CODES\" (\"Code\",\"Name\",\"U_Descr\",\"U_CodeType\") VALUES ('" + strCode + "','" + code + "','" + name + "','" + codeType + "')";


                    Program.objHrmsUI.ExecQuery(strInsert, "Insert New Code");
                    dtHead.SetValue("Code", 0, "");
                    dtHead.SetValue("Name", 0, "");
                    getCodes();
                }
                else
                {
                    oApplication.MessageBox("Please select Code");
                }
            }


            if (pVal.ItemUID == btAddA.Item.UniqueID)
            {
                int selListRow = mtSelRow(mtList);

                string IGcode   = Convert.ToString(dtList.GetValue("Code", selListRow - 1));
                string codeType = opG.Selected ? "Group" : "Item";
                int    selRow   = mtSelRow(mtA);
                if (selRow > 0)
                {
                    string strCode  = Convert.ToString(dtA.GetValue("Code", selRow - 1));
                    string strNCode = Program.objHrmsUI.getMaxId("@B1_QA_CODES_ATTR", "Code").ToString();

                    string strInsert = "INSERT INTO  \"@B1_QA_CODES_ATTR\" (\"Code\",\"Name\",\"U_IGCode\") VALUES ('" + strNCode + "','" + strCode + "','" + IGcode + "')";


                    Program.objHrmsUI.ExecQuery(strInsert, "Insert New Code");
                    getCodesAttr(IGcode);
                }
                else
                {
                    oApplication.MessageBox("Please select Code");
                }
            }

            if (pVal.ItemUID == btDelA.Item.UniqueID)
            {
                int selListRow = mtSelRow(mtList);

                string IGcode   = Convert.ToString(dtList.GetValue("Code", selListRow - 1));
                string codeType = opG.Selected ? "Group" : "Item";
                int    selRow   = mtSelRow(mtS);
                if (selRow > 0)
                {
                    string strCode = Convert.ToString(dtS.GetValue("Code", selRow - 1));

                    string strInsert = "DELETE FROM  \"@B1_QA_CODES_ATTR\" WHERE \"Name\" = '" + strCode + "' AND \"U_IGCode\" = '" + IGcode + "'";


                    Program.objHrmsUI.ExecQuery(strInsert, "REMOVE  Code");
                    getCodesAttr(IGcode);
                }
                else
                {
                    oApplication.MessageBox("Please select Code");
                }
            }

            if (pVal.ItemUID == mtList.Item.UniqueID && pVal.Row > 0 && pVal.Row <= mtList.RowCount)
            {
                mtList.SelectRow(pVal.Row, true, false);
                int selRow = pVal.Row;// mtSelRow(mtList);
                if (selRow > 0)
                {
                    string strCode = Convert.ToString(dtList.GetValue("Code", selRow - 1));

                    if (strCode.Trim() != "")
                    {
                        getCodesAttr(strCode);
                    }
                }
                else
                {
                    oApplication.MessageBox("Please select rule to delete");
                }
            }


            if ((pVal.ItemUID == mtA.Item.UniqueID) && pVal.Row > 0 && pVal.Row <= mtA.RowCount)
            {
                mtA.SelectRow(pVal.Row, true, false);
            }

            if ((pVal.ItemUID == mtS.Item.UniqueID) && pVal.Row > 0 && pVal.Row <= mtS.RowCount)
            {
                mtS.SelectRow(pVal.Row, true, false);
            }
        }
Ejemplo n.º 8
0
 public virtual void ET_mtx_AFClick(ItemEvent pVal) {
     oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
     oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx").Specific));
     // ADD YOUR ACTION CODE HERE ...
     oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_FI0020M_HRD");
     oDB_1 = oForm.DataSources.DBDataSources.Item("@KIS_FI00201_HRD");
     if (pVal.Row != 0)
     {
         oMatrix.SelectRow(pVal.Row, true, false);
         SelectRow = pVal.Row -1;
         if (oDB_1.GetValue("U_STATUS", pVal.Row-1).ToString() == "Y")
         {
             oForm.Items.Item("btnTR").Enabled = false;
             oForm.Items.Item("btnCAN").Enabled = true;
         }
         else
         {
             oForm.Items.Item("btnTR").Enabled = true;
             oForm.Items.Item("btnCAN").Enabled = false;
         }
     }
 }
Ejemplo n.º 9
0
        public virtual void ET_mtx_AFClick(ItemEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx").Specific));
            // ADD YOUR ACTION CODE HERE ...

            if (pVal.Row > 0)
            {
                oMatrix.SelectRow(pVal.Row, true, false);
                gRow = pVal.Row;
            }
        }
Ejemplo n.º 10
0
        public override void etAfterClick(ref SAPbouiCOM.ItemEvent pVal, ref bool BubbleEvent)
        {
            base.etAfterClick(ref pVal, ref BubbleEvent);


            if (pVal.ItemUID == btAdd.Item.UniqueID)
            {
                string code = Convert.ToString(dtHead.GetValue("Code", 0));
                string name = Convert.ToString(dtHead.GetValue("Name", 0));
                if (code != "")
                {
                    string strInsert = "INSERT INTO \"@B1_QA_OUSR\" (\"Code\" , \"Name\") VALUES ('" + code + "','" + name + "')";


                    Program.objHrmsUI.ExecQuery(strInsert, "Insert New Code");
                    dtHead.SetValue("Code", 0, "");
                    dtHead.SetValue("Name", 0, "");
                    getCodes();
                }
                else
                {
                    oApplication.MessageBox("Please select Code");
                }
            }


            if (pVal.ItemUID == btAddA.Item.UniqueID)
            {
                int selListRow = mtSelRow(mtList);

                string IGcode = Convert.ToString(dtList.GetValue("Code", selListRow - 1));
                int    selRow = mtSelRow(mtA);
                if (selRow > 0)
                {
                    string strCode = Convert.ToString(dtA.GetValue("Code", selRow - 1));

                    string strNCode = Program.objHrmsUI.getMaxId("@B1_QA_OUSR_OT", "Code").ToString();


                    string strInsert = "INSERT INTO  \"@B1_QA_OUSR_OT\" (\"Code\",\"Name\",\"U_ObjType\",\"U_UsrCode\") VALUES ('" + strNCode + "','" + strCode + "','" + strCode + "','" + IGcode + "')";


                    Program.objHrmsUI.ExecQuery(strInsert, "Insert New Code");
                    getCodesAttr(IGcode);
                }
                else
                {
                    oApplication.MessageBox("Please select Code");
                }
            }
            if (pVal.ItemUID == btAddW.Item.UniqueID)
            {
                int selListRow = mtSelRow(mtList);

                string IGcode = Convert.ToString(dtList.GetValue("Code", selListRow - 1));
                int    selRow = mtSelRow(mtAW);
                if (selRow > 0)
                {
                    string strCode  = Convert.ToString(dtAW.GetValue("Code", selRow - 1));
                    string strNCode = Program.objHrmsUI.getMaxId("@B1_QA_OUSR_WHS", "Code").ToString();

                    string strInsert = "INSERT INTO  \"@B1_QA_OUSR_WHS\" (\"Code\",\"Name\",\"U_WHS\",\"U_UsrCode\") VALUES ('" + strNCode + "','" + strCode + "','" + strCode + "','" + IGcode + "')";


                    Program.objHrmsUI.ExecQuery(strInsert, "Insert New WHS");
                    getCodesAttr(IGcode);
                }
                else
                {
                    oApplication.MessageBox("Please select Code");
                }
            }

            if (pVal.ItemUID == btDelA.Item.UniqueID)
            {
                int selListRow = mtSelRow(mtList);

                string IGcode = Convert.ToString(dtList.GetValue("Code", selListRow - 1));
                int    selRow = mtSelRow(mtS);
                if (selRow > 0)
                {
                    string strCode = Convert.ToString(dtS.GetValue("Code", selRow - 1));

                    string strInsert = "DELETE FROM  \"@B1_QA_OUSR_OT\" WHERE \"Name\" = '" + strCode + "' AND \"U_UsrCode\" = '" + IGcode + "'";


                    Program.objHrmsUI.ExecQuery(strInsert, "REMOVE  Code");
                    getCodesAttr(IGcode);
                }
                else
                {
                    oApplication.MessageBox("Please select Code");
                }
            }
            if (pVal.ItemUID == btDelW.Item.UniqueID)
            {
                int selListRow = mtSelRow(mtList);

                string IGcode = Convert.ToString(dtList.GetValue("Code", selListRow - 1));
                int    selRow = mtSelRow(mtSW);
                if (selRow > 0)
                {
                    string strCode = Convert.ToString(dtSW.GetValue("Code", selRow - 1));

                    string strInsert = "DELETE FROM  \"@B1_QA_OUSR_WHS\" WHERE \"Name\" = '" + strCode + "' AND \"U_UsrCode\" = '" + IGcode + "' ";


                    Program.objHrmsUI.ExecQuery(strInsert, "REMOVE  Code");
                    getCodesAttr(IGcode);
                }
                else
                {
                    oApplication.MessageBox("Please select Code");
                }
            }

            if (pVal.ItemUID == mtList.Item.UniqueID && pVal.Row > 0 && pVal.Row <= mtList.RowCount)
            {
                mtList.SelectRow(pVal.Row, true, false);
                int selRow = pVal.Row;// mtSelRow(mtList);
                if (selRow > 0)
                {
                    string strCode = Convert.ToString(dtList.GetValue("Code", selRow - 1));

                    if (strCode.Trim() != "")
                    {
                        getCodesAttr(strCode);
                    }
                }
                else
                {
                    oApplication.MessageBox("Please select rule to delete");
                }
            }
            if (pVal.ItemUID == mtS.Item.UniqueID && pVal.Row > 0 && pVal.Row <= mtS.RowCount)
            {
                mtS.SelectRow(pVal.Row, true, false);
            }
            if (pVal.ItemUID == mtA.Item.UniqueID && pVal.Row > 0 && pVal.Row <= mtA.RowCount)
            {
                mtA.SelectRow(pVal.Row, true, false);
            }
            if (pVal.ItemUID == mtSW.Item.UniqueID && pVal.Row > 0 && pVal.Row <= mtSW.RowCount)
            {
                mtSW.SelectRow(pVal.Row, true, false);
            }
            if (pVal.ItemUID == mtAW.Item.UniqueID && pVal.Row > 0 && pVal.Row <= mtAW.RowCount)
            {
                mtAW.SelectRow(pVal.Row, true, false);
            }
        }
Ejemplo n.º 11
0
        public virtual void ET_mtx1_AFClick(ItemEvent pVal) {
            oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
            oMatrix = ((SAPbouiCOM.Matrix)(oForm.Items.Item("mtx1").Specific));
            // ADD YOUR ACTION CODE HERE ...
            try
            {
                if (pVal.Row > 0 )
                {
                    if (oMatrix.VisualRowCount > 0)
                    {
                        oMatrix.SelectRow(pVal.Row, true, false);
                    }

                    SetHeaderValues();
                }
            }
            catch (Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
Ejemplo n.º 12
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);
            }
        }