public ActionResult PrintAttachment(int id) { var reportPath = Server.MapPath("~/Report/Logisitcs/transportRequisitionAttachment.rdlc"); var requisitionDetails = _reliefRequisitionDetailService.Get(t => t.RequisitionID == id, null, "ReliefRequisition.AdminUnit,FDP.AdminUnit,FDP,Donor,Commodity"); var commodityID = requisitionDetails.FirstOrDefault().CommodityID; var RationAmount = GetCommodityRation(id, commodityID); var requisitionDetailViewModels = RequisitionViewModelBinder.BindReliefRequisitionDetailListViewModel(requisitionDetails, RationAmount); var header = (from destination in requisitionDetailViewModels select new { destination.Zone, destination.Woreda, destination.FDP, destination.Donor, destination.Commodity, destination.Amount }); var dataSources = "attachment"; var reportData = header; var result = ReportHelper.PrintReport(reportPath, reportData, dataSources); return(File(result.RenderBytes, result.MimeType)); }
public ActionResult Allocation_Read([DataSourceRequest] DataSourceRequest request, int id) { var requisitionDetails = _reliefRequisitionDetailService.Get(t => t.RequisitionID == id, null, "ReliefRequisition.AdminUnit,FDP.AdminUnit,FDP,Donor,Commodity").ToList(); var commodityID = requisitionDetails.FirstOrDefault().CommodityID; var RationAmount = GetCommodityRation(id, commodityID); RationAmount = RationAmount.GetPreferedRation(); var requisitionDetailViewModels = RequisitionViewModelBinder.BindReliefRequisitionDetailListViewModel(requisitionDetails, RationAmount); return(Json(GetDonorCoveredWoredas(requisitionDetailViewModels, id).ToDataSourceResult(request), JsonRequestBehavior.AllowGet)); }