public static List <UserDto> GetUserList(string strwhere) { List <UserDto> UserList = new List <UserDto>(); DataTable dt = CMSService.SelectSome("User", "CMSUser", strwhere); foreach (DataRow dr in dt.Rows) { UserDto dto = UserMapping.getDTO(dr); UserList.Add(dto); } return(UserList); }
//分类列表 public static List <CategoryDto> GetCategoryList(string strwhere) { List <CategoryDto> CategoryList = new List <CategoryDto>(); DataTable dt = CMSService.SelectSome("Category", "CMSCategory", strwhere); foreach (DataRow dr in dt.Rows) { CategoryDto dto = CategoryMapping.getDTO(dr); CategoryList.Add(dto); } return(CategoryList); }
//用户角色列表 public static List <RoleDto> GetRolesList(string strwhere) { List <RoleDto> RolesList = new List <RoleDto>(); DataTable dt = CMSService.SelectSome("Role", "CMSRole", strwhere); foreach (DataRow dr in dt.Rows) { RoleDto dto = RoleMapping.getDTO(dr); RolesList.Add(dto); } return(RolesList); }
//分类的下拉列表显示 public static List <SelectListItem> GetCategorySelectList(string strwhere) { DataTable dt = CMSService.SelectSome("Category", "CMSCategory", strwhere); List <SelectListItem> items = new List <SelectListItem>(); foreach (DataRow dr in dt.Rows) { CategoryDto dto = CategoryMapping.getDTO(dr); items.Add(new SelectListItem { Text = dto.CategoryName, Value = dto.CategoryId.ToString() }); } return(items); }
//用户列表 public static List <SelectListItem> GetUserSelectList(string strwhere) { DataTable dt = CMSService.SelectSome("User", "CMSUser", strwhere); List <SelectListItem> items = new List <SelectListItem>(); foreach (DataRow dr in dt.Rows) { UserDto dto = UserMapping.getDTO(dr); string username = ""; if (String.IsNullOrEmpty(dto.UserRealName)) { username = dto.UserName; } else { username = dto.UserRealName; } items.Add(new SelectListItem { Text = username, Value = dto.UserId.ToString() }); } return(items); }