0
Good night,
I’m doubting the following mistake:
Cannot implicitly Convert type 'System.Collections.Generic.List' to 'ITCore.FlowCredit.Business.Entities.ProdutoAmortizacaoCreditoDiasSearch'
The Code:
private void LoadDia()
{
ProdutoAmortizacaoCreditoDiasSearch pont = new ProdutoAmortizacaoCreditoDiasSearch();
ProdutoAmortizacaoCreditoDias aDay = new ProdutoAmortizacaoCreditoDias();
int? id_TipoDia = txtDay.Text.ToInt32Nullable();
DateTime? DiaInicio = dtCreationFrom.Text.ToDateTimeNullable();
DateTime? DiaFim = dtCreationFrom.Text2.ToDateTimeNullable();
string id_Produto = txtProduto.Text;
try
{
pont = FlowCreditTaxasProdutoExtensaoPrazoProviderManager.Provider.GetTodosDiasAmortizacaoCredito(id_TipoDia, id_Produto);
if (pont != null)
{
BindGridProducts(pont);
}
}
catch (Exception ex)
{
ExceptionHelper.ShowError(ex, false);
}
}
The mistake is in:
pont = FlowCreditTaxasProdutoExtensaoPrazoProviderManager.Provider.GetTodosDiasAmortizacaoCredito(id_TipoDia, id_Produto);
This is the role of the President:
#region Gets
public override List<ProdutoAmortizacaoCreditoDias> GetTodosDiasAmortizacaoCredito(int? id_TipoDia, String id_Produto)
{
List<ProdutoAmortizacaoCreditoDias> ProdutoAmortizacaoCreditoDiasObj = new List<ProdutoAmortizacaoCreditoDias>();
try
{
ProdutoAmortizacaoCreditoDiasObj = ProdutoAmortizacaoDiasUtils.GetTodosProdutoAmortizacaoDias(id_TipoDia, id_Produto).result;
}
catch (Exception ex)
{
CoreLog.LogError(ex);
throw new CoreException(ex.Message);
}
return ProdutoAmortizacaoCreditoDiasObj;
}
And here is the commonProviders:
public abstract List<ProdutosConfiguracaoTaxas> GetTodosProdutosConfiguracaoTaxas(DateTime? id_DataAtiva, String id_Produtos);
[DataContract, Serializable]
public class ProdutoAmortizacaoCreditoDiasSearch
{
[DataMember]
public List<ProdutoAmortizacaoCreditoDias> result { get; set; }
[DataMember]
public decimal NumberRecords { get; set; }
[DataMember]
public int ReturnValue { get; set; }
}
I could elaborate on your question, I’m not sure I understand.
– Lucas Kauer
It’s solved! Thank you
– Ricardo Gonçalves
Look, try not to take this the wrong way, but I have no idea how you’re "programming" without understanding something extremely basic like this. Try to study the language, do exercises basic, these things. The beginning is always the best starting point. It is no use trying to start writing something great. I see this looks like some commercial application and I have no idea what’s going on, but I wanted to give you a hint. (I was writing an answer to explain to you what happens and I removed this thingy from her).
– Jéf Bueno
I appreciate the help jbueno! I am working as a programmer, but my area is Java and they put me in a project in the ASP.NET banking and I am still learning how it works
– Ricardo Gonçalves