public ActionResult ajxGetPattern(int id) { IPublishInvoiceService _ipiSer = IoC.Resolve <IPublishInvoiceService>(); Company _currentCom = ((EInvoiceContext)FXContext.Current).CurrentCompany; IList <PublishInvoice> listPI = _ipiSer.GetPublishedPub(id, _currentCom.id); List <pubInfo> pList = new List <pubInfo>(); foreach (PublishInvoice pi in listPI) { pubInfo p = new pubInfo(); p.InvPattern = pi.InvPattern; p.PubInvId = pi.id; p.InvSerial = pi.InvSerial; p.CurrentNo = pi.CurrentNo; p.ToNo = pi.ToNo; pList.Add(p); } return(Json(pList)); }