我在列表TaskList
的GridView1
右侧列出我正在显示工人列表having different skills under one
serviceCategoryID。点击GridView1
Row 和所有Workers with multiple skills under one serviceCategoryID are Listed in GridView2
.
在将任务分配给任何工人之前,我想显示该PendingTasks
工人的GridView2
数量List of Workers with multiple skills under one selected serviceCategoryID from GridView1.
当前的 SQL 查询是:
SELECT WorkerMst.workerID, WorkerMst.FName, WorkerMst.LName,WorkerMst.FName +' '+ WorkerMst.LName as Name,WorkerSkills.WorkerSkillsID,
WorkerSkills.WorkerID AS WorkerSkills_WorkerID, WorkerSkills.SkillTypeID AS WorkerSkills_SkillTypeID, WorkerSkills.Score, skillTypeMst.skillTypeID, skillTypeMst.skillType,
serviceCategoryMaster.serviceCategoryMasterID, serviceCategoryMaster.CategoryName, WorkerMst.IsActive AS WorkerMst_IsActive,WorkerMst.IsIndividual,WorkerMst.readyfornewtask,
(select count(WorkerID)from WorkerTask where isAproved=0 and workerid in (select distinct(workerid) from workertask where isaproved=0 group by workerid)) as PendingTsks
FROM WorkerMst
INNER JOIN WorkerSkills ON WorkerMst.workerID = WorkerSkills.WorkerID
INNER JOIN skillTypeMst ON WorkerSkills.SkillTypeID = skillTypeMst.skillTypeID
INNER JOIN serviceCategoryMaster ON skillTypeMst.serviceCategoryMasterID = serviceCategoryMaster.serviceCategoryMasterID
where skillTypeMst.serviceCategoryMasterID=1 and
WorkerMst.workerID in (select distinct(workerid) from workertask where isaproved=0)
order by workermst.workerid
WorkerTask
表具有以下字段:
WorkerID,TaskMstID,IsAccepted ,IsRejected,OnDate,isAproved
有什么建议吗?帮助赞赏!提前致谢!