for (var invoiceRow = 0; invoiceRow < dataTableInvoice.Rows.Count; invoiceRow++) { invoiceEntity.Rowno = Convert.ToInt32(dataTableInvoice.Rows[invoiceRow]["Rowno"]); invoiceEntity.ProjectName = Convert.ToString(dataTableInvoice.Rows[invoiceRow]["ProjectName"]); invoiceEntity.EmployeeRoleTypeName = Convert.ToString(dataTableInvoice.Rows[invoiceRow]["EmployeeRoleTypeName"]); invoiceEntity.WorkHours = Convert.ToInt32(dataTableInvoice.Rows[invoiceRow]["WorkHours"]); if (invoiceEntity.Rowno == -1) { invoiceEntity.InvoiceStartNo = ""; invoicestartupno--; } var invoiceNumberFormat = invoicestartupno.ToString("D4"); invoiceEntity.InvoiceStartNo = String.Format("{0}-{1}", invoiceno, invoiceNumberFormat); dataTableInvoice.Rows[invoiceRow]["InvoiceStartNo"] = invoiceEntity.InvoiceStartNo; invoiceEntity.CurrentDate = (dataTableInvoice.Rows[invoiceRow]["CurrentDate"]) == DBNull.Value ? (DateTime?)null : Convert.ToDateTime(dataTableInvoice.Rows[invoiceRow]["CurrentDate"] ); invoiceEntity.TotalWorkingDays = workingDays; invoiceEntity.TotalWorkingHrs = workingHrs; invoiceEntity.BillableHrs = billableHrs; invoiceEntity.NonBillableHrs = nonBillableHrs; invoiceEntity.DateRange = dateSeries; invoicestartupno++; invoiceList.Add(invoiceEntity); }
invoiceEntity
var invoiceEntity = new [WHATEVER YOUR TYPE IS]();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)