public ActionResult Index(int id) { if (id != int.Parse(GlobalConst.ConstantChar.Zero)) { FileDetailViewModel FileDetailViewModel = new FileDetailViewModel(); try { FileDetailViewModel.FileDetail = Mapper.Map <FileDetail>(_fileBL.GetFileDetailByFileId(id)); if (FileDetailViewModel.FileDetail != null) { FileDetailViewModel.FileDetail.Departments = Mapper.Map <IEnumerable <Department> >(_department.GetDepartment()); FileDetailViewModel.FileDetail.States = Mapper.Map <IEnumerable <State> >(_stateBL.GetState()); //else{ // FileDetailViewModel.FileDetail.Departments = Mapper.Map<IEnumerable<Department>>(_department.GetDepartment().Where(x => x.DepartmentId != 5)); //} var getAllInvoices = _invoice.GetInvoiceRecordByFileId(FileDetailViewModel.FileDetail.FileID, GlobalConst.Records.Skip, GlobalConst.Records.Take); if (FileDetailViewModel.FileDetail.IsLienAdjusterID) { FileDetailViewModel.FileDetail.AdjusterDetails = Mapper.Map <AdjusterSearch>(_adjusterBL.GetLienAdjusterByAdjusterID(FileDetailViewModel.FileDetail.AdjusterId)); } else { FileDetailViewModel.FileDetail.AdjusterDetails = Mapper.Map <AdjusterSearch>(_adjusterBL.GetAdjusterByAdjusterID(FileDetailViewModel.FileDetail.AdjusterId)); } InvoiceViewModel InvoiceViewModel = new LMGEDIApp.Domain.Models.InvoiceModel.InvoiceViewModel(); InvoiceViewModel.InvoiceDetails = getAllInvoices.InvoiceDetails.Select(InvoiceResult => new Invoice().InjectFrom(InvoiceResult)).Cast <Invoice>().ToList(); InvoiceViewModel.InvoiceCount = getAllInvoices.TotalCount; FileDetailViewModel.InvoiceViewModel = InvoiceViewModel; return(View(FileDetailViewModel)); } else { return(View()); } } catch (Exception ex) { _arCommonService.CreateErrorLog(ex.Message, ex.StackTrace); return(View()); } } else { return(View()); } }
public ActionResult InvoiceDetail(string C, int FileID, int Skip) { try { InvoiceViewModel InvoiceViewModel = new LMGEDIApp.Domain.Models.InvoiceModel.InvoiceViewModel(); if (C != GlobalConst.ConstantChar.Blank && C != null) { var getAllInvoices = _invoice.GetInvoiceRecordByFileId(FileID, Skip, GlobalConst.Records.Take); InvoiceViewModel.InvoiceDetails = getAllInvoices.InvoiceDetails.Select(InvoiceResult => new Invoice().InjectFrom(InvoiceResult)).Cast <Invoice>().ToList(); InvoiceViewModel.InvoiceCount = getAllInvoices.TotalCount; } return(Json(InvoiceViewModel, GlobalConst.ContentTypes.TextHtml)); } catch (Exception ex) { _arCommonService.CreateErrorLog(ex.Message, ex.StackTrace); return(View()); } }