供您參考,請檢查以下內容。這不是完美的解決方案,需要修改一些參照完整性等。只需爲您的要求提供一些想法。
- DB設計
-- user information
create table USERS (USER_ID INT IDENTITY PRIMARY KEY, USER_NM NVARCHAR(100) NOT NULL)
insert into USERS values ('Admin');
insert into USERS values ('User 1');
insert into USERS values ('User 2');
insert into USERS values ('User 3');
-- role description
create table ROLES_DESC (ID INT IDENTITY PRIMARY KEY, ROLE_ID INT NOT NULL, ROLE_DESC NVARCHAR(50) NOT NULL)
INSERT INTO ROLES_DESC VALUES (1,'Admin');
INSERT INTO ROLES_DESC VALUES (2,'User');
-- assing each user to at least one role
create table ROLES (ID INT IDENTITY PRIMARY KEY, USER_ID INT NOT NULL, ROLE_ID INT NOT NULL)
insert into ROLES (1,1) -- admin
insert into ROLES (2,2) -- User 1
insert into ROLES (3,2) -- User 2
insert into ROLES (4,2) -- User 3
-- task infomration
create table TASKS (ID INT IDENTITY PRIMARY KEY, TASK_DESC VARCHAR(100))
insert into TASKS values ('C# Programming');
insert into TASKS values ('Database Programming');
insert into TASKS values ('Match Homework');
-- admin can assing task to each user.. save here
create table ASSINGMENTS (ID INT IDENTITY PRIMARY KEY, USER_ID INT NOT NULL, TASK_ID INT NOT NULL, ASSING_DT DATETIME DEFAULT GETDATE())
insert into ASSINGMENTS (USER_ID,TASK_ID) values (2,1);
insert into ASSINGMENTS (USER_ID,TASK_ID) values (2,2);
insert into ASSINGMENTS (USER_ID,TASK_ID) values (3,1);
insert into ASSINGMENTS (USER_ID,TASK_ID) values (4,3);
---------在ASPX你有管理頁面和用戶頁面 在管理頁面,使用templatefiled列(用戶下拉菜單和任務下拉列表) 用戶下拉
SELECT USER_ID, USER_NM) FROM USERS WHERE ID <> 1 -- (only select non-admin user)
任務下拉列表
SELECT ID, TASK_DESC FROM TASKS
- 當更新任務,每個用戶的事件,讀取網格數據並保存到ASSINGMENTS表
對於用戶頁面 -
只是讀取ASSINGMENTS表中的數據與用戶加入,任務表如下並結合gridview
SELECT A.TASK_ID, T.TASK_DESC, A.ASSING_DT
FROM ASSINGMENTS A
INNER JOIN TASKS T ON (A.TASK_ID = T.ID)
WHERE A.USER_ID = 2
爲什麼要將柵格數據導出到另一個頁面?在另一個頁面中,您可以在將第一個網格數據中的數據更新到數據庫後加載所需的數據。 – 2012-02-14 08:38:16
管理員將數據分配給用戶...分配的數據將以網格形式發送給用戶@ ThitLwinOo – SoftwareNerd 2012-02-14 08:41:45