private void BindIndustryTree() { var industryInfos = _industryService.GetAllIndustry(); var all = new IndustryInfo { Id = 0, ParentId = -1, Name = "全部", Level = 0, }; industryInfos.Add(all); this.tlIndustry.Initialize(industryInfos, "Id", "ParentId", editable: true, showColumns: false, autoWidth: true, showHorzLines: false, showVertLines: false, expandAll: true); this.tlIndustry.AllowDrop = false; this.tlIndustry.OptionsDragAndDrop.DragNodesMode = DevExpress.XtraTreeList.DragNodesMode.Single; this.tlIndustry.SetDefaultFocusedNode(0); }
/// <summary> /// 账户信息绑定 /// </summary> private void BindAccountInfo() { //所属产业 var industrys = _industryService.GetAllIndustry() .Select(x => new ComboBoxItemModel { Value = x.Id.ToString(), Text = x.Name }).ToList(); this.cbIndustry.Initialize(industrys); //账户属性 var attributes = _dictionaryService.GetDictionaryInfoByTypeId((int)EnumLibrary.DictionaryType.AccountAttribute) .Select(x => new ComboBoxItemModel { Value = x.Code.ToString(), Text = x.Name }).ToList(); this.cbAttribute.Initialize(attributes); //账户规划 var plans = _dictionaryService.GetDictionaryInfoByTypeId((int)EnumLibrary.DictionaryType.AccountPlan) .Select(x => new ComboBoxItemModel { Value = x.Code.ToString(), Text = x.Name }).ToList(); this.cbPlan.Initialize(plans); //账户分类 var types = _dictionaryService.GetDictionaryInfoByTypeId((int)EnumLibrary.DictionaryType.AccountType) .Select(x => new ComboBoxItemModel { Value = x.Code.ToString(), Text = x.Name }).ToList(); this.cbType.Initialize(types); //开户券商 var securityCompanys = _dictionaryService.GetDictionaryInfoByTypeId((int)EnumLibrary.DictionaryType.SecurityCompay) .Select(x => new ComboBoxItemModel { Value = x.Code.ToString(), Text = x.Name }).ToList(); this.cbSecurity.Initialize(securityCompanys); if (this._isEdit) { var accountInfo = _accountService.GetAccountDetailById(_accountId); if (accountInfo == null) { return; } this.cbIndustry.DefaultSelected(accountInfo.IndustryId.ToString()); this.cbSecurity.DefaultSelected(accountInfo.SecurityCompanyCode.ToString()); this.cbType.DefaultSelected(accountInfo.TypeCode.ToString()); this.cbAttribute.DefaultSelected(accountInfo.AttributeCode.ToString()); this.cbPlan.DefaultSelected(accountInfo.PlanCode.ToString()); //账户名 txtAccountName.Text = accountInfo.Name; //账户编码 txtCode.Text = accountInfo.Code; //负责人 luOwner.EditValue = accountInfo.Owner; //投入资金 txtInvestFund.Text = accountInfo.InvestFund.ToString(); //融资额 txtFinacingAmount.Text = accountInfo.InvestFund.ToString(); //印花税率 txtStampDutyRate.Text = accountInfo.StampDutyRate.ToString(); //佣金率 txtCommissionRate.Text = accountInfo.CommissionRate.ToString(); //其他费率 txtIncidentalsRate.Text = accountInfo.IncidentalsRate.ToString(); //核算 if (accountInfo.NeedAccounting) { this.chkYes.Checked = true; } else { this.chkNo.Checked = true; } //备注说明 this.memoRemarks.Text = accountInfo.Remarks; } }