This is a migrated thread and some comments may be shown as answers.

[Solved] Ajax binding to relational objects

1 Answer 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Matt
Top achievements
Rank 1
Matt asked on 20 Aug 2012, 05:31 PM
Hi all,
I'm trying to use the Grid with an Ajax binding to bind to the following object: 
[Serializable]
    public class Transaction
    {
        #region Properties
 
        /// <summary>
        /// ID of the transaction
        /// </summary>
        public virtual Guid Id { get; set; }
 
        /// <summary>
        /// 'Parent' transaction
        /// </summary>
        [XmlIgnore]
        public virtual Transaction Parent { get; set; }
 
        /// <summary>
        /// Account transaction is related to
        /// </summary>
        [XmlIgnore]
        public virtual Account Account { get; set; }
        /// <summary>
        /// Card Number for transaction
        /// </summary>
        public virtual string CardNumber { get; set; }
 
        /// <summary>
        /// Location ID transaction took place
        /// </summary>
        public virtual Guid LocationId { get; set; }
 
        /// <summary>
        /// Type of transaction
        /// </summary>
        public virtual string TransactionType { get; set; }
 
        /// <summary>
        /// Date of the transaction
        /// </summary>
        public virtual DateTime TransactionDate { get; set; }
        /// <summary>
        /// Start time of the transaction
        /// </summary>
        public virtual DateTime? TransactionStartTime { get; set; }
        /// <summary>
        /// End time of the transaction
        /// </summary>
        public virtual DateTime? TransactionEndTime { get; set; }
 
        /// <summary>
        /// Amount (dollars) spent
        /// </summary>
        public virtual decimal? AmountSpent { get; set; }
        /// <summary>
        /// Number of base points earned for transaction
        /// </summary>
        public virtual decimal BasePoints { get; set; }
 
        // Probably should change type when bonus campaigns are implemented
        /// <summary>
        /// ID of the associated bonus campaign
        /// </summary>
        public virtual Guid BonusCampaignId { get; set; }
        /// <summary>
        /// Number of bonus points assigned
        /// </summary>
        public virtual decimal BonusPoints { get; set; }
 
        /// <summary>
        /// Check number from the POS system
        /// </summary>
        public virtual string CheckNumber { get; set; }
 
        /// <summary>
        /// Number of room nights for hotel transactions
        /// </summary>
        public virtual int? RoomNights { get; set; }
 
        /// <summary>
        /// Comments for the transaction
        /// </summary>
        public virtual string Comments { get; set; }
 
        public virtual DateTime CreatedOn { get; set; }
        public virtual string CreatedBy { get; set; }
        public virtual DateTime UpdatedOn { get; set; }
        public virtual string UpdatedBy { get; set; }
 
        #endregion
 
        #region Ctor
 
        public Transaction()
        {
            CreatedOn = DateTime.Now;
            UpdatedOn = DateTime.Now;
        }
 
        #endregion
    }

I can't seem to figure out how to get it to work without giving an error (which I can't get to at the moment).  It's something to do with the related objects though I believe (ie. "Account" and "Parent").

Any help would be greatly appreciated!

Thanks,
Matt

1 Answer, 1 is accepted

Sort by
0
Matt
Top achievements
Rank 1
answered on 20 Aug 2012, 06:01 PM
Never mind, I had to use projections in my LINQ statements.
Tags
Grid
Asked by
Matt
Top achievements
Rank 1
Answers by
Matt
Top achievements
Rank 1
Share this question
or