示例#1
0
        public void iniciarValoresPorDefecto()
        {
            //Conexion.application.Menus.Item(Constantes.Menu_Crear).Enabled = false;
            //Conexion.application.Menus.Item(Constantes.Menu_Buscar).Enabled = false;

            dsTipoUsuario.Clear();
            deletedEntries.Clear();

            var mListMenu = TipoUsuarioDAO.listar();

            foreach (var item in mListMenu)
            {
                dsTipoUsuario.InsertRecord(dsTipoUsuario.Size);
                insertToDS(dsTipoUsuario.Size - 1, item.docEntry.ToString(), item.codigo, item.descripcion, item.activo, item.supervisor, item.cobrador);
            }

            dsTipoUsuario.InsertRecord(dsTipoUsuario.Size);
            insertToDS(dsTipoUsuario.Size - 1, string.Empty, string.Empty, string.Empty, "Y", "N", "N");

            oMatrix.LoadFromDataSource();

            for (int i = 0; i < dsTipoUsuario.Size - 1; i++)
            {
                oMatrix.CommonSetting.SetCellEditable(i + 1, 1, false);
            }

            oMatrix.AutoResizeColumns();
            oMatrix.SetCellFocus(oMatrix.RowCount, 1);
        }
        private static void Cargar_Datos_Matrix()
        {
            try
            {
                //oForm = Application.SBO_Application.Forms.ActiveForm;
                oDTTable = oForm.DataSources.DataTables.Item("DT_SQL1");
                SAPbouiCOM.DBDataSource source = oForm.DataSources.DBDataSources.Item("@ZDFER");

                oForm.Freeze(true);

                string sql = "SELECT * FROM [@ZDFER] ORDER BY U_Fecha";

                oDTTable.ExecuteQuery(sql);

                oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("3").Specific;
                oMatrix.FlushToDataSource();
                source.Clear();
                oMatrix.Clear();

                for (int i = 0; i < oDTTable.Rows.Count; i++)
                {
                    source.InsertRecord(source.Size);
                    source.Offset = source.Size - 1;
                    source.SetValue("Code", source.Size - 1, Convert.ToString(oDTTable.GetValue("Code", i)));
                    //DateTime fecha = (DateTime)oDTTable.GetValue("U_Fecha", i);
                    source.SetValue("U_Fecha", source.Size - 1, Convert.ToDateTime(oDTTable.GetValue("U_Fecha", i)).ToString("yyyyMMdd"));
                    source.SetValue("U_Descripcion", source.Size - 1, Convert.ToString(oDTTable.GetValue("U_Descripcion", i)));
                    source.SetValue("DocEntry", source.Size - 1, Convert.ToString(oDTTable.GetValue("DocEntry", i)));
                }

                sql = "SELECT MAX(CAST(Code as int)) + 1 as Proximo FROM [@ZDFER]";
                oDTTable.ExecuteQuery(sql);

                source.InsertRecord(source.Size);
                source.Offset = source.Size - 1;
                source.SetValue("Code", source.Size - 1, Convert.ToString(oDTTable.GetValue("Proximo", 0)));
                source.SetValue("DocEntry", source.Size - 1, Convert.ToString(oDTTable.GetValue("Proximo", 0)));

                oMatrix.LoadFromDataSource();
                oMatrix.AutoResizeColumns();
            }
            catch (Exception)
            {
            }
            finally
            {
                oForm.Freeze(false);
            }
        }
