public JsonResult GetLastPayedPeriodByIdPayment(int id) { string lastPayedPeriod = string.Empty; try { ImportBill payment = _importRepository.Get(id); if (payment != null) { if (!payment.EndDate.ToString(CultureInfo.InvariantCulture).Contains("0001")) { lastPayedPeriod = "Từ " + payment.StartDate.ToString("dd/MM/yyyy") + " đến " + payment.EndDate.ToString("dd/MM/yyyy"); } else { lastPayedPeriod = payment.StartDate.ToString("dd/MM/yyyy"); } if (payment.Payment == payment.TotalValue) { lastPayedPeriod += " => Đã trả đủ"; } } return(Json(new { lastPayedPeriod = lastPayedPeriod })); } catch (Exception) { return(Json(new { lastPayedPeriod = lastPayedPeriod })); } }
public async Task <ImportDetail> Get(Guid id) { try { var result = await ImportRepository.Get(id); return(result); } catch (Exception ex) { Logger.Error("AccountService.Get failed", this, ex); } return(null); }