Exemplo n.º 1
0
        public cColumnInfo add(cColumnInfo c, String key)
        {
            try
            {
                if (c == null)
                {
                    c = new cColumnInfo();
                }

                if (key == "")
                {
                    key = cReportGlobals.getKey(cReportGlobals.getNextKey().ToString());
                }
                else
                {
                    cReportGlobals.refreshNextKey(key);
                    key = cReportGlobals.getKey(key);
                }

                c.setPosition(count());
                c.setKey(key);
                Add(key, c);

                return(c);
            }
            catch
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        private bool fillColumns(string sqlstmt)
        {
            var db = new cDataBase(csDatabaseEngine.SQL_SERVER);

            if (db.initDb(m_strConnect))
            {
                DbDataReader rs;
                if (db.openRs(sqlstmt, out rs, "fillColumns", "cConnect", "Update columns's definition", CSKernelClient.eErrorLevel.eErrorInformation))
                {
                    for (int i = 0; i < rs.FieldCount; i++)
                    {
                        var column = new cColumnInfo();
                        column.setName(rs.GetName(i));
                        column.setPosition(i);
                        column.setColumnType((csDataType)System.Type.GetTypeCode((rs.GetFieldType(i))));
                        m_columnsInfo.add(column, "");
                    }
                }
                else
                {
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 3
0
        public static void setParametersAux(cConnect connect, cReportConnect rptConnect)
        {
            rptConnect.getColumns().clear();
            rptConnect.getParameters().clear();

            for (int i = 0; i < connect.getColumnsInfo().count(); i++)
            {
                CSConnect.cColumnInfo   colInfo    = connect.getColumnsInfo().item(i);
                CSReportDll.cColumnInfo rptColInfo = new CSReportDll.cColumnInfo();

                rptColInfo.setName(colInfo.getName());
                rptColInfo.setPosition(colInfo.getPosition());
                rptColInfo.setColumnType(colInfo.getColumnType());
                rptConnect.getColumns().add(rptColInfo, "");
            }

            for (int i = 0; i < connect.getParameters().count(); i++)
            {
                CSConnect.cParameter   parameter    = connect.getParameters().item(i);
                CSReportDll.cParameter rptParameter = new CSReportDll.cParameter();

                rptParameter.setName(parameter.getName());
                rptParameter.setPosition(parameter.getPosition());
                rptParameter.setColumnType(parameter.getColumnType());
                rptParameter.setValue(parameter.getValue());
                rptConnect.getParameters().add(rptParameter, "");
            }
        }
Exemplo n.º 4
0
 private bool fillColumns(string sqlstmt)
 {
     var db = new cDataBase(csDatabaseEngine.SQL_SERVER);
     if (db.initDb(m_strConnect))
     {
         DbDataReader rs;
         if (db.openRs(sqlstmt, out rs, "fillColumns", "cConnect", "Update columns's definition", CSKernelClient.eErrorLevel.eErrorInformation))
         {
             for (int i = 0; i < rs.FieldCount; i++)
             {
                 var column = new cColumnInfo();
                 column.setName(rs.GetName(i));
                 column.setPosition(i);
                 column.setColumnType((csDataType)System.Type.GetTypeCode((rs.GetFieldType(i))));
                 m_columnsInfo.add(column, "");
             }
         }
         else
         {
             return false;
         }
     }
     return true;
 }
Exemplo n.º 5
0
        public cColumnInfo add(cColumnInfo c, String key)
        {
            try
            {

                if (c == null)
                {
                    c = new cColumnInfo();
                }

                if (key == "")
                {
                    key = cReportGlobals.getKey(cReportGlobals.getNextKey().ToString());
                }
                else
                {
                    cReportGlobals.refreshNextKey(key);
                    key = cReportGlobals.getKey(key);
                }

                c.setPosition(count());
                c.setKey(key);
                Add(key, c);

                return c;
            }
            catch
            {
                return null;
            }
        }