I need to build a very complex view and query maybe. I have 3 tables in my database: Lote, Carga and RegistosForno. My model has all these 3 classes:
Class "Carga"
public partial class carga
{
public string cga_numero { get; set; }
public string cem_numero { get; set; }
public string lot_numero { get; set; }
public string tpe_numero { get; set; }
public string buj_numero { get; set; }
public string ope_numero { get; set; }
public Nullable<decimal> for_numero { get; set; }
public string ret_numero { get; set; }
public Nullable<decimal> cga_carga { get; set; }
public Nullable<int> cga_parte_lote { get; set; }
public Nullable<decimal> cga_data_in_forno { get; set; }
public Nullable<decimal> cga_hora_in_forno { get; set; }
public string cga_tmp_in_forno { get; set; }
public Nullable<decimal> cga_data_out_forno { get; set; }
public Nullable<decimal> cga_hora_out_forno { get; set; }
public string cga_tmp_out_forno { get; set; }
public Nullable<int> cga_estado { get; set; }
public Nullable<int> cga_cem_num_utilizacoes { get; set; }
public Nullable<int> cga_ret_total_utilizacoes { get; set; }
public Nullable<int> cga_ret_num_utilizacoes { get; set; }
public Nullable<int> cga_ret_lim_utilizacoes { get; set; }
public Nullable<int> cga_buj_total_utilizacoes { get; set; }
public Nullable<int> cga_buj_num_utilizacoes { get; set; }
public Nullable<int> cga_buj_lim_utilizacoes { get; set; }
public string cga_lot_tmp_out_forno { get; set; }
public string cga_lot_tmp_in_forno { get; set; }
public Nullable<int> cga_lot_cem_num_utilizacoes { get; set; }
public string cga_datahora { get; set; }
}
Class "Lote"
public partial class lote
{
public string lot_numero { get; set; }
public string ope_numero { get; set; }
public string tpe_nome { get; set; }
public Nullable<int> lot_peso_total { get; set; }
public Nullable<int> lot_total_cargas { get; set; }
public Nullable<int> lot_cargas { get; set; }
public Nullable<int> lot_estado { get; set; }
public Nullable<decimal> lot_data { get; set; }
public Nullable<decimal> lot_hora { get; set; }
public Nullable<decimal> lot_peso_prp { get; set; }
public Nullable<decimal> lot_peso_total_cargas { get; set; }
public Nullable<int> lot_cem_num_utilizacoes { get; set; }
public Nullable<int> lot_cem_tipo { get; set; }
public string lot_datahora { get; set; }
}
Class "RegForno"
public partial class regforno
{
public int reg_id { get; set; }
public string cga_numero { get; set; }
public Nullable<decimal> for_numero { get; set; }
public string ope_numero { get; set; }
public Nullable<int> reg_id_plc { get; set; }
public Nullable<decimal> reg_hora { get; set; }
public Nullable<decimal> reg_data { get; set; }
public Nullable<int> reg_temperatura { get; set; }
public Nullable<int> reg_estado { get; set; }
public Nullable<int> reg_cga_tmp_forno { get; set; }
public string reg_datahora { get; set; }
}
My view should look like this:
Lote 1
>Carga 1
>Registo 1 forno Carga 1
>Registo 2 forno Carga 1
>Carga 2
>Registo 1 forno Carga 2
>Registo 2 forno Carga 2
>Carga 3
>Registo 1 forno Carga 3
>Registo 2 forno Carga 3
>Carga 4
>Registo 1 forno Carga 4
>Registo 2 forno Carga 4
Lote N
>Carga 1
>Registo 1 forno Carga 1
>Registo 2 forno Carga 1
>Carga 2
>Registo 1 forno Carga 2
>Registo 2 forno Carga 2
>Carga 3
>Registo 1 forno Carga 3
>Registo 2 forno Carga 3
>Carga 4
>Registo 1 forno Carga 4
>Registo 2 forno Carga 4
Basically I need to: For each Lote get all the records from Carga related to that lote and get all the records from regForno related to that Carga.
My experience with asp.net is not much but I have been able to implement a few things mostly based on tutorials and examples. However I haven't been able to find an example for this or any tutorial doing this kind of thing. I believe is very specific from my user requests.