Ejemplo n.º 1
0
        }//fin GuardarRegistro

        private Boolean Limpiar()
        {
            Boolean _result;
            Int32   i;

            SAPbouiCOM.EditText oEditText;
            SAPbouiCOM.ComboBox oComboBox;
            String ProcNomE, ProcNomD, ProcNomR, ProcNomL, ProcNomS, TipoDocPE, Hab;

            try
            {
                _result = true;
                oMtx.FlushToDataSource();
                i = 1;
                while (i <= oMtx.RowCount)
                {
                    oEditText = (EditText)(oMtx.Columns.Item("ProcNomE").Cells.Item(i).Specific);
                    ProcNomE  = (System.String)(oEditText.Value).Trim();

                    oEditText = (EditText)(oMtx.Columns.Item("ProcNomD").Cells.Item(i).Specific);
                    ProcNomD  = (System.String)(oEditText.Value).Trim();

                    oEditText = (EditText)(oMtx.Columns.Item("ProcNomR").Cells.Item(i).Specific);
                    ProcNomR  = (System.String)(oEditText.Value).Trim();

                    oEditText = (EditText)(oMtx.Columns.Item("ProcNomS").Cells.Item(i).Specific);
                    ProcNomS  = (System.String)(oEditText.Value).Trim();

                    oEditText = (EditText)(oMtx.Columns.Item("ProcNomL").Cells.Item(i).Specific);
                    ProcNomL  = (System.String)(oEditText.Value).Trim();

                    oComboBox = (ComboBox)(oMtx.Columns.Item("Habili").Cells.Item(i).Specific);
                    Hab       = oComboBox.Value;

                    oComboBox = (ComboBox)(oMtx.Columns.Item("TipoDocPE").Cells.Item(i).Specific);
                    TipoDocPE = oComboBox.Value;

                    if ((ProcNomE == "") || (Hab == "") || (TipoDocPE == ""))
                    {
                        oMtx.DeleteRow(i);
                        i = i - 1;
                    }

                    i++;
                }
                oMtx.FlushToDataSource();

                return(_result);
            }
            catch (Exception e)
            {
                OutLog("Limpiar: " + e.Message + " ** Trace: " + e.StackTrace);
                return(false);
            }
        }//fin Limpiar
        }//fin ValidarMatrix

        private Boolean LimpiarMatrix()
        {
            Int32 i;

            try
            {
                i = 0;
                while (i < oMtx.RowCount)
                {
                    if (((System.String)(oDBDSH.GetValue("U_Servidor", i)) == "") &&
                        ((System.String)(oDBDSH.GetValue("U_Base", i)) == "") &&
                        ((System.String)(oDBDSH.GetValue("U_Usuario", i)) == "") &&
                        ((System.String)(oDBDSH.GetValue("U_RUT", i)) == "") &&
                        ((System.String)(oDBDSH.GetValue("U_Password", i)) == "") &&
                        ((System.String)(oDBDSH.GetValue("U_Sociedad", i)) == ""))
                    {
                        oMtx.DeleteRow(i + 1);
                        i = i - 1;
                    }
                    i++;
                }

                return(true);
            }
            catch (Exception e)
            {
                OutLog("LimpiarMatrix: " + e.Message + " ** Trace: " + e.StackTrace);
                FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", "");
                return(false);
            }
        } //fin LimpiarMatrix
Ejemplo n.º 3
0
        }//fin GuardarRegistro

        private Boolean Limpiar()
        {
            Boolean _result;
            Int32   i;

            SAPbouiCOM.EditText oEditText;

            try
            {
                _result = true;
                oMtx.FlushToDataSource();
                i = 1;
                while (i <= oMtx.RowCount)
                {
                    oEditText = (EditText)(oMtx.Columns.Item("Code").Cells.Item(i).Specific);
                    if ((System.String)(oEditText.Value).Trim() == "")
                    {
                        oMtx.DeleteRow(i);
                        i = i - 1;
                    }
                    i++;
                }
                oMtx.FlushToDataSource();

                return(_result);
            }
            catch (Exception e)
            {
                OutLog("Limpiar: " + e.Message + " ** Trace: " + e.StackTrace);
                return(false);
            }
        }//fin Limpiar
Ejemplo n.º 4
0
 public static void DelRowWithoutDSource(ref SAPbouiCOM.Matrix matrix)
 {
     try
     {
         var lineSelected = matrix.GetCellFocus().rowIndex;
         matrix.DeleteRow(lineSelected);
     }catch (Exception ex)
     {
         klib.Shell.WriteLine(R.Project.ID, LOG, ex);
         SUI.Forms.Notification.SendToBarMessage(true, $"Occur a internal error to delete the line. Matrix {matrix.Item.Description}");
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Elimina las columnas (Para cargar nuevamente la matriz)
        /// </summary>
        public SAPbouiCOM.Matrix DeleteColumns(SAPbouiCOM.Matrix pObjMatrix)
        {
            int lIntRow = pObjMatrix.RowCount;

            if (lIntRow > 0)
            {
                for (int i = lIntRow; i > 0; i--)
                {
                    pObjMatrix.DeleteRow(i);
                }
            }
            int lIntCount = pObjMatrix.Columns.Count;

            for (int i = 0; i < lIntCount; i++)
            {
                pObjMatrix.Columns.Remove(0);
            }

            return(pObjMatrix);
        }
Ejemplo n.º 6
0
        public virtual void ET_AFRowDataMenu_Delete(MenuEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.ActiveForm;
            // ADD YOUR ACTION CODE HERE ...

            try
            {

                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item(gSelMtx).Specific;
                oForm.Freeze(true);


                oMatrix.AddRow(1, -1);
                int i = oMatrix.VisualRowCount;
                oMatrix.DeleteRow(i);
                oMatrix.FlushToDataSource();




                if (gSelMtx == "mtx1_DUMY")
                {
                    gDeliverySelect = -1;
                    // 1. 삭제된뒤 DataTable의 Index값을 다시 설정한다.
                    SetDataTableReIndexing_Deliver();

                    // 2. 다시 DataTable 기준으로 화면에 조회한다.
                    FindData(oForm);
                }
                else
                {
                    // 1. 삭제된뒤 DataTable의 Index값을 다시 설정한다.
                    SetDataTableReIndexing_Call();

                    // 2. 다시 DataTable 기준으로 화면에 조회한다.
                    FindSubData(oForm, GetSelectedMatrixRowIndex(oForm));
                }

                oForm.Freeze(false);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 7
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.º 8
0
        public virtual bool ET_BFRowDataMenu_Delete(MenuEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.ActiveForm;
            // ADD YOUR ACTION CODE HERE ...

            try
            {



                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item(gSelMtx).Specific;
                string strIndex = FN.GetMatirxCellValue(ref oMatrix, "U_IDX", gRowIdx);
                //string strLineID = gDs.Tables[oForm.UniqueID + "_Deliver"].Rows[int.Parse(strIndex)]["LINEID"].ToString();
                string strDeliveryCode = FN.GetMatirxCellValue(ref oMatrix, "U_DELVCD", gRowIdx);
                int idx = int.Parse(strIndex);

                if (gSelMtx == "mtx1_DUMY")
                {
                    //// 메인삭제전 상담이력을 삭제한다.
                    if (DeleteMatrixRows_CALL(strDeliveryCode))
                    {
                        // 1. DataTable 에서 행삭제
                        gDs.Tables[oForm.UniqueID + "_Deliver"].Rows.RemoveAt(idx);

                        oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx1_ORIG").Specific;
                        if (oMatrix.VisualRowCount > idx)
                        {

                            //ExportDataSetToFiles();
                            // 화면단에서 행추가한건에대해서 원본메트릭스에서 삭제하지 않는다.

                            // 2. 원본 데이터 삭제
                            oMatrix.DeleteRow(idx + 1);
                            oMatrix.FlushToDataSource();

                        }

                        // 3. 구독부수 재계산하고 적용한다.
                        SetSumNumberOfCofies(oForm);
                    }
                    else
                        return false;
                }
                else
                {
                    oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx2_ORIG").Specific;

                    // 1. DataTable 에서 행삭제
                    gDs.Tables[oForm.UniqueID + "_Call"].Rows.RemoveAt(idx);
                    if (oMatrix.VisualRowCount > idx)
                    {
                        // 2. 원본 데이터 삭제
                        oMatrix.DeleteRow(idx + 1);
                        oMatrix.FlushToDataSource();
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return true;
        }
Ejemplo n.º 9
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);
            }
        }
Ejemplo n.º 10
0
        public virtual void ET_AFRowDataMenu_Delete(MenuEvent pVal)
        {
            oForm = B1Connections.theAppl.Forms.ActiveForm;
            // ADD YOUR ACTION CODE HERE ...

            try
            {
                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx").Specific;
                oForm.Freeze(true);
                oMatrix.AddRow(1, -1);
                int i = oMatrix.VisualRowCount;
                oMatrix.DeleteRow(i);
                oMatrix.FlushToDataSource();
                oForm.Freeze(false);
            }
            catch (Exception)
            {
                throw;
            }
        }