private void Binds() { IList <Model.AtBillsIncome> billList = billIncomeManager.Select(); bList = new List <Model.AtBillsIncome>(); if (billList != null) { foreach (Model.AtBillsIncome i in billList) { if (i.BillsOften == "尚未兌現") { Model.AtBankAccount at = bankAccountManager.Get(i.CollectionAccount); Model.Supplier cu = new BL.SupplierManager().Get(i.PassingObject); if (at != null) { i.C = at.BankAccountName; } if (cu != null) { i.A = cu.Id; i.B = cu.SupplierFullName; } bList.Add(i); } } } this.bindingSourcestringbillsOften.DataSource = bList; }
public XRYF2(ConditionYF2 condition) { InitializeComponent(); decimal?a = 0; this.xrLabelCompanyInfoName.Text = BL.Settings.CompanyChineseName; this.xrLabelDataName.Text = Properties.Resources.YF1; IList <Model.AtBillsIncome> list = detailManager.Select(condition.StartDate, condition.EndDate, condition.StartBankAccountId, condition.EndBankAccountId); this.xrLabel2.Text = DateTime.Now.ToShortDateString(); this.xrLabel1.Text = "Date range:" + condition.StartDate.ToShortDateString() + "To" + condition.EndDate.ToShortDateString(); if (list != null) { foreach (Model.AtBillsIncome at in list) { if (at.IncomeCategory == "1") { a += at.NotesMoney; at.PassingObject = new BL.SupplierManager().Get(at.PassingObject) == null ? null : new BL.SupplierManager().Get(at.PassingObject).SupplierShortName; at.CollectionAccount = new BL.AtBankAccountManager().Get(at.CollectionAccount) == null ? null : new BL.AtBankAccountManager().Get(at.CollectionAccount).BankAccountName; oList.Add(at); } } } this.DataSource = oList; this.xrLabel3.Text = "Total:" + a.ToString(); //this.xrTableCell12.DataBindings.Add("Text", this.DataSource, Model.AtBillsIncome.PRO_TheOpenDate, "{0:yyyy-MM-dd}"); this.xrTableCellBillsId.DataBindings.Add("Text", this.DataSource, Model.AtBillsIncome.PRO_Id); //this.xrTableCellTheJpy.DataBindings.Add("Text", this.DataSource, Model.AtBillsIncome.PRO_TheJpy, "{0:yyyy-MM-dd}"); this.xrTableCellTheOpenDate.DataBindings.Add("Text", this.DataSource, Model.AtBillsIncome.PRO_Maturity, "{0:yyyy-MM-dd}"); this.xrTableCell13.DataBindings.Add("Text", this.DataSource, Model.AtBillsIncome.PRO_CollectionAccount); this.xrTableCell14.DataBindings.Add("Text", this.DataSource, Model.AtBillsIncome.PRO_PassingObject); this.xrTableCell15.DataBindings.Add("Text", this.DataSource, Model.AtBillsIncome.PRO_BillsOften); this.xrTableCell16.DataBindings.Add("Text", this.DataSource, Model.AtBillsIncome.PRO_NotesMoney); }