private void LoadCoupons() { manager.Refresh(); RefreshBHT35Coupons(); RefreshBHT80Coupons(); }
private void LoadCoupons() { lvCoupons.ItemsSource = null; TSBCouponManager.Sync(); manager.Refresh(); /* * var coupons = ops.Coupons.GetTAServerCouponTransactions("311", null, null, null).Value(); */ lvCoupons.ItemsSource = manager.Coupons; }
private RdlcReportModel GetReportModel() { Assembly assembly = this.GetType().Assembly; RdlcReportModel inst = new RdlcReportModel(); inst.Definition.EmbededReportName = "DMT.TA.Pages.Reports.CollectorCouponReceived.rdlc"; inst.Definition.RdlcInstance = RdlcReportUtils.GetEmbededReport(assembly, inst.Definition.EmbededReportName); // clear reprot datasource. inst.DataSources.Clear(); List <TSBCouponSummary> items = new List <TSBCouponSummary>(); if (null != _summary) { items.Add(_summary); } // gets coupon list by type. manager.User = _user; manager.Refresh(); // reload data. // load C35 items. List <TSBCouponTransaction> c35Items = new List <TSBCouponTransaction>(); var c35coupons = manager.C35Users; if (null != c35coupons) { c35Items.AddRange(c35coupons); } // load C80 items. List <TSBCouponTransaction> c80Items = new List <TSBCouponTransaction>(); var c80coupons = manager.C80Users; if (null != c80coupons) { c80Items.AddRange(c80coupons); } // assign new data source (main for header) RdlcReportDataSource mainDS = new RdlcReportDataSource(); mainDS.Name = "main"; // the datasource name in the rdlc report. mainDS.Items = items; // setup data source // Add to datasources inst.DataSources.Add(mainDS); // assign new data source (main for coupon35) RdlcReportDataSource c35DS = new RdlcReportDataSource(); c35DS.Name = "C35"; // the datasource name in the rdlc report. c35DS.Items = c35Items; // setup data source // Add to datasources inst.DataSources.Add(c35DS); // assign new data source (main for coupon80) RdlcReportDataSource c80DS = new RdlcReportDataSource(); c80DS.Name = "C80"; // the datasource name in the rdlc report. c80DS.Items = c80Items; // setup data source // Add to datasources inst.DataSources.Add(c80DS); // Add parameters (if required). // Coupon Received Date. DateTime today = DateTime.Today; //string couponDate = today.ToThaiDateTimeString("dd/MM/yyyy HH:mm:ss"); string couponDate = today.ToThaiDateTimeString("dd/MM/yyyy"); inst.Parameters.Add(RdlcReportParameter.Create("couponDate", couponDate)); // Supervisor (Current User) string supervisorFullName = DMT.Controls.TAApp.User.Current.FullNameTH; inst.Parameters.Add(RdlcReportParameter.Create("supervisorFullName", supervisorFullName)); return(inst); }