Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,


Please help me for below:

I Have Following Table:

C#
public partial class Receipt
   {
       public Receipt()
       {
           this.ReceiptDetails = new HashSet<ReceiptDetail>();
       }

       public decimal ReceiptID { get; set; }
       public System.DateTime ReceiptDate { get; set; }
       public decimal BankAccountID { get; set; }
       public decimal NetAmount { get; set; }
       public decimal DeducationAmount { get; set; }
       public decimal TotalAmount { get; set; }
       public string Notes { get; set; }
       public Nullable<decimal> CustomerID { get; set; }
       public Nullable<decimal> UserID { get; set; }
       public Nullable<System.DateTime> CreatedOn { get; set; }
       public Nullable<decimal> CreatedBy { get; set; }
       public Nullable<System.DateTime> UpdatedOn { get; set; }
       public Nullable<decimal> UpdatedBy { get; set; }
       public Nullable<decimal> DeletedBy { get; set; }
       public Nullable<System.DateTime> DeletedOn { get; set; }
       public string IPAddress { get; set; }
       public Nullable<bool> IsActive { get; set; }

       public virtual ICollection<ReceiptDetail> ReceiptDetails { get; set; }
   }


Child of Receipt Table:

C#
public partial class ReceiptDetail
   {
       public ReceiptDetail()
       {
           this.ReceiptDetailPriorDeductions = new HashSet<ReceiptDetailPriorDeduction>();
       }

       public decimal DetailID { get; set; }
       public decimal ReceiptID { get; set; }
       public Nullable<decimal> BankID { get; set; }
       public string BankBranch { get; set; }
       public Nullable<int> ChequeNo { get; set; }
       public Nullable<System.DateTime> ChequeDate { get; set; }
       public Nullable<decimal> Amount { get; set; }
       public Nullable<decimal> InflowAccountID { get; set; }
       public Nullable<decimal> InstrumentID { get; set; }
       public Nullable<decimal> PlanEntry { get; set; }
       public Nullable<decimal> TaxSectionID { get; set; }
       public Nullable<decimal> PriorDiduction { get; set; }

       public virtual ICollection<ReceiptDetailPriorDeduction> ReceiptDetailPriorDeductions { get; set; }
       public virtual Receipt Receipt { get; set; }
   }


C#
public partial class ReceiptDetailPriorDeduction
  {
      public decimal ID { get; set; }
      public decimal DetailID { get; set; }
      public Nullable<decimal> DeductionGroupID { get; set; }
      public Nullable<decimal> Amount { get; set; }
      public string Description { get; set; }

      public virtual ReceiptDetail ReceiptDetail { get; set; }
  }


I have two partial view for that first for receiptdetail and second for ReceiptDetailPriorDeductions.

i am using begincollectionitem html helper for it.

when i click on submit button i get list of receiptdetail but i does not get child of receiptdetail.
Posted
Updated 26-Mar-14 20:39pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900