private void InitData()
        {
            //初始化查询条件
            List <RoleTypeDto> roleTypeList = new List <RoleTypeDto>();
            DataSet            ds           = service.SearchAllRoleType();

            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    RoleTypeDto roleType = new RoleTypeDto();
                    roleType.RoleTypeCode = Convert.ToString(ds.Tables[0].Rows[i]["RoleTypeCode"]);
                    roleType.RoleTypeName = Convert.ToString(ds.Tables[0].Rows[i]["RoleTypeName"]);
                    roleTypeList.Add(roleType);
                }
            }


            CommonHandler.SetComboBoxEditItems(cboRoleType, roleTypeList, "RoleTypeName", "RoleTypeCode");
            CommonHandler.BindComboBoxItems <RoleTypeDto>(cboRoleTypeInGrid, roleTypeList, "RoleTypeName", "RoleTypeCode");
            grcUserInfo.DataSource = new List <UserInfoDto>();
        }
示例#2
0
 public static RoleType ConvertToRoleType(this RoleTypeDto value)
 {
     return((RoleType)Enum.ToObject(typeof(RoleType), (int)value));
 }