protected void btnPreview_Click(object sender, EventArgs e) { if (dtpStartDate.SelectedDate > dtpEndDate.SelectedDate || dtpStartDate.SelectedDate > DateTime.Now) return; if (dtpEndDate.SelectedDate.ToString().Trim() == string.Empty) return; if ((dtpStartDate.SelectedDate.ToString().Trim() == string.Empty)) dtpStartDate.SelectedDate = dtpStartDate.MinDate; TransQuery tQ = new TransQuery(); tQ.Select(tQ.TransNumber, tQ.TransDate, tQ.Descript, tQ.DebitAmount, tQ.CreditAmount); tQ.Where(tQ.TransDate >= dtpStartDate.SelectedDate, tQ.TransDate <= dtpEndDate.SelectedDate); TransCollection tColl = new TransCollection(); tColl.Load(tQ); if (tColl.Count > 0) { RSCM_BKU_web.Report.LaporanKasBank report1 = new RSCM_BKU_web.Report.LaporanKasBank(); report1.ReportParameters[0].Value = "Toro"; report1.ReportParameters[1].Value = dtpStartDate.SelectedDate; report1.ReportParameters[2].Value = dtpEndDate.SelectedDate; report1.DataSource = tColl; LaporanKasBankWebViewer.Report = report1; LaporanKasBankWebViewer.RefreshReport(); } else return; }
public void Proceed() { int lasnumber = 0; DateTime transdate = DateTime.Now; TransQuery trans = new TransQuery("a"); trans.SelectAll(); trans.Where(trans.TransNumber >= txtTransNumber.Text.Trim()); trans.OrderBy(trans.TransNumber.Ascending,trans.BkuId.Ascending); TransCollection tC = new TransCollection(); if (tC.Load(trans)) { string autonumber = "201212-0438"; int count = 438; foreach (Trans t in tC) { Trans tt = new Trans(); if (tt.LoadByPrimaryKey((long)t.BkuId)) { string number = count.ToString().Trim(); if (number.Length == 3) number = "0" + number; tt.TransNumber = "201212-" + number; tt.Save(); count++; } } } }
protected void btnPreview_Click(object sender, EventArgs e) { if (dtpStartDate.SelectedDate > dtpEndDate.SelectedDate || dtpStartDate.SelectedDate > DateTime.Now) return; if (dtpEndDate.SelectedDate.ToString().Trim() == string.Empty) return; if ((dtpStartDate.SelectedDate.ToString().Trim() == string.Empty)) dtpStartDate.SelectedDate = dtpStartDate.MinDate; //Load All Valid Kas KasQuery kasQ = new KasQuery("a"); PeriodeAnggaranQuery paQ = new PeriodeAnggaranQuery("b"); kasQ.InnerJoin(paQ).On(kasQ.PeriodeId == paQ.Id); kasQ.Select(kasQ.KaCode, kasQ.KaName); paQ.Where(paQ.IsClosed == false); KasCollection kasC = new KasCollection(); kasC.Load(kasQ); ReportBook rb = new ReportBook(); foreach (Kas k in kasC) { TransQuery tQ = new TransQuery("c"); tQ.Select(tQ.TransNumber, tQ.TransDate, tQ.Descript, tQ.DebitAmount, tQ.CreditAmount); tQ.Where(tQ.TransDate >= dtpStartDate.SelectedDate, tQ.TransDate <= dtpEndDate.SelectedDate,tQ.KasId == k.KaCode); TransCollection tColl = new TransCollection(); tColl.Load(tQ); if (tColl.Count > 0) { RSCM_BKU_web.Report.LaporanKasBank report1 = new RSCM_BKU_web.Report.LaporanKasBank(); report1.ReportParameters[0].Value = k.KaName; report1.ReportParameters[1].Value = dtpStartDate.SelectedDate; report1.ReportParameters[2].Value = dtpEndDate.SelectedDate; report1.DataSource = tColl; rb.Reports.Add(report1); } } //ReportViewer1.Report = rb; //ReportViewer1.RefreshReport(); }
public bool Load(TransQuery query) { this.query = query; base.InitQuery(this.query); return(this.Query.Load()); }