Mrudul Ganpule

Mrudul Ganpule

  • NA
  • 23
  • 25.6k

how to add two or more objects in single class at a time

May 28 2014 2:59 AM
 I want to add to instances of line class in the addInvoice.Line class but problem is that first lineSalesItemLineDetail  is assigned in second condition  DiscountLineDetail details overload on lineSalesItemLineDetail  so that lineSalesItemLineDetail  get destroyed, how to add 2 obects in the addInvoice.Line  if both if conditions valid.  addInvoice.Line is a internal dll defined class which is array kind.

following is code

if (l.SalesItemLineDetail.Count > 0)
  {
Line.AnyIntuitObject = lineSalesItemLineDetail; // lineSalesItemLineDetail object of line class
addInvoice.Line = new Intuit.Ipp.Data.Line[] { Line }; //addInvoice is object of Invoice
}

if (l.DiscountLineDetail.Count > 0)
{
DiscountLine.AnyIntuitObject = DiscountLineDetail; // DiscountLineDetail object of line class
addInvoice.Line = new Intuit.Ipp.Data.Line[] { DiscountLine}; //addInvoice is object of Invoice
}

 

Answers (3)