/// <summary> /// Gets the tax report view. /// </summary> /// <param name="taxReports">The tax reports.</param> /// <param name="incomeReports">The income reports.</param> /// <returns></returns> public ITaxReportView GetTaxReportView(IList <ITaxReport> taxReports) { var view = new TaxReportView { TaxReportCollection = taxReports, }; return(view); }
public ActionResult AddTaxReport(HttpPostedFileBase taxReportExcelSheet, TaxReportView taxReportView) { var returnInfo = this.agentOfDeductionService.ProcessUploadExcel(taxReportExcelSheet, taxReportView); if (!string.IsNullOrEmpty(returnInfo)) { var returnModel = this.agentOfDeductionService.GetTaxReportView(returnInfo); return(this.View("AddTaxReport", returnModel)); } var returnView = this.agentOfDeductionService.GetTaxReportView("File Uploaded Successfully"); return(this.View("AddTaxReport", returnView)); }
/// <summary> /// Creates the tax report view. /// </summary> /// <param name="infoMessage">The information message.</param> /// <returns></returns> public ITaxReportView CreateTaxReportView(string infoMessage, IList <IIncomeType> incomeTypes, IDigitalFile fileType) { int?fileTypeId = 0; var incomeTypeDDL = GetDropdownIncomeTypeList.GetIncomeType(incomeTypes, -1); if (fileType != null) { fileTypeId = fileType.DigitalFileId; } var taxReportView = new TaxReportView { FileTypeId = fileTypeId, ProcessingMessage = infoMessage, IncomeTypes = incomeTypeDDL, }; return(taxReportView); }
/// <summary> /// Processes the upload excel. /// </summary> /// <param name="taxReportExcelFile">The tax report excel file.</param> /// <param name="taxReport">The tax report.</param> /// <returns></returns> /// <exception cref="ArgumentNullException">taxReportExcelFile</exception> public string ProcessUploadExcel(HttpPostedFileBase taxReportExcelFile, ITaxReportView taxReport) { if (taxReportExcelFile == null) { throw new ArgumentNullException(nameof(taxReportExcelFile)); } var result = string.Empty; var taxReportCollection = this.agentOfDeductionRepository.ExcelUpload(taxReportExcelFile); try { foreach (DataRow r in taxReportCollection.Rows) { var taxReportView = new TaxReportView() { BeneficiaryTIN = r.ItemArray[0].ToString(), BVN = r.ItemArray[1].ToString(), IncomeAmount = decimal.Parse(r.ItemArray[2].ToString()), TaxAmount = decimal.Parse(r.ItemArray[3].ToString()), Year = taxReport.Year, IncomeTypeId = taxReport.IncomeTypeId }; result = this.agentOfDeductionRepository.SaveTaxReportInfo(taxReportView); } } catch { var ErrorFormat = "Invalid File Type"; return(ErrorFormat); } return(result); }
/// <summary> /// Reports the specified tax report view. /// </summary> /// <param name="taxReportView">The tax report view.</param> /// <returns></returns> public ActionResult TaxReport(TaxReportView taxReportView) { var taxReport = this.agentOfDeductionService.GetTaxReportView(taxReportView.BVN, taxReportView.Year); return(this.View("TaxReport", taxReport)); }