示例#3
0
        public void iniciarValoresPorDefecto()
        {
            if (cboPerfil.ValidValues.Count == 0)
            {
                var perfiles = TipoUsuarioDAO.listar();

                foreach (var item in perfiles)
                {
                    cboPerfil.ValidValues.Add(item.codigo, item.descripcion);
                }
            }

            if (cboSeries.ValidValues.Count == 0)
            {
                var series = SeriesDAO.listar();

                foreach (var item in series)
                {
                    cboSeries.ValidValues.Add(item.codigo, item.descripcion);
                }
            }


            dsDetAlmacenes.Clear();
            dsDetAlmacenes.InsertRecord(dsDetAlmacenes.Size);
            dsDetAlmacenes.SetValue("U_MSSM_COD", dsDetAlmacenes.Size - 1, string.Empty);
            dsDetAlmacenes.SetValue("U_MSSM_NOM", dsDetAlmacenes.Size - 1, string.Empty);
            mtxAlmacenes.LoadFromDataSource();

            //dsDetalle2.Clear();
            //dsDetalle2.InsertRecord(dsDetalle2.Size);
            //dsDetalle2.SetValue("U_MSSM_COD", dsDetalle2.Size - 1, string.Empty);
            //dsDetalle2.SetValue("U_MSSM_NOM", dsDetalle2.Size - 1, string.Empty);
            //mtxGruposCliente.LoadFromDataSource();

            //dsDetalle3.Clear();
            //dsDetalle3.InsertRecord(dsDetalle3.Size);
            //dsDetalle3.SetValue("U_MSSM_COD", dsDetalle3.Size - 1, string.Empty);
            //dsDetalle3.SetValue("U_MSSM_NOM", dsDetalle3.Size - 1, string.Empty);
            //mtxGruposZona.LoadFromDataSource();

            //mForm.Items.Item(DEFAULT_TAB).Click();
            mForm.Items.Item(EDT_COD_VENDEDOR).Click();
        }
示例#4
0
        public void iniciarValoresPorDefecto()
        {
            try
            {
                //Conexion.application.Menus.Item(Constantes.Menu_Crear).Enabled = false;
                //Conexion.application.Menus.Item(Constantes.Menu_Buscar).Enabled = false;

                dsEquipo.Clear();

                var mListEquipos = EquipoDAO.listar();

                foreach (var item in mListEquipos)
                {
                    dsEquipo.InsertRecord(dsEquipo.Size);
                    insertToDS(dsEquipo.Size - 1, item.docEntry.ToString(), item.codigo, item.descripcion,
                               item.modelo, item.serie, item.color, item.codigoUnico, item.verificarId);
                }

                dsEquipo.InsertRecord(dsEquipo.Size);
                insertToDS(dsEquipo.Size - 1, string.Empty);

                mtxPrincipal.LoadFromDataSource();

                for (int i = 0; i < dsEquipo.Size - 1; i++)
                {
                    mtxPrincipal.CommonSetting.SetCellEditable(i + 1, 1, false);
                }

                mtxPrincipal.AutoResizeColumns();
                mtxPrincipal.SetCellFocus(mtxPrincipal.RowCount, 1);
            }
            catch (Exception ex)
            {
                StatusMessageError("iniciarValoresPorDefecto() > " + ex.Message);
            }
        }
        private void LoadDataMatrix()
        {
            SAPbouiCOM.DBDataSource oDBDataSource = oForm.DataSources.DBDataSources.Item("@Z_COMI_COMGRP");
            oDBDataSource.Query();
            oDBDataSource.InsertRecord(oDBDataSource.Size);

            //MatrixExtensions.AddLineMatrixDBDataSource(Matrix0, oDBDataSource);

            int nProxCode = UDOExtensions.GetNextCode("Z_COMI_COMGRP", NConexion.Verifica_Conexion(Program.oCompany));

            oDBDataSource.SetValue("Code", oDBDataSource.Size - 1, nProxCode.ToString());
            oDBDataSource.SetValue("DocEntry", oDBDataSource.Size - 1, nProxCode.ToString());

            Matrix0.LoadFromDataSource();
            Matrix0.CommonSetting.SetCellEditable(oDBDataSource.Size, 3, true);
            MatrixExtensions.SelectMatrixRowSetFocus(ref Matrix0, "Col_2", oDBDataSource.Size);
        }
示例#6
0
 public static void AddLineMatrixDBDataSource(SAPbouiCOM.Matrix oMatrix, SAPbouiCOM.DBDataSource source, string ColumnaFocus = "")
 {
     try
     {
         SAPbouiCOM.EditText oEdit;
         oMatrix.FlushToDataSource();
         source.InsertRecord(source.Size);
         source.Offset = source.Size - 1;
         oMatrix.LoadFromDataSource();
         oMatrix.SelectRow(source.Size, true, false);
         if (ColumnaFocus.Trim().Length != 0)
         {
             oEdit              = (SAPbouiCOM.EditText)oMatrix.Columns.Item(ColumnaFocus).Cells.Item(source.Size).Specific;
             oEdit.Active       = true;
             oEdit.Item.Enabled = true;
         }
     }
     catch (Exception) { }
 }