/// <summary> /// 绑定用户账号类型 /// </summary> private void BindAccountType() { Dictionary <string, string> dataSource = new Dictionary <string, string>(); foreach (var item in WebComm.GetAccountListByXml()) { dataSource.Add(item.TypeID.ToString(), item.TypeName); } Dictionary <string, object> attrCardType = null; List <SelectListItem> itemList = null; WebComm.BindComBox(dataSource, out attrCardType, out itemList); ViewBag.attrAccountType = attrCardType; ViewBag.accountList = itemList; }
/// <summary> /// 绑定用户下拉列表 /// </summary> private void BindComboxUser() { Dictionary <string, string> dataSource = new Dictionary <string, string>(); foreach (var item in db.Users.Where(c => c.cUserFlag == true).ToList()) { dataSource.Add(item.cUserCode.ToString(), item.cUserName); } Dictionary <string, object> attrCardType = null; List <SelectListItem> itemList = null; WebComm.BindComBox(dataSource, out attrCardType, out itemList); ViewBag.attruser = attrCardType; ViewBag.userList = itemList; }