public List <Invoice> GetAllInvoice() { var invoiceObj = new InvoiceModel(); List <Invoice> invoiceList = new List <Invoice>(); var result = invoiceObj.GetAllInvoice(); if (result != null && result.Count > 0) { if (!string.IsNullOrEmpty(this.InvoiceDate)) { string[] daterange = InvoiceDate.Split('|'); result = result.Where(m => m.InvoiceDate >= Convert.ToDateTime(daterange[0]) && m.InvoiceDate <= Convert.ToDateTime(daterange[1])).ToList(); } if (result != null && result.Count > 0) { invoiceList = result.Select(m => new Invoice { InvoiceID = m.InvoiceID, InvoiceDate = Convert.ToString(m.InvoiceDate), PO_No = m.PO_No, TransportationMode = m.TransportationMode, Veh_No = m.Veh_No, LR_No = m.LR_No, LR_Date = Convert.ToString(m.LR_Date), DateTimeSupply = Convert.ToString(m.DateTimeSupply), CustomerName = m.CustomerName, GST_No = m.GST_No, PAN_No = m.PAN_No, CompanyAddress = m.CompanyAddress, ShippingAddress = m.ShippingAddress, Total_Nos_Kg = m.Total_Nos_Kg, Total_Nos_Bag = m.Total_Nos_Bag, TotalAmountBeforeTax = m.TotalAmountBeforeTax, Total_CGST = m.Total_CGST, Total_SGST = m.Total_SGST, Total_IGST = m.Total_IGST, Total_GST = m.Total_GST, TotalAmountAfterTax = m.TotalAmountAfterTax, TotalAfterRoundOff = m.TotalAfterRoundOff }).ToList(); } } return(invoiceList); }