Exemplo n.º 1
0
 public Relationship(Table src, Table dest, Column srcColumn, Column destColumn)
 {
     Source      = src;
     Destination = dest;
     SourceColumns.Add(srcColumn);
     DestinationColumns.Add(destColumn);
 }
Exemplo n.º 2
0
        public Relationship(Table src, Table dest, string srcColumn, string destColumn)
        {
            Source      = src;
            Destination = dest;

            Column srcCol  = Source[srcColumn];
            Column destCol = Destination[destColumn];

            if (srcCol != null && destCol != null)
            {
                SourceColumns.Add(srcCol);
                DestinationColumns.Add(destCol);
            }
        }
Exemplo n.º 3
0
        public ReportColumnsViewModel(Report report)
            : base(report)
        {
            Header           = "Report Columns";
            SubTitle         = "Report Columns:";
            Description      = "Select the columns to display for this report.";
            AttributeType    = AttributeType.Columns;
            SourceColumns    = GetBasicAttributes(report.Columns.ToList(), report);
            PropertyChanged += ReportColumnsViewModel_PropertyChanged;

            foreach (var column in SourceColumns.Where(column => Report.Columns.All(x => x.Name != column.Name)))
            {
                column.IsSelected = false;
            }
        }
Exemplo n.º 4
0
 public virtual SourceCollection GetSourceList(SourceColumns orderBy, string orderDirection)
 {            
     int totalRecords = 0;
     return GetSourceList(orderBy, orderDirection, 0, 0, out totalRecords);
 }
Exemplo n.º 5
0
 public virtual SourceCollection GetSourceList(SourceColumns orderBy, string orderDirection, int page, int pageSize, out int totalRecords)
 {            
     try
     {
         Database database = DatabaseFactory.CreateDatabase();
         DbCommand dbCommand = database.GetStoredProcCommand("spSourceGetList");
         
         database.AddInParameter(dbCommand, "@OrderBy", DbType.AnsiString, orderBy.ToString());
         database.AddInParameter(dbCommand, "@OrderDirection", DbType.AnsiString, orderDirection.ToString());
         database.AddInParameter(dbCommand, "@Page", DbType.Int32, page);
         database.AddInParameter(dbCommand, "@PageSize", DbType.Int32, pageSize);
         database.AddOutParameter(dbCommand, "@TotalRecords", DbType.Int32, 4);
         
         SourceCollection sourceCollection = new SourceCollection();
         using (IDataReader reader = database.ExecuteReader(dbCommand))
         {
             while (reader.Read())
             {
                 Source source = CreateSourceFromReader(reader);
                 sourceCollection.Add(source);
             }
             reader.Close();
         }
         totalRecords = (int)database.GetParameterValue(dbCommand, "@TotalRecords");
         return sourceCollection;
     }
     catch (Exception ex)
     {
         // log this exception
         log4net.Util.LogLog.Error(ex.Message, ex);
         // wrap it and rethrow
         throw new ApplicationException(SR.DataAccessGetSourceListException, ex);
     }
 }
Exemplo n.º 6
0
 public static SourceCollection GetSourceList(SourceColumns orderBy, string orderDirection)
 {            
     try
     {
         SourceDAO sourceDAO = new SourceDAO();
         return sourceDAO.GetSourceList(orderBy, orderDirection);
     }
     catch (ApplicationException)
     {
         throw;
     }
     catch (Exception ex)
     {
         // log this exception
         log4net.Util.LogLog.Error(ex.Message, ex);
         // wrap it and rethrow
         throw new ApplicationException(SR.BusinessGetSourceListException, ex);
     }
 }