c# - How are treated nonpersistent data in DevExpress XAF? -
i need create queries , these queries used create graphs in dashboard. queries lot of calculations , nonpersistent classes.
first created class , have hperformance_listview , hperformance_detailview don't have data provider populate it. system tries populate ef context, not possible.
[navigationitem] [nonpersistent] public class hperformance { public decimal valor { get; set; } public decimal meta { get; set; } public decimal percentual { get; set; } } and query class
public class metasvendas { public metasvendas() { fromdate = datetime.now.addmonths(-1); todate = datetime.now; revenda = 0; } public datetime fromdate { get; set; } public datetime todate { get; set; } public long revenda { get; set; } public bindinglist<hperformance> _hperformance() { var r = _calculometaevalor(); var rr = r.groupby(g => true).select(s => new hperformance() { valor = s.sum(v => v.totalusacess + v.totalusradio), meta = s.sum(v => v.meta), percentual = s.sum(vv => vv.totalusacess + vv.totalusradio) / s.sum(vv => vv.meta) }); return new bindinglist<hperformance>(rr.tolist()); } in dashboard controller code don't know how handle. example doesn't work
public partial class dashboarddealergoalexecute : viewcontroller<dashboardview> { void parametersviewitem_controlcreated(object sender, eventargs e) { dashboardviewitem viewitem = (dashboardviewitem)sender; if (viewitem.id == "hperformance") { listview _hperformance = (listview)viewitem.innerview; if (parameters != null && parameters.dealer != null) { bindinglist<hperformance> hp = new metasvendas() { fromdate = parameters.fromdate, todate = parameters.todate, revenda = parameters.dealer.id }._hperformance(); _hperformance.currentobject = hp; } } hperformance dashboard item , connected hperformance class (1st code). how setup hperformance_listview populated _hperformance() method?
thanks, marco castro
Comments
Post a Comment