public IEnumerable <API.Kasa.DokRozliczBase> WgTypDokumentu(API.Core.TypDokumentu typ, Types.FromTo fromTo, API.CRM.Kontrahent kontrahent) { API.Business.View view = null; if (kontrahent != null) { view = WgPodmiot(kontrahent, typ).CreateView(); } else { view = WgTypData(typ).CreateView(); } view.Filter = "Data >= '" + fromTo.From + "' AND Data <= '" + fromTo.To + "'"; return(view.Cast <API.Kasa.DokRozliczBase>().ToList());; }
private void loadData() { if (!this.DesignMode && Session != null) { API.Business.View view = null; switch (TypPodmiotu) { case API.Core.TypPodmiotu.Kontrahent: view = Session.GetModule <API.CRM.CRMModule>().Kontrahenci.CreateView().SetFilter("Blokada = false"); break; case API.Core.TypPodmiotu.Pracownik: view = Session.GetModule <API.Kadry.KadryModule>().Pracownicy.CreateView(); break; case API.Core.TypPodmiotu.Bank: view = Session.GetModule <API.CRM.CRMModule>().Banki.CreateView(); break; case API.Core.TypPodmiotu.UrzadSkarbowy: view = Session.GetModule <API.CRM.CRMModule>().UrzedySkarbowe.CreateView(); break; case API.Core.TypPodmiotu.ZUS: view = Session.GetModule <API.CRM.CRMModule>().ZUSY.CreateView(); break; } if (view != null) { var dc = view.Cast <API.Core.IPodmiot>().OrderBy(r => r.Kod).ToList(); if (dc.Count > 0) { podmiotBindingSource.DataSource = dc; } } else { podmiotBindingSource.Clear(); } } }