i have a form which is supervisor ,manager and director aspx forms . when any user upload documents then this document first goes to supervsior then manager and then director for approve/reject
user "kat" uplaod document and his/her document goes for approval /reject to supervsior,manager,director and it seems like this in table
Seqno DocID ApproveID ApproveBy DesigID ApproveDate
1 16 1 abc 1 10/11/2013
2 16 1 def 2 11/12/2013
3 16 1 xyzz 3 14/12/2013
when user "kat" see document wheather document approve/reject it seems like this
docname fileuploaded uploadedate deptype status
finad fina.docx 04/11/2013 finance approve
when another user upload document and when this document goes for approval to supervsior,manager,director
then in supervsior form it seems like this
docid docname filename department email uploadedby uploadedate
16 finad fina.docx fiance sadas@gmail.com kat 04/11/2013 (this is old document)
17 hrrr hrr.docs finance abc@gmail.com john 15/11/2013 (this is new document
)
so when supervsior approve document (docid 17) then old document which is already approve/reject also save in database and after this in table seems like this
Seqno DocID ApproveID ApproveBy DesigID ApproveDate
1 16 2 abc 1 10/11/2013
2 16 1 def 2 11/12/2013
3 16 1 xyzz 3 14/12/2013
5 17 3 dfsdf 1 15/11/2013
here 1 is approve and 3 is pending
"i use dropdown and in dropdown i fill all values in dropdown "approve,reject ,pending"
so when "kat" agian to see his /her document it sees me like this
dropdown[
^]
docname fileuploaded uploadedate deptype status
finad fina.docx 04/11/2013 finance reject
i use sp like this
ALTER procedure [dbo].[approveddd]
@DocID int,
@ApproveID int,
@ApproveBy nvarchar(50),
@DesigID int
as
IF EXISTS(Select DocID from Approval where DocID=@DocID and ApproveBy=@ApproveBy)
Update Approval set ApproveID=@ApproveID where DocID=@DocID and ApproveBy=@ApproveBy
ELSE
insert Approval (DocID,ApproveID,ApproveBy,DesigID,ApproveDate)
values(@DocID,@ApproveID,@ApproveBy,@DesigID,GETDATE())