private void FillQuota(QuotaDto quota) { txtId.Text = quota.Id.ToString(); txtName.Text = quota.Name; txtValue.Text = quota.Value.ToString(); dtpEndDate.Value = quota.EndDate; dtpStartDate.Value = quota.StartDate; }
public async Task <QuotaDto> UpdateAsync(QuotaDto quota) { var model = quota.ToModel(); await _unitOfWork.QuotasRepository.UpdateAsync(model).ConfigureAwait(false); await _unitOfWork.SaveChangesAsync().ConfigureAwait(false); return(model.ToDto()); }
private QuotaDto GetQuota() { var quota = new QuotaDto { EndDate = dtpEndDate.Value, Name = txtName.Text, StartDate = dtpStartDate.Value }; if (decimal.TryParse(txtValue.Text, out var value)) { quota.Value = value; } else { throw new InvalidOperationException("Valor inválido"); } return(quota); }