コード例 #1
0
        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 }));
            }
        }
コード例 #2
0
        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);
        }