C#MVC Sql加入然后显示 [英] C# MVC Sql Joins then Display

查看:59
本文介绍了C#MVC Sql加入然后显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我在MVC的某些部分遇到了麻烦,可以提供一些帮助.

我希望程序将文件夹的网格加载到主页上,每个模块都包含模块名称,ID和每个按钮,其作用类似于Windows资源管理器显示文件夹和子文件夹的方式.用户可以重新排列网格上的文件夹,然后单击它们以转到子文件夹(如果有的话).

数据库的设置如下:
文件夹

Hey guys, Im having trouble with a few parts of MVC and could do with some help.

I want the program to load a grid of folders onto the main page each either the modules name, ID and a button in each which acts similar to how windows explorer displays folders and subfolders. Users can rearrange the folders on the grid and click them to go to sub folders if it has any.

The database is set up like this:
Folders

FolderID, FolderName, ParentID, ClientID




Groups

GroupID, GroupName,IsGlobalAdmin, ClientID


组权限


Group permissions

ID, GroupID, FolderID, HasRead


文件夹位置


Folder Positions

ID, FolderID, UserID, Position



我需要一条语句,使用LINQ to Sql可以根据允许组从HasRead列看到的内容以及是否具有相同的ClientID以及用户在文件夹位置"表中设置的位置顺序来加载网格. />
如果它们是全局管理员,则数据库将加载该ClientID的所有文件夹

有什么链接或代码可供我玩吗?我正在努力寻找可以在MVC中涵盖此类内容的任何内容,我可以通过webforms很好地对其进行管理,但这是如此不同,因此我需要您提供建议.

在此先感谢



I need a statement that using LINQ to Sql loads the grid based off what the group is allowed to see based off the HasRead column and if they have the same ClientID and in the order of positions that user set in the Folder positions table.

If they are a global admin the database loads all folders for that ClientID

Any links or code for me to play with? I''m struggling to find anything that covers this kind of thing in MVC, I managed it in webforms fine but this is so different I need the advise.

Thanks in advance

推荐答案

这应该使您入门.
http://mvccontrolstoolkit.codeplex.com/wikipage?title=TreeView [
This should get you started.
http://mvccontrolstoolkit.codeplex.com/wikipage?title=TreeView[^]


这篇关于C#MVC Sql加入然后显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