protected void Rg_BankWebSite_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { IList <BankAccountInfo> list; if (TargetId == _reckoningElseFilialeid) { RG_BankWebSite.MasterTableView.Columns.FindByUniqueName("filialeName").Visible = false; RG_BankWebSite.MasterTableView.Columns.FindByUniqueName("FromSourceName").Visible = false; RG_BankWebSite.MasterTableView.Columns.FindByUniqueName("Delete").Visible = false; RG_BankWebSite.MasterTableView.Columns.FindByUniqueName("IsMain").Visible = false; RG_BankWebSite.MasterTableView.Columns.FindByUniqueName("Transfer").Visible = true; list = _bankAccountsWrite.GetList().Where(ent => ent.IsMain == false).ToList(); } else { RG_BankWebSite.MasterTableView.Columns.FindByUniqueName("filialeName").Visible = true; RG_BankWebSite.MasterTableView.Columns.FindByUniqueName("FromSourceName").Visible = true; RG_BankWebSite.MasterTableView.Columns.FindByUniqueName("IsMain").Visible = true; RG_BankWebSite.MasterTableView.Columns.FindByUniqueName("Transfer").Visible = false; //var filiale=CacheCollection.Filiale.Get(TargetId); list = _bankAccountDaoWrite.GetListByTargetId(TargetId); //_bankAccountDaoWrite.GetListByTargetId(TargetId).Where(ent => ent.IsMain).ToList(); } RG_BankWebSite.DataSource = list; }
//结算账号 protected void LoadPayBankAccountData(IList <CostReportInfo> costReportList) { var bankAccountList = new List <BankAccountInfo>(); if (costReportList.Any()) { var bankAccountInfoList = _bankAccounts.GetList(); var payBankAccountIds = costReportList.Where(p => !p.PayBankAccountId.Equals(Guid.Empty)).Select(p => p.PayBankAccountId).Distinct(); bankAccountInfoList = bankAccountInfoList.Where(p => payBankAccountIds.Contains(p.BankAccountsId)).ToList(); if (bankAccountInfoList.Any()) { bankAccountList.AddRange(bankAccountInfoList); } } var selectedValue = ddl_PayBankAccount.SelectedValue; ddl_PayBankAccount.Items.Clear(); ddl_PayBankAccount.Items.Insert(0, new ListItem("请选择", "")); if (bankAccountList.Any()) { foreach (var info in bankAccountList) { var name = info.BankName + "【" + info.AccountsName + "】"; ddl_PayBankAccount.Items.Add(new ListItem(name, info.BankAccountsId.ToString())); } if (ddl_PayBankAccount.Items.FindByValue(selectedValue) != null) { ddl_PayBankAccount.SelectedValue = selectedValue; } } }
//遍历资金帐户 private void RecursivelyBankAccounts(IRadTreeNodeContainer node, Guid filialeId) { if (_reckoningElseFilialeid == filialeId) { var bankAccountsInfoList = _bankAccountsWrite.GetList().Where(ent => !ent.IsMain).OrderByDescending(ent => ent.IsUse).ToList(); foreach (var bankAccountsInfo in bankAccountsInfoList) { var childNode = CreateNode((bankAccountsInfo.IsUse ? "" : "【停用】") + bankAccountsInfo.BankName + "[" + GetBankAccountsCount(bankAccountsInfo.BankAccountsId) + "]", false, bankAccountsInfo.BankAccountsId.ToString(), "BankAccount"); node.Nodes.Add(childNode); } } else { var bankAccountsInfoList = _bankAccountDaoRead.GetListByTargetId(filialeId).OrderByDescending(ent => ent.IsUse).ToList(); foreach (var bankAccountsInfo in bankAccountsInfoList) { var childNode = CreateNode(string.Format("{0}{1}[{2}]", !bankAccountsInfo.IsUse ? "【停用】" : "", bankAccountsInfo.BankName, GetBankAccountsCount(bankAccountsInfo.BankAccountsId)), false, bankAccountsInfo.BankAccountsId.ToString(), "BankAccount"); node.Nodes.Add(childNode); } } }
protected void BankAccountsGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { BankAccountsGrid.DataSource = _bankAccountsWrite.GetList(); }
/// <summary> /// 获取资金帐号列表不关联BankAccountBinding /// </summary> /// <returns></returns> public IList <BankAccountInfo> GetBankAccountsList() { return(_bankAccounts.GetList()); }