two parts using same record

Topics: Writing modules
Sep 6, 2011 at 5:27 AM

 

i want  writes  two  parts  using a same  record,

 
 public class ProductPart : ContentPart<ProductPartRecord>
    {
        public string Description
        {
            get { return Record.Description; }
            set { Record.Description = value; }
        }

        public string ProductName
        {
            get { return Record.ProductName; }
            set { Record.ProductName = value; }
        }


        public decimal Price
        {
            get { return Record.Price; }
            set { Record.Price = value; }
        }

        public string Currency
        {
            get { return Record.Currency; }
            set { Record.Currency = value; }
        }

        public string ProductNo
        {
            get { return Record.ProductNo; }
            set { Record.ProductNo = value; }
        }


    }

 

 

 public class ProductCategoryPart : ContentPart<ProductPartRecord>
    {
        public  CategoryPartRecord Category
        {
            get { return Record.Category; }
            set { Record.Category = value; }
        }
    }
 
 public class ProductPartRecord : ContentPartRecord
    {
        [StringLengthMax]
        public virtual string Description { get; set; }
        [StringLength(100)]
        [Required]
        public virtual string ProductName { get; set; }
        [StringLength(20)]
        public virtual string ProductNo { get; set; }

        public virtual string Currency { get; set; }
        [Required]
        public virtual decimal Price { get; set; }

        public virtual CategoryPartRecord Category { get; set; }
    }
 the 1-N  ralation between category  and  product. i whant to  write  a module   to override  N-N ralation between category and prdouct .so i write the  prdocutcategorypart
Coordinator
Sep 8, 2011 at 10:51 PM

Not sure what your question is.