public void BindDepartmentDataSourece() //异步获取部门列表数据并绑定 { //List<Department> list = new List<Department>(); //list = await _sc.QueryDepartment(); List <Department> depList = _sc.QueryDepartment(); if (depList != null) { UserHelper.DepList = depList; this.comboBoxDepartment.DataSource = depList; this.comboBoxDepartment.ValueMember = "Id"; this.comboBoxDepartment.DisplayMember = "Name"; } }
/// <summary> /// 绑定会签单编号:部门简称信息 /// </summary> private void BindIdDepartment(bool isFlush) { //窗体加载时位datagridview绑定数据源 if (UserHelper.DepList == null || isFlush == true) { List <Department> list = _sc.QueryDepartment(); this.IdDepartShortCall.ValueMember = "Id"; this.IdDepartShortCall.DisplayMember = "ShortCall"; this.IdDepartShortCall.DataSource = list; UserHelper.DepList = list; } if (UserHelper.DepList != null) { this.IdDepartShortCall.ValueMember = "Id"; this.IdDepartShortCall.DisplayMember = "ShortCall"; this.IdDepartShortCall.DataSource = UserHelper.DepList; } }